A322810 Lexicographically earliest such sequence a that a(i) = a(j) => f(i) = f(j) for all i, j, where f(n) = 0 if n is an odd squarefree number > 1, and f(n) = n for all other numbers.
1, 2, 3, 4, 3, 5, 3, 6, 7, 8, 3, 9, 3, 10, 3, 11, 3, 12, 3, 13, 3, 14, 3, 15, 16, 17, 18, 19, 3, 20, 3, 21, 3, 22, 3, 23, 3, 24, 3, 25, 3, 26, 3, 27, 28, 29, 3, 30, 31, 32, 3, 33, 3, 34, 3, 35, 3, 36, 3, 37, 3, 38, 39, 40, 3, 41, 3, 42, 3, 43, 3, 44, 3, 45, 46, 47, 3, 48, 3, 49, 50, 51, 3, 52, 3, 53, 3, 54, 3, 55, 3, 56, 3, 57, 3, 58, 3, 59, 60, 61, 3, 62, 3, 63, 3
Offset: 1
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
Crossrefs
Programs
-
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];
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.
Comments