login
A286547
Restricted growth sequence of A286546 (A006068(n) - n).
3
1, 1, 2, 3, 4, 2, 5, 5, 6, 7, 8, 8, 9, 9, 10, 11, 12, 13, 14, 14, 15, 15, 7, 4, 16, 16, 17, 18, 11, 17, 19, 19, 20, 21, 22, 22, 23, 23, 24, 25, 26, 26, 27, 6, 28, 27, 29, 29, 30, 30, 31, 32, 33, 31, 34, 34, 18, 35, 36, 36, 37, 37, 38, 39, 40, 41, 42, 42, 43, 43, 44, 45, 46, 46, 47, 48, 49, 47, 50, 50, 51, 51, 52, 12, 25, 52, 53, 53, 54, 24, 55, 55, 56, 56, 13
OFFSET
0,3
LINKS
PROG
(PARI)
rgs_transform(invec) = { my(occurrences = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(occurrences, invec[i]), my(pp = mapget(occurrences, invec[i])); outvec[i] = outvec[pp] , mapput(occurrences, 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])); }
A006068(n)= { my(s=1, ns); while(1, ns = n >> s; if(0==ns, break()); n = bitxor(n, ns); s <<= 1; ); return (n); } \\ Essentially Joerg Arndt's Jul 19 2012 code.
A286546(n) = (A006068(n)-n);
write_to_bfile(0, rgs_transform(vector(16384, n, A286546(n-1))), "b286547.txt");
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 18 2017
STATUS
approved