Consider the sequence a 1 , a 2 , a 3 , a 4 , … such that a 1 = 2 and for every positive integer n ,
a n + 1 = a n + p n , where p n is the largest prime factor of a n .
The first few terms of the sequence are 2 , 4 , 6 , 9 , 1 2 , 1 5 , 2 0 . What is the largest value of n such that a n is a four-digit number?
Note : This is adapted from a Mathematics competition. Happy solving; From Issac Newton,
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.
Well, I observed another thing: for prime
p
,
a
2
p
−
2
=
p
2
I think this is equivalent to yours.
Right, I got the sequence 1,3,6,10,16,21, 27, 33 (which is the sequence of the positions of the numbers which were in the form p q in the original sequence). I couldn't find the pattern and kept taking multiple differentials over and over till I just gave up :D. If only I added 2 to each number in the sequence haha
Log in to reply
It doesn't have to be that counter-intuitive. Just factorize incompletely each number in the sequence:
observed that the sequence is
2×1 , 2×2 , 2×3 , 3×3 , 3×4 , 3×5 , 4×5 , 5×5
There are some perfect square of prime , Consider from a part of sequence (p,q are primes)
p×(p+1) , p×(p+2) , ... , p×q , p+1×q , p+2×q , ... , q×q
There are 2(q-p) terms , So the Sequence
2×1 , 2×2 , 2×3 , 3×3 , ... p×p , ... , q×q , ... , r×r
there are 2(r-q) + 2(q-p) + 2(p-3) + 2(3-2) + 2 terms , which simplify to 2r-2
now find a prime number that squared is less than 9999
that prime is 97 (97×97 = 9409)
so the sequence
2 , 4 ,6 , 9 , .... , 9409
has 192 terms , now keep finding few next terms
a192 = 97×97
a193 = 98×97
a194 = 99×97
a195 = 100×97
a196 = 101×97
a197 = 101×98
a198 = 101×99
so the answer is 198
This is a wonderful combination of observation and algebra. This should be the top solution... if it has more LaTeX.
I like this solution. I did something similar, after the first few you get a logical idea of what it all means, and it just sort of comes together.
We notice that the sequence of a n is as follows: S n = { 2 , 4 , 6 , 9 , 1 2 , 1 5 , 2 0 , 2 5 , 3 0 , 3 5 . . . } = { 1 ˙ 2 , 2 ˙ 2 , 2 ˙ 3 , 3 ˙ 3 , 4 ˙ 3 , 3 ˙ 5 , 4 ˙ 5 , 5 ˙ 5 , 6 ˙ 5 , 5 ˙ 7 . . . }
If q n denotes the n t h prime, then:
S n = { q 1 , 2 q 1 , q 1 q 2 , 3 q 2 , 4 q 2 , q 2 q 3 , 4 q 3 , 5 q 3 , 6 q 3 , q 3 q 4 . . . q k q k + 1 . . . }
When a n = q k q k + 1 then
n = ( q 2 − 0 ) + ( q 3 − q 1 ) + ( q 4 − q 2 ) + . . . + ( q k + 1 − q k ) = q k + 1 + q k − q 1
For example:
When k = 1 or a n = 2 ˙ 3 = 6 ⇒ n = q 2 + q 1 − q 1 = 0 + 3 + 2 − 2 = 3 .
When k = 2 or a n = 1 5 ⇒ n = q 3 + q 2 − q 1 = 5 + 3 − 2 = 6
When k = 3 or a n = 3 5 ⇒ n = q 4 + q 3 − q 1 = 7 + 5 − 2 = 1 0
The largest k for a n < 1 0 0 0 0 is 2 5 , when a n 1 = q 2 5 q 2 6 = 9 7 ˙ 1 0 1 = 9 7 9 7 , when n = 1 0 1 + 9 7 − 2 = 1 9 6 .
Then a 1 9 7 = 9 7 9 7 + 1 0 1 = 9 8 9 8 and a 1 9 8 = 9 8 9 8 + 1 0 1 = 9 9 9 9 .
Therefore the largest n = 1 9 8 .
Lemma : For every prime p , the perfect square p 2 occupies position 2 p − 2 in the sequence.
Thus, the last perfect square less than 1 0 0 2 is p = 9 7 at position 192.
The sequence then continues: a 1 9 2 = 9 7 2 , a 1 9 3 = 9 7 ⋅ 9 8 , a 1 9 4 = 9 7 ⋅ 9 9 , a 1 9 5 = 9 7 ⋅ 1 0 0 , a 1 9 6 = 9 7 ⋅ 1 0 1 , a 1 9 7 = 9 8 ⋅ 1 0 1 , a 1 9 8 = 9 9 ⋅ 1 0 1 = 9 9 9 9 . Thus the answer is 1 9 8 .
(Or, once you detect the pattern, count backward from a 2 0 0 = 1 0 1 2 .)
Proof of the lemma, by induction. Suppose the statement is true for some prime p , and let p ′ be the next prime number. Then a 2 p − 2 + 1 = p ⋅ ( p + 1 ) , a 2 p − 2 + n = p ⋅ ( p + n ) a p + p ′ − 2 = p ⋅ p ′ , a p + p ′ − 1 = ( p + 1 ) ⋅ p ′ , a p + p ′ + n − 2 = ( p + n ) ⋅ p ′ a 2 p ′ − 2 = p ′ ⋅ p ′ . for p + n ≤ p ′ , for p + n ≤ p ′ , Since the statement is true for p = 2 ( a 2 = 2 2 ), it is true for all prime numbers.
2×1,2×2,2×3|3×3,3×4,3×5|...97×101|101×98,101×99 so we see that answer is 3+(5-2)+(7-3)+(11-5)+...+(101-89)+2= 101+97=198 a198=9999
I observed that every other nimber in the pattern is either a perfect square of a prime, or one below the perfect square of a composite, for each even term of the sequence a n it is the either the square or 1 less the square of 2 n + 1 , the closest square to 9 9 9 9 is 1 0 0 0 0 = 1 0 0 2 so 1 0 0 = 2 n + 1 and n = 1 9 8 , because 1 0 0 0 0 is the square of a composite and not a prime, a 1 9 8 is 1 less than 1 0 0 0 0 , or 9 9 9 9 and the answer is 1 9 8
Disclaimer: I'm aware this isn't a mathematically stable argument as I gave no proof for the pattern I found however as this problem was from a mathematic competition I had speed in mind and went with the pattern I first saw
Problem Loading...
Note Loading...
Set Loading...
The key fact is: if p and q are consecutive primes, then a p + q − 2 = p q .
You can see this by induction: it's true for p = 2 , q = 3 , and then if it's true for p and q , suppose r is the next prime after q . Then the terms of the sequence between a p + q − 2 and a q + r − 2 are pretty clearly an arithmetic sequence with common difference q , as q is the largest prime factor of all of them. So a q + r − 2 = q r and the inductive hypothesis holds.
So a 1 9 6 = 9 7 ⋅ 1 0 1 , and then a 1 9 8 = 9 9 ⋅ 1 0 1 = 9 9 9 9 , so 1 9 8 is the answer.