OFFSET
1,2
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
For n=2, A278221(2) = 2, which has not been encountered before, thus we allot for a(2) the least so far unused number, which is 2, thus a(2) = 2.
For n=3, A278221(3) = 4, which has not been encountered before, thus we allot for a(3) the least so far unused number, which is 3, thus a(3) = 3.
For n=9, A278221(9) = 4, which was already encountered at n=3, thus a(9) = 3.
For n=13, A278221(13) = 64, which has not been encountered before, thus we allot for a(13) the least so far unused number, which is 9, thus a(13) = 9.
For n=194, A278221(194) = 50331648, which has not been encountered before, thus we allot for a(194) the least so far unused number, which is 106, thus a(194) = 106.
For n=388, A278221(388) = 50331648, which was already encountered at n=194, thus a(388) = a(194) = 106.
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])); }
A064989(n) = {my(f); f = factor(n); if((n>1 && f[1, 1]==2), f[1, 2] = 0); for (i=1, #f~, f[i, 1] = precprime(f[i, 1]-1)); factorback(f)};
A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); }; \\ This function from Charles R Greathouse IV, Aug 17 2011
write_to_bfile(1, rgs_transform(vector(10000, n, A278221(n))), "b286621.txt");
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 11 2017
STATUS
approved