login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A166586
Totally multiplicative sequence with a(p) = p - 2 for prime p.
21
1, 0, 1, 0, 3, 0, 5, 0, 1, 0, 9, 0, 11, 0, 3, 0, 15, 0, 17, 0, 5, 0, 21, 0, 9, 0, 1, 0, 27, 0, 29, 0, 9, 0, 15, 0, 35, 0, 11, 0, 39, 0, 41, 0, 3, 0, 45, 0, 25, 0, 15, 0, 51, 0, 27, 0, 17, 0, 57, 0, 59, 0, 5, 0, 33, 0, 65, 0, 21, 0, 69, 0, 71, 0, 9, 0
OFFSET
1,5
LINKS
FORMULA
Multiplicative with a(p^e) = (p-2)^e. If n = Product p(k)^e(k) then a(n) = Product (p(k) - 2)^e(k). a(2k) = 0 for k >= 1.
a(A000244(n)) = 1. - Michel Marcus, Dec 13 2014
Dirichlet g.f.: 1 / Product_{p prime} (1 - p^(1 - s) + 2*p^(-s)). The Dirichlet inverse is multiplicative with b(p) = 2 - p, b(p^e) = 0, for e > 1. - Álvar Ibeas, Nov 24 2017 [corrected by Vaclav Kotesovec, Feb 10 2023]
Sum_{k=1..n} a(k) ~ c * n^2/2, where c = Product_{primes} (1 - 1/(1 + p*(p-1)/2)) = 0.3049173579282080265466051390930446635010608835584906520231313997... - Vaclav Kotesovec, Feb 10 2023
MAPLE
f:= proc(n) local t;
mul((t[1]-2)^t[2], t=ifactors(n)[2])
end proc:
map(f, [$1..100]); # Robert Israel, Jun 07 2016
MATHEMATICA
a[1] = 1; a[n_] := (fi = FactorInteger[n]; Times @@ ((fi[[All, 1]] - 2)^fi[[All, 2]])); Table[a[n], {n, 1, 50}] (* G. C. Greubel, Jun 06 2016 *)
PROG
(PARI) a(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] -= 2); factorback(f); \\ Michel Marcus, Dec 13 2014
(PARI) for(n=1, 100, print1(direuler(p=2, n, 1/(1-p*X+2*X))[n], ", ")) \\ Vaclav Kotesovec, Feb 10 2023
CROSSREFS
Cf. A000244 (powers of 3).
Sequence in context: A234020 A348259 A276833 * A122274 A373023 A340525
KEYWORD
nonn,mult
AUTHOR
Jaroslav Krizek, Oct 17 2009
EXTENSIONS
More terms from Alonso del Arte, Dec 10 2014
a(69) and a(75) corrected by G. C. Greubel, Jun 06 2016
Erroneous formula and program removed by G. C. Greubel, Jun 06 2016
STATUS
approved