login
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.
4
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,2
COMMENTS
For all i, j:
A305801(i) = A305801(j) => a(i) = a(j),
a(i) = a(j) => A305980(i) = A305980(j),
a(i) = a(j) => A322808(i) = A322808(j).
LINKS
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
Cf. A056911 (after the initial 1, gives the positions of 3's in this sequence).
Sequence in context: A331174 A355836 A328470 * A322024 A326203 A355835
KEYWORD
nonn
AUTHOR
Antti Karttunen, Dec 27 2018
STATUS
approved