算法找到在一个数字序列的下一个数字? [英] Algorithm to find the next number in a sequence of numbers?
本文介绍了算法找到在一个数字序列的下一个数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个数字的顺序如下:
I have the following sequence of numbers:
2 5 6 20 18 80 54 320 162 1280
我只是没能找到下一个以下号码或算法来计算的话。
I'm just not able to find the next following number or the algorithm to calculate it.
任何提示?
推荐答案
下一个数字是 486
。
的序列是* 3,* 4
The sequence is *3, *4.
,每一个奇数指数乘以4:
Every odd index is multiplied by 4:
5 20 80 320 1280
每个偶数指数乘以3:
Every even index is multiplied by 3:
2 6 18 54 162
因此, 486
是一个数字。 : - )
Thus, 486
is the next number. :-)
这篇关于算法找到在一个数字序列的下一个数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文