login
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
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,2
COMMENTS
Restricted growth sequence transform of the sequence f(n) = 0 if mu(n) = -1, and f(n) = n for mu(n) >= 0.
For all i, j:
A305800(i) = A305800(j) => a(i) = a(j) => A305980(i) = A305980(j),
a(i) = a(j) => b(i) = b(j), where b is the pointwise sum of any two multiplicative sequences c and d that are Dirichlet inverses of each other. For example, b can be a sequence like A319340, A323885, or A347094.
LINKS
FORMULA
a(1) = 1, and for n > 1, if A008683(n) = -1, a(n) = 2, otherwise a(n) = 1 + n - A070549(n).
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; };
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)));
CROSSREFS
Cf. A008683, A070549, A030059 (positions of 2's).
Sequence in context: A329353 A305793 A300245 * A374479 A300231 A351030
KEYWORD
nonn
AUTHOR
Antti Karttunen, Aug 20 2021
STATUS
approved