login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A286450
Restricted growth sequence computed for A252750.
3
1, 1, 2, 3, 4, 5, 6, 3, 2, 7, 8, 1, 9, 10, 11, 12, 7, 13, 14, 5, 15, 16, 17, 14, 18, 19, 20, 21, 22, 23, 24, 12, 25, 1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 1, 5, 56, 31, 57, 58, 59, 7, 60, 61, 62, 17, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81
OFFSET
1,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])); }
A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ This function from Michel Marcus
A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ Modified from code of M. F. Hasler
A252750(n) = (A003961(A005940(n+1)) - (2 * A005940(n+1)));
write_to_bfile(1, rgs_transform(vector(10000, n, A252750(n))), "b286450.txt");
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 13 2017
STATUS
approved