A346488 Lexicographically earliest infinite sequence such that a(i) = a(j) => f(i) = f(j), for all i, j >= 1, where f(n) = 0 if mu(n) = -1, and f(n) = n for all other numbers (with mu = Möbius mu, A008683).
1, 2, 2, 3, 2, 4, 2, 5, 6, 7, 2, 8, 2, 9, 10, 11, 2, 12, 2, 13, 14, 15, 2, 16, 17, 18, 19, 20, 2, 2, 2, 21, 22, 23, 24, 25, 2, 26, 27, 28, 2, 2, 2, 29, 30, 31, 2, 32, 33, 34, 35, 36, 2, 37, 38, 39, 40, 41, 2, 42, 2, 43, 44, 45, 46, 2, 2, 47, 48, 2, 2, 49, 2, 50, 51, 52, 53, 2, 2, 54, 55, 56, 2, 57, 58, 59, 60, 61, 2, 62, 63, 64, 65, 66, 67, 68, 2, 69, 70, 71
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; }; Aux346488(n) = if(moebius(n)<0,0,n); v346488 = rgs_transform(vector(up_to, n, Aux346488(n))); A346488(n) = v346488[n];
-
PARI
A070549(n) = sum(k=1,n,(-1==moebius(k))); A346488(n) = if(1==n,1,if(-1==moebius(n),2,1+n-A070549(n)));
Comments