Find the largest possible n such that ⌊ 1 ⌋ + ⌊ 2 ⌋ + ⌊ 3 ⌋ + ⋯ + ⌊ n ⌋ is a prime number.
Clarification: ⌊ x ⌋ returns the largest integer less than or equal to x .
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
Ans: 47 (floor) Ans: 34 (ceiling)
Is the first sum formula widely known?
I might have approached it a slightly different way but it essentially boils down to the same thing. Interestingly it also yields 1+2^2+3^2+....+(p-1)^2 divides p for all primes.
Set q=(p-1)/2, then
1^2+2^2+...+q^2 = q (q+1) (2*q+1)/6
= q*(q+1)/6 * p
Which is a multiple of p for all primes greater than 3.
Yours is a much tidier solution but made a few leaps that weren't obvious, at least to me.
Log in to reply
Nah, I just skipped some steps. It's 2 d = 1 ∑ m − 1 d 2 + d = 1 ∑ m − 1 d = 2 6 m ( m − 1 ) ( 2 m − 1 ) + 2 m ( m − 1 ) , which simplifies to what I had above.
"We will use this to show that S_n is composite based on the value of a." ... "So it can't be composite..." Don't you mean "So it must be composite..."?
Let p be the greatest integer whose square is less than or equal to n ; that is, n = p 2 + k , 0 ≤ k ≤ 2 p . The corresponding sum is S ( n ) = i = 1 ∑ n ⌊ i ⌋ = q = 1 ∑ p − 1 q ( 2 q + 1 ) + p ( k + 1 ) ; using the facts that ∑ i = 1 m i = 2 1 m ( m + 1 ) and ∑ i = 1 m i 2 = 6 1 m ( m + 1 ) ( 2 m + 1 ) , S ( n ) = 6 2 ( p − 1 ) p ( 2 p − 1 ) + 2 1 ( p − 1 ) p + p ( k + 1 ) = p ( k + 1 + ( p − 1 ) ⋅ 6 4 p + 1 ) . If this is to be prime, p must be a factor of the denominator 6; our best hope is p = 6 . In that case, S ( n ) = S ( 3 6 + k ) = 6 ( k + 1 + 5 ⋅ 2 5 6 ) = 1 3 1 + 6 k . Checking the possible values k = 1 2 , 1 1 , … , 0 , we first reject S ( 3 6 + 1 2 ) = 2 0 3 = 7 ⋅ 2 9 ; but we approve S ( 3 6 + 1 1 ) = 1 9 7 , which is prime.
Thus the answer, with p = 6 and k = 1 1 , is 6 2 + 1 1 = 4 7 , corresponding to the sum S ( 4 7 ) = 1 9 7 .
Nice solution. Your solution makes much clear where I got wrong as I got it correct in second attempt. :)
I am ashamed of saying this but I did this using a script. I calculated the values of the sequence for the n in 1:1000 and checked for which one's were prime. I noticed that 47 seemed to be biggest one I tried that one and lo and behold.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
Ans: 47
Log in to reply
It seems similar. I did mine on R since I had that open.
You mean this script
I “cheated” differently - used Excel. I realize that’s not a valid proof.
There is no shame in using code... but is it satisfactory? How do you know that there is no six-digit number n for which the sum is suddenly a prime number again?
Log in to reply
It is not satisfactory. My plan was that I would just calculate a certain amount to get a sense of the question, maybe a pattern would reveal itself.
Anyways, I noticed that 47 seemed to be biggest. I was thinking of maybe a demonstration by the absurd. Someone called me so I had to leave so I decided to at least see if 47 was the answer since we have 3 chances.
Mathematica :
Select[Range@1000,PrimeQ@Tr@Floor[Sqrt@Range@#]&]
Problem Loading...
Note Loading...
Set Loading...
Call the sum S n . Now first note that S m 2 − 1 is easy to compute: for each d between 1 and m − 1 , there are 2 d + 1 consecutive d terms. So we get d = 1 ∑ m − 1 d ( 2 d + 1 ) = 6 m ( m − 1 ) ( 4 m + 1 ) .
Let a = ⌊ n ⌋ . Then S n = S a 2 − 1 + a ( n − a 2 + 1 ) . We will use this to show that S n is composite based on the value of a .
If p ∣ a , p prime, p ≥ 5 : Then S a 2 − 1 is divisible by p , from the formula above, and so S n is as well. So it must be composite, since S a 2 − 1 is clearly larger than a for a ≥ 2 , but it has a nontrivial prime divisor ≤ a .
If 4 ∣ a : Same thing; S a 2 − 1 is even, by the above formula, and so S n is as well.
If 9 ∣ a : Same thing; S a 2 − 1 is divisible by 3 , by the above formula, and so S n is as well.
This restricts us to the cases a = 1 , 2 , 3 , 6 . And in fact, when a = 6 there are several examples where S n is prime. The largest of these is n = 4 7 , S n = 1 9 7 (the only possible larger one is n = 4 8 , S n = 2 0 3 , which is in fact composite). So this is the maximum possible value of n .