login
A summarize Fibonacci sequence: summarize the previous two terms!.
0

%I #7 Feb 02 2021 15:48:32

%S 2,2,22,32,1332,332211,433231,14533231,1524632231,162524534241,

%T 263544336241,363564435231,463554733221,17364544733221,37263554634231,

%U 37363554734231,37364544933221,1937263554933221,3927263544835231,391827264534836231,293827363544836231

%N A summarize Fibonacci sequence: summarize the previous two terms!.

%C From the 26th term the sequence gets into a cycle of 46.

%o (Python)

%o def aupton(nn):

%o alst = [2, 2]

%o for n in range(2, nn+1):

%o prev2, anstr = sorted(str(alst[-2]) + str(alst[-1])), ""

%o for d in sorted(set(prev2), reverse=True):

%o anstr += str(prev2.count(d)) + d

%o alst.append(int(anstr))

%o return alst

%o print(aupton(20)) # _Michael S. Branicky_, Feb 02 2021

%Y Cf. A036059, A007890.

%K base,easy,nonn

%O 0,1

%A _Floor van Lamoen_