A063850 Say what you see in previous term, reporting total number for each digit encountered.
1, 11, 21, 1211, 3112, 132112, 311322, 232122, 421311, 14123113, 41141223, 24312213, 32142321, 23322114, 32232114, 23322114, 32232114, 23322114, 32232114, 23322114, 32232114, 23322114, 32232114, 23322114, 32232114
Offset: 0
Examples
To get the term after 311322, we say: two 3's, two 1's, two 2's, so 232122.
Programs
-
Mathematica
deldup[ lst_ ] := Module[ {i, s}, s={}; For[ i=1, i<=Length[ lst ], i++, If[ !MemberQ[ s, lst[ [ i ] ] ], AppendTo[ s, lst[ [ i ] ] ] ] ]; s ]; next[ term_ ] := FromDigits[ Flatten[ ({Count[ IntegerDigits[ term ], # ], #}&)/@deldup[ IntegerDigits[ term ] ] ] ]
-
Python
from collections import Counter; s = '1' for _ in range(25): print(s, end = ', '); d = Counter(s); s = '' for k, v in d.items(): s += str(v) + k # Ya-Ping Lu, Jun 06 2025
Formula
After a while sequence has period 2.
Extensions
Corrected and extended by Dean Hickerson, Aug 27 2001
Comments