Page 1 of 1

Problem 601

Posted: Mon Dec 02, 2019 4:16 pm
by Valentyn_Shtronda
Hi,
It's rather suggestion, not clarification.
Problem says:
the smallest positive integer k such that n+k is not divisible by k+1
Since k starts from 1, the following examples seem unnecessary:
13 is divisible by 1
120 is divisible by 1

Re: Problem 601

Posted: Tue Dec 03, 2019 6:51 am
by jaap
I disagree. $k$ is essentially the length of the streak, i.e. how many consecutive lines in the two examples have divisibility before the line where it is no longer divisible. Like a lucky streak, it is about how long you can keep it going before your luck runs out. The divisibility by 1 is part of that, regardless of the fact that a streak can never have length zero.

Re: Problem 601

Posted: Tue Dec 03, 2019 7:01 am
by Valentyn_Shtronda
OK, makes sense, just confusing a bit when first read.

Re: Problem 601

Posted: Sun Oct 18, 2020 7:41 pm
by drwhat
I was able to use an algorithm that correctly gives the answer to the examples.
To be clear, the answer should be the sum of 31 summands? Not ranging 1 to 31 for each power of 4? That is I should only be calculating:
P(1,4) + P(2,16) + P(3,64) + ...

I wrote a brute force algorithm as well, that was able to get to P(18,4^18) and all the numbers from my algorithm match the brute force one. Obviously each successive P(s,n) takes at least 4x longer to brute force so getting to 31 this way would take quite a while. I feel like I have the correct algorithm, but I must be making some silly mistake somewhere.

If so, is anyone who has solved the problem willing to let me PM a list of of those number and see where I might have gone off?