login
A322988
Lexicographically earliest such sequence a that a(i) = a(j) => f(i) = f(j) for all i, j, where f(1) = 0 if n is a prime power > 2, f(2) = -1, and f(n) = A322990(n) for all other numbers.
4
1, 2, 3, 3, 3, 4, 3, 3, 3, 5, 3, 6, 3, 7, 8, 3, 3, 9, 3, 10, 11, 12, 3, 13, 3, 14, 3, 15, 3, 6, 3, 3, 16, 17, 18, 19, 3, 20, 21, 22, 3, 8, 3, 23, 24, 25, 3, 26, 3, 27, 28, 29, 3, 30, 31, 32, 33, 34, 3, 35, 3, 36, 37, 3, 38, 11, 3, 39, 40, 10, 3, 41, 3, 42, 43, 44, 45, 13, 3, 46, 3, 47, 3, 48, 49, 50, 51, 52, 3, 15, 53, 54, 55, 56, 57, 58, 3, 59, 60, 61, 3, 16, 3
OFFSET
1,2
COMMENTS
For all i, j: a(i) = a(j) => A322989(i) = A322989(j).
For all i, j > 2: A305976(i) = A305976(j) => a(i) = a(j).
LINKS
PROG
(PARI)
up_to = 8192;
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; };
A289271(n) = { my(v=0, i=0, x=1); for(d=2, oo, if(n==1, return(v)); if(1==gcd(x, d)&&1==omega(d), if(!(n%d)&&1==gcd(d, n/d), v += 2^i; n /= d; x *= d); i++)); }; \\ After Rémy Sigrist's program for A289271.
A289272(n) = { my(m=1, pp=1); while(n>0, pp++; while(!isprimepower(pp)||(gcd(pp, m)>1), pp++); if(n%2, m *= pp); n >>=1); (m); }; \\ Antti Karttunen, Jan 02 2019
A322990(n) = A289272(A289271(n)>>1);
A322988aux(n) = if(2==n, -1, if(isprimepower(n), 0, A322990(n)));
v322988 = rgs_transform(vector(up_to, n, A322988aux(n)));
A322988(n) = v322988[n];
CROSSREFS
Cf. A322805, A322822 for analogous constructions for filter sequences.
Sequence in context: A256858 A049837 A326202 * A098201 A341883 A175239
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jan 02 2019
STATUS
approved