A recurrence to relate to

Algebra Level 3

a n + 2 = ( n + 3 ) a n + 1 ( n + 2 ) a n \large a_{n+2} = (n + 3)a_{n+1} - (n + 2)a_{n}

For whole numbers n n , consider the recurrence relation defined as above with a 1 = 1 , a 2 = 3 a_{1} = 1, a_{2} = 3 .

Find ( k = 1 2015 a k ) ( m o d 100 ) . \displaystyle\bigg( \sum_{k=1}^{2015} a_{k} \bigg)\pmod{100}.


The answer is 9.

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.

3 solutions

Rewrite the recurrence as a n + 2 a n + 1 = ( n + 2 ) ( a n + 1 a n ) . a_{n+2} - a_{n+1} = (n + 2)(a_{n+1} - a_{n}).

The letting b n = a n a n 1 b_{n} = a_{n} - a_{n-1} with b 1 = 1 b_{1} = 1 we have

b n + 2 = ( n + 2 ) b n + 1 b_{n+2} = (n + 2)b_{n+1} for n 0. n \ge 0. Then

b 2 = 2 , b 3 = 3 2 = 6 , b 4 = 4 3 2 = 24 , b_{2} = 2, b_{3} = 3*2 = 6, b_{4} = 4*3*2 = 24, and in general b n = n ! . b_{n} = n!.

Then a n = b n + a n 1 = b n + b n 1 + a n 2 = . . . . = m = 1 n m ! . a_{n} = b_{n} + a_{n-1} = b_{n} + b_{n-1} + a_{n-2} = .... = \displaystyle\sum_{m=1}^{n} m!.

Now for n 10 n \ge 10 we have that the last two digits of n ! n! are 00. 00. So for 10 k 2015 10 \le k \le 2015 we have that

a k ( 1 ! + 2 ! + 3 ! + 4 ! + 5 ! + 6 ! + 7 ! + 8 ! + 9 ! ) ( m o d 100 ) a_{k} \equiv (1! + 2! + 3! + 4! + 5! + 6! + 7! + 8! + 9!) \pmod{100} \equiv

( 1 + 2 + 6 + 24 + 20 + 20 + 40 + 20 + 80 ) ( m o d 100 ) = 13. (1 + 2 + 6 + 24 + 20 + 20 + 40 + 20 + 80) \pmod{100} = 13.

So ( k = 10 2015 a k ) ( m o d 100 ) ( 2006 13 ) ( m o d 100 ) = 78. \displaystyle\left(\sum_{k=10}^{2015} a_{k}\right) \pmod{100} \equiv (2006*13) \pmod{100} = 78.

Next, ( k = 1 9 a k ) ( m o d 100 ) \displaystyle\left(\sum_{k=1}^{9} a_{k}\right) \pmod{100} \equiv

( 9 1 + 8 2 + 7 6 + 6 24 + 5 20 + 4 20 + 3 40 + 2 20 + 1 80 ) ( m o d 100 ) (9*1 + 8*2 + 7*6 + 6*24 + 5*20 + 4*20 + 3*40 + 2*20 + 1*80) \pmod{100} \equiv

( 9 + 16 + 42 + 44 + 0 + 80 + 20 + 40 + 80 ) ( m o d 100 ) = 31. (9 + 16 + 42 + 44 + 0 + 80 + 20 + 40 + 80) \pmod{100} = 31.

Thus the desired answer is 78 + 31 = 9 . 78 + 31 = \boxed{9}.

Great, fun problem (+1).

As Brian notes, we have the recursion a n = a n 1 + n ! . a_n=a_{n-1}+n!. Since n ! 0 ( m o d 100 ) n!\equiv{0}\pmod{100} for n 10 n\geq{10} , we find that a 9 a 10 a 11 . . . ( m o d 100 ) a_9\equiv{a_{10}}\equiv{a_{11}}...\pmod{100} . We can easily compute a n a_n for n = 3...9 n=3...9 using the recursion a n = a n 1 + n ! a_n=a_{n-1}+n! , and we have, modulo 100, k = 1 2015 a k 1 + 3 + 9 + 33 + 53 + 73 + 13 + 33 + ( 2015 8 ) 13 9 \sum_{k=1}^{2015}a_k\equiv1+3+9+33+53+73+13+33+(2015-8)13\equiv{\boxed{9}}

Otto Bretscher - 6 years ago

Log in to reply

Thanks! Sorry for the silly mistake; apparently I can't add and multiply properly in the wee hours of the morning. :P

Brian Charlesworth - 6 years ago

