OFFSET
1,3
COMMENTS
Restricted growth sequence transform of A286560: a filter sequence which includes both the summands of A004001 and the summands of A005185.
For all i, j: a(i) = a(j) => b(i) = b(j), where b is a sequence like A087740, A284019, A286569 or A302779.
For n > 1000 the duplicates get rare. In range [1000, 65536] there are only three cases: a(1353) = a(1354) = 1319, a(39361) = a(39362) = 39326, and a(46695) = a(46696) = 46659.
LINKS
PROG
(PARI)
up_to = 65537;
first_n_of_A004001(n) = { my(v=vector(n)); v[1]=v[2]=1; for(k=3, n, v[k]=v[v[k-1]]+v[k-v[k-1]]); (v); }; \\ Charles R Greathouse IV, Feb 26 2017
v004001 = first_n_of_A004001(up_to);
A004001(n) = v004001[n];
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];
Aux302780(n) = if(n<3, 0, [A004001(A004001(n-1)), A004001(n-A004001(n-1)), A005185(n-A005185(n-1)), A005185(n-A005185(n-2))]);
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, Aux302780(n))), "b302780.txt");
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Apr 27 2018
STATUS
approved