login
A293892
Restricted growth sequence transform of A083722.
4
1, 1, 1, 2, 1, 3, 1, 4, 5, 6, 1, 7, 1, 8, 9, 10, 1, 11, 1, 12, 13, 14, 1, 15, 16, 17, 15, 18, 1, 19, 1, 20, 21, 22, 23, 24, 1, 25, 26, 27, 1, 28, 1, 29, 30, 31, 1, 32, 33, 34, 35, 36, 1, 37, 38, 39, 40, 41, 1, 42, 1, 43, 44, 45, 46, 47, 1, 48, 49, 50, 1, 51, 1, 52, 53, 54, 55, 56, 1, 57, 58, 59, 1, 60, 61, 62, 63, 64, 1, 65, 66, 67, 68, 69, 70, 71, 1, 72, 73
OFFSET
1,4
COMMENTS
a(n) = 1 iff n is prime or n is 1.
LINKS
PROG
(PARI)
allocatemem(2^30);
up_to = 65536;
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])); }
A083722(n) = { if(n==1, return (1)); my(gpf = vecmax(factor(n)[, 1])); my(pp = 1); forprime(p=gpf+1, n, pp *= p; ); pp; } \\ This function from Michel Marcus, Jun 26 2016
write_to_bfile(1, rgs_transform(vector(up_to, n, A083722(n))), "b293892.txt");
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Nov 02 2017
STATUS
approved