Fibonacci is Life

There are S S positive integers n n satisfying the following:

  • The digits of n n are composed of 1,3 and 4.

  • The sum of the digits of n n is 42.

Find S \sqrt {S} .


The answer is 17711.

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 solution

Ivan Koswara
Jan 10, 2016

Let a n a_n be the number of positive integers made up of digits 1 , 3 , 4 1, 3, 4 such that the sum of its digits is n n ; we're looking for a 42 a_{42} .

By simple case check, we can see that a 1 = 1 a_1 = 1 (1), a 2 = 1 a_2 = 1 (11), a 3 = 2 a_3 = 2 (111, 3), and a 4 = 4 a_4 = 4 (1111, 13, 31, 4). We also have a n = a n 1 + a n 3 + a n 4 a_n = a_{n-1} + a_{n-3} + a_{n-4} for n 5 n \ge 5 ; removing the last digit gives a positive integer made up of digits 1 , 3 , 4 1, 3, 4 with sum of its digits being one of n 1 , n 3 , n 4 n-1, n-3, n-4 depending on the digit that's removed. Then we can just plug it in to a spreadsheet program or something to find S = a 42 = 313679521 S = a_{42} = 313679521 , so S = 17711 \sqrt{S} = \boxed{17711} .

Moderator note:

Good approach in setting up the recurrence relation.

Recursion is indeed the way to go. In fact, 17711 17711 is the 21th Fibonacci number. By playing around with the recursion, can you find out how it relates to the Fibonacci sequence?

Xuming Liang - 5 years, 5 months ago

Could you please explain in simpler terms how you came about your recurrence relation.

Vladimir Smith - 5 years, 4 months ago

Log in to reply

Consider a number made up of 1, 3, 4, whose digit sum is at least 5. Since the digit sum is at least 5, the number has at least two digits. Now, delete the last digit; the rest is still a number made up of 1, 3, 4. The digit sum decreases by 1, in case the last digit was 1, or by 3, in case the last digit was 3, or by 4, in case the last digit was 4. In the first case, there are a n 1 a_{n-1} possible numbers; in the second, a n 3 a_{n-3} ; in the third, a n 4 a_{n-4} . All of them are distinct because the last digit removed is different, so you just add them up to get a n a_n .

Ivan Koswara - 5 years, 4 months ago

Log in to reply

Thanks for the explanation :)

Vladimir Smith - 5 years, 4 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...