I think there is an error here: k = 10 2015 a k 2006 13 78 ( m o d 100 ) . \sum_{k = 10}^{2015} a_k \equiv 2006 \cdot 13 \equiv 78 \pmod{100}.

Jon Haussmann - 6 years ago

Log in to reply

Thanks Jon! That explains the discrepancy between Brian's solution and mine...

Otto Bretscher - 6 years ago

Thanks, Jon. That was such a silly mistake on my part. I should stop posting problems at 2 in the morning. :P

Brian Charlesworth - 6 years ago

Very nice problem, sir!!😊😊😊😊

Harsh Shrivastava - 6 years ago

Log in to reply

Thanks, Harsh. :)

Brian Charlesworth - 6 years ago

Nice! My solution is similar. However I made use of the fact that since the values of a k a_k are congruent mod 100 100 for k 10 k \ge 10 , then every 100 100 entries after that will add up to a multiple of 100 100 . Hence the last 2000 2000 entries add to 0 ( m o d 100 ) 0 \pmod{100} , and we only need to find the sum of the first 15 15 numbers.

Ariel Gershon - 6 years ago

I used the following code, and it produced '9'.

Sub series_sum()

a1 = 1

a2 = 3

s = 4

For k = 1 To 2013

ak = ((k + 3) * a2 - (k + 2) * a1) Mod 100

s = (s + ak) Mod 100

a1 = a2

a2 = ak

Next k

If s < 0 Then s = s + 100

MsgBox (s)

End Sub

Hosam Hajjir - 6 years ago
Brock Brown
May 28, 2015

Python 2.7:

1
2
3
4
5
6
7
memo = {1:1, 2:3}
def f(n):
    if n in memo:
        return memo[n]
    memo[n] = (n+1)*f(n-1)-(n)*f(n-2)
    return memo[n]
print "Answer:", sum([f(n) for n in xrange(1,2016)]) % 100

Short but sweet. :) Thanks for posting this.

Brian Charlesworth - 6 years ago

Log in to reply

Next time sir , please tell us that solving by using a computer is OK.

Chandrachur Banerjee - 6 years ago

Log in to reply

I always prefer an analytic solution whenever possible, and in this case, as per my solution, it is; it didn't even require a calculator to solve. However, I still appreciate that Brock is always able to come up with a program.

The option to use a computer program is never forbidden on Brilliant, but for "math" problems it is generally encouraged to seek out a "math" solution, as opposed to a programming solution.

Brian Charlesworth - 6 years ago

Log in to reply

@Brian Charlesworth I think this kills the purpose of the problem.See computer reduces a Level 5 algebra to Level 2 Computer science problem.

Chandrachur Banerjee - 6 years ago

Log in to reply

@Chandrachur Banerjee Fair enough. If I had tagged it as Computer Science then it would be a level 2 problem, but since I tagged it as Algebra I did intend for it to be solved using algebra and not with a program. So while writing a program does "kill the purpose" of what I intended in posting the question, I'm just used to Brock coming up with programs that solve some of the problems I post and appreciate the fact that he can do that. It's been helpful on several of my probability problems where I wasn't 100% sure of my answer but he was able to confirm them via a simulation. That wasn't the case here, of course, but I don't mind seeing what he comes up with anyway. :)

Brian Charlesworth - 6 years ago
Arturo Presa
Jun 15, 2015

By using direct calculations we can obtain that a 9 a 10 13 ( m o d 100 ) a_{9} \equiv a_{10}\equiv 13 \pmod {100} . Then using mathematical induction we can prove that a n 13 ( m o d 100 ) a_{n}\equiv 13 \pmod {100} for all n 9 n \geq 9 . Indeed, it would be enough to prove that if a k a k + 1 13 a_{k}\equiv a_{k+1}\equiv 13 for k 9 k \geq 9 , then a k + 2 13 a_{k+2} \equiv 13 . This can be done by the recurrence relation: a k + 2 = ( k + 3 ) a k + 1 ( k + 2 ) a k a_{k+2}= (k+3)* a_{k+1}-(k+2)* a_{k} \equiv ( k + 3 ) 13 ( k + 2 ) 13 13 ( m o d 100 ) \equiv (k+3) *13-(k+2)*13 \equiv 13 \pmod{100} In the other hand we can also get by direct calculations that k = 1 8 a k 18 ( m o d 100 ) \sum_{k=1}^{8} a_{k}\equiv 18 \pmod {100} . Therefore k = 1 2015 a k 18 + ( 2015 8 ) 13 09 ( m o d 100 ) . \sum_{k=1}^{2015} a_{k}\equiv 18 +(2015-8)*13\equiv 09 \pmod{100}.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...