Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2015] [Day 20]: Infinite Elves and Infinite Houses #20

Open
victoraugustofd opened this issue Dec 22, 2024 · 1 comment
Open

[2015] [Day 20]: Infinite Elves and Infinite Houses #20

victoraugustofd opened this issue Dec 22, 2024 · 1 comment
Assignees
Labels
puzzle Advent of Code challenge
Milestone

Comments

@victoraugustofd
Copy link
Owner

victoraugustofd commented Dec 22, 2024

Challenge description

To keep the Elves busy, Santa has them deliver some presents by hand, door-to-door. He sends them down a street with infinite houses numbered sequentially: 1, 2, 3, 4, 5, and so on.

Each Elf is assigned a number, too, and delivers presents to houses based on that number:

  • The first Elf (number 1) delivers presents to every house: 1, 2, 3, 4, 5, ....
  • The second Elf (number 2) delivers presents to every second house: 2, 4, 6, 8, 10, ....
  • Elf number 3 delivers presents to every third house: 3, 6, 9, 12, 15, ....

There are infinitely many Elves, numbered starting with 1. Each Elf delivers presents equal to ten times his or her number at each house.

So, the first nine houses on the street end up like this:

House 1 got 10 presents.
House 2 got 30 presents.
House 3 got 40 presents.
House 4 got 70 presents.
House 5 got 60 presents.
House 6 got 120 presents.
House 7 got 80 presents.
House 8 got 150 presents.
House 9 got 130 presents.

The first house gets 10 presents: it is visited only by Elf 1, which delivers 1 * 10 = 10 presents. The fourth house gets 70 presents, because it is visited by Elves 1, 2, and 4, for a total of 10 + 20 + 40 = 70 presents.

What is the lowest house number of the house to get at least as many presents as the number in your puzzle input?

Challenge input

34000000

Challenge year

2015

@victoraugustofd victoraugustofd added the puzzle Advent of Code challenge label Dec 22, 2024
@victoraugustofd victoraugustofd self-assigned this Dec 22, 2024
@victoraugustofd victoraugustofd added this to the 2015 Challenges milestone Dec 22, 2024
@victoraugustofd
Copy link
Owner Author

Challenge link

https://adventofcode.com/2015/day/20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
puzzle Advent of Code challenge
Projects
Status: Backlog
Development

No branches or pull requests

1 participant