外观常数(Look-and-say sequence),是指以下特点的整数序列:
外观数列的求解
外观序列(Look-and-say sequence)的python语言求解:
def look_and_say(member):
while True:
yield member
breakpoints = ([0] + [i for i in range(1, len(member))
if member[i - 1] != member[i]]
+ [len(member)])
groups = [member[breakpoints[i - 1]:breakpoints[i]]
for i in range(1, len(breakpoints))]
member = ''.join(str(len(group)) + group[0] for group in groups)
for i in range(31):
seq = sequence.next()
print i, seq[:8], len(seq)
性质
外观序列有许多有意思的性质,比如序列中的第n项L[n]随着n越来越长,但是除数字1,2,3,其他数字永远不会出现。另一个有意思的性质是由英国数学家Conway于1987年发现的。即相邻两数的
比值L[n]/L[n-1],随着n的增大越来越接近一个固定的数。当n趋于无穷大时,相邻两数的
比值为一个常数。Conway将这个数记为希腊字母λ(lim_{n->∞} L[n]/L[n-1] = λ),λ ≈1.303577。并且该数还是下面这个71次方程的实数解。
x^71 - x^69 - 2*x^68 - x^67 + 2*x^66 + 2*x^65 + x^64 - x^63 - x^62 -x^61 - x^60 - x^59 + 2*x^58 + 5*x^57 + 3*x^56 - 2*x^55 - 10*x^54 -3*x^53 - 2*x^52 + 6*x^51 + 6*x^50 + x^49 + 9*x^48 - 3*x^47 -7*x^46 - 8*x^45 - 8*x^44 + 10*x^43 + 6*x^42 + 8*x^41 - 5*x^40 -12*x^39 + 7*x^38 - 7*x^37 + 7*x^36 + x^35 - 3*x^34 + 10*x^33 +x^32 - 6*x^31 - 2*x^30 - 10*x^29 - 3*x^28 + 2*x^27 + 9*x^26 -3*x^25 + 14*x^24 - 8*x^23 - 7*x^21 + 9*x^20 + 3*x^19 - 4*x^18 -10*x^17 - 7*x^16 + 12*x^15 + 7*x^14 + 2*x^13 - 12*x^12 - 4*x^11 -2*x^10 + 5*x^9 + x^7 - 7*x^6 + 7*x^5 - 4*x^4 + 12*x^3 - 6*x^2 +3*x - 6= 0