The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A358180 Indices for A358168. 4

%I #24 Nov 06 2022 01:40:29

%S 1,30,162,1150,11603,104511,1041245,10226995,101514698,1008495923,

%T 10060201866

%N Indices for A358168.

%C a(6)-a(7) from Chuck Gaydos.

%t nn = 2^20; q[_] = False; q[0] = True; a[_] = 0; c[_] = -1; c[0] = 2; m = 1; {1}~Join~Reap[Do[j = c[m]; a[n] = m; c[m] = n; m = 0; If[j > 0, m = n - j]; If[! q[#2], Sow[n]; q[#2] = True] & @@ {a[n], IntegerLength[a[n]]}, {n, 3, nn}] ][[-1, -1]] (* _Michael De Vlieger_, Nov 05 2022 *)

%o (Python)

%o from itertools import count

%o def A358180(n):

%o b, bdict, k = 0, {0:(1,)},10**(n-1) if n > 1 else 0

%o for m in count(2):

%o if b >= k:

%o return m-1

%o if len(l := bdict[b]) > 1:

%o b = m-1-l[-2]

%o if b in bdict:

%o bdict[b] = (bdict[b][-1],m)

%o else:

%o bdict[b] = (m,)

%o else:

%o b = 0

%o bdict[0] = (bdict[0][-1],m) # _Chai Wah Wu_, Nov 05 2022

%Y Cf. A181391, A358168.

%K nonn,hard,more

%O 1,2

%A _G. L. Honaker, Jr._, Nov 02 2022

%E a(8) from _Michael De Vlieger_, Nov 05 2022

%E a(9)-a(10) from _Chai Wah Wu_, Nov 05 2022

%E a(11) from _Martin Ehrenstein_, Nov 05 2022

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 17 03:33 EDT 2024. Contains 372577 sequences. (Running on oeis4.)