OFFSET
1,2
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
FORMULA
a(1) = 1, a(2) = 2, for n > 2, if n is an odd squarefree number (in A056911), a(n) = 3, otherwise a(n) = running count from 4 onward.
PROG
(PARI)
up_to = 65537;
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; };
A322810aux(n) = if((n>1)&&(n%2)&&issquarefree(n), 0, n);
v322810 = rgs_transform(vector(up_to, n, A322810aux(n)));
A322810(n) = v322810[n];
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Dec 27 2018
STATUS
approved