OFFSET
1,2
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..73
EXAMPLE
MATHEMATICA
f[1]=1; , f[n_]:=0; , f2[n_]:=0; , f[0]=2; , a[n_]:=(If[n==f[x]+1, q=f2[x], q=f[x]]; , If[q!=0, s[n]=(n-1-q)*(x), s[n]=1]); , s[1]=1; , s[2]=0; , x=0; , Do[x=a[n]; , f2[x]=f[x]; , f[x]=n, {n, 3, 2000000}]; i=0; maxp[k_]:=Reap[Do[Block[{x=s[n]}, If[x>i, Sow[n]; i=x]], {n, 1, k}]][[2, 1]]; maxp[2000000]
PROG
(Python)
from itertools import islice, count
def A350244gen():
yield 1
k, b, bdict = 1, 0, {1:(1, ), 0:(2, )}
for n in count(3):
if len(l := bdict[b]) > 1:
m = (n-1-l[-2])*b
if m in bdict:
bdict[m] = (bdict[m][-1], n)
else:
bdict[m] = (n, )
b = m
else:
bdict[1] = (bdict[1][-1], n)
b = 1
if b > k:
k = b
yield n
A350244_list = list(islice(A350244gen(), 20)) # Chai Wah Wu, Dec 22 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Jasmine Miller, Dec 21 2021
STATUS
approved