A216557 Number of iterations of A216556 until the initial value n appears as a substring of the iterate; 0 if this will never happen.
10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 19, 28, 37, 46, 55, 64, 73, 82, 90, 0, 9, 19, 28, 37, 46, 55, 64, 73, 82, 0, 89, 9, 19, 28, 37, 46, 55, 64, 73, 0, 79, 89, 9, 19, 28, 37, 46, 55, 64, 0, 69, 79, 89, 9, 19, 28, 37, 46, 55, 0, 59, 69, 79, 89, 9, 19, 28, 37, 46, 0, 49, 59, 69, 79, 89, 9, 19, 28, 37, 0, 39, 49, 59, 69, 79, 89, 9, 19, 28, 0, 29, 39, 49, 59, 69, 79
Offset: 0
Examples
a(211) = 9 since under the action of A216556, 211 -> 322 -> 433 -> 544 -> 655 -> 766 -> 877 -> 988 -> 1099 -> 211010, which contains the substring 211. a(111) = 0 since if some number has "111" as its substring, then its preimage for A216556 (cf. A216587) contains at least the substring "00" (e.g., A216587(21110) = 1009), and has in turn no preimage under A216556. Therefore 111 cannot occur as a substring in the orbit of any number under A216556.
Links
- Lars Blomberg, Table of n, a(n) for n = 0..10000
- Eric Angelini, Strings resurrection, SeqFan mailing list, Sep 08 2012
Crossrefs
See A216603 for the list of n such that a(n) = 0. - M. F. Hasler, Sep 09 2012
Programs
-
PARI
A216557(n, L=9e9, f)={my(s=Mod(n,10^#Str(n)), t=n); n && until(20>t\=10, t%1000%111||return; t%10 || t%100==10 || return); for(i=1,L, t=n=A216556(n); until(!t\=10, s==t && return(i))); f} \\ 3rd (optional) argument f allows to specify a return value (e.g., f=[] or -1) in case no result is found within the limit of L iterations. If the zero result is deduced from the initial value (cf. FORMULA) the function returns an empty result (which also evaluates to 0). [PARI syntax updated Jan 02 2020]
Formula
a(n)=0 for all numbers having "20", "30", ..., "90" or "00" or "111", "222", ... "999" as a substring.
Extensions
Corrected typo in a(69): 4 -> 46 by Lars Blomberg, Jan 01 2020
Comments