|
|
A350244
|
|
Indices of record values in A350228.
|
|
2
|
|
|
1, 4, 7, 12, 15, 22, 25, 32, 39, 60, 64, 93, 168, 260, 281, 517, 598, 1159, 2130, 2749, 3176, 6574, 8316, 16774, 19108, 35458, 36511, 37725, 64152, 86071, 91779, 107372, 291795, 329655, 366353, 394200, 489852, 549052, 639575, 827496, 919159, 1182877, 1223942, 1358297, 2391563
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
LINKS
|
|
|
EXAMPLE
|
Example A350228(4)=2. The sequence up to this point is {1,0,1}; as 2 is greater than any term of A350228 thus far, 4 becomes the next term.
|
|
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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|