OFFSET
1,4
COMMENTS
A type of multiplicative Van Eck sequence.
MATHEMATICA
f[1]=1; f[n_]:=0; f2[n_]:=0; a[n_]:=Block[{q=f2[x]}, If[q!=0, s[n]=((n-1-q)*(x))+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, 100000}]; data=Table[s[n], {n, 1, 100000}]
PROG
(PARI) findm(list, n) = {forstep (m=n-1, 1, -1, if (list[m] == list[n], return(m))); return(0); }
lista(nn) = {my(list = List([1, 0])); for (n=3, nn, my(m=findm(list, n-1)); if (m, listput(list, (n-m)*list[n-1]), listput(list, 1)); ); Vec(list); } \\ Michel Marcus, Jan 17 2022
(Python)
from itertools import count, islice
def A350562_gen(): # generator of terms
bdict = {1:1}
yield 1
b = 0
for n in count(3):
yield b
c = (n-bdict[b])*b if b in bdict else 1
bdict[b], b = n-1, c
CROSSREFS
KEYWORD
nonn
AUTHOR
Jasmine Miller, Jan 05 2022
STATUS
approved