xialigang的个人博客分享 http://blog.sciencenet.cn/u/xialigang

博文

A primary-school (Fibonacci-type) problem

已有 2358 次阅读 2020-9-4 17:34 |个人分类:FUN MATH|系统分类:科研笔记

fibonacci.jpg


 I knew this problem in a WeChat group chat. It is said to be a problem for primary-school students. Here is the problem.


How many integers with all digits being just 1,2 or 3 and the sum of all digits being 10? For example, 12331 and 22222.


We could ask a more general question.


How many integers with all digits being just 1,2 or 3 and the sum of all digits being n?


Let a(n) denote the number of such integers. It is easy to see that a(1) = 1, a(2) = 2 and a(3)= 4.


Most importaintly, we have the following recursion relation.


a(n) = a(n-1) + a(n-2) + a(n-3).


We can understand the recursiion in the following way. Supposing the first digit is 1 (or 2 or 3), then rest number of integers  must be a(n-1) (or a(n-2) or a(n-3)). Obviously a(n) is the sum of the thress cases.


It is certinaly a Fibonacci-type problem. It is very difficult to solve it because we'll have to find the solutions of a third-order equation. Anyway, I make it.







https://blog.sciencenet.cn/blog-3401446-1249291.html

上一篇:金星,御夫座,双子座,猎户座,白羊座和金牛座
下一篇:A representations of Euler\'s constant (欧拉常数)
收藏 IP: 183.93.172.*| 热度|

0

该博文允许注册用户评论 请点击登录 评论 (0 个评论)

数据加载中...

Archiver|手机版|科学网 ( 京ICP备07017567号-12 )

GMT+8, 2024-11-23 03:07

Powered by ScienceNet.cn

Copyright © 2007- 中国科学报社

返回顶部