OFFSET
1,3
COMMENTS
Restricted growth sequence transform of A286559.
LINKS
PROG
(PARI)
up_to = 65537;
first_n_of_A005185(n) = { my(v=vector(n)); v[1]=v[2]=1; for(k=3, n, v[k]=v[k-v[k-1]]+v[k-v[k-2]]); (v); };
v005185 = first_n_of_A005185(up_to);
A005185(n) = v005185[n];
rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om, invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om, invec[i], i); outvec[i] = u; u++ )); outvec; };
write_to_bfile(start_offset, vec, bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
write_to_bfile(1, rgs_transform(vector(up_to, n, Aux302779(n))), "b302779.txt");
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 27 2018
STATUS
approved