OFFSET
1,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = 2*A000010(n) - A010051(n)*A048881(n-1), for n > 1. - Reinhard Zumkeller, Feb 04 2015, edited by M. F. Hasler, Mar 10 2018
For many values of n, the inverse Möbius transform of this sequence (g.f.: Sum a(n)*x^n/(1-x^n)) equals A005187, but this is not the case for composite n such that A297115(n) <> 0. The equality does hold for A297111 instead. - Antti Karttunen & M. F. Hasler, Mar 10 2018
MATHEMATICA
Insert[Table[If[PrimeQ[n], 2*EulerPhi[n] - DigitCount[n, 2][[1]] + 1, 2*EulerPhi[n]], {n, 2, 100}], 1, 1] (* Stefan Steinerberger, Apr 11 2006 *)
PROG
(Haskell)
a035532 1 = 1
a035532 n = if a010051' n == 0 then phi2 else phi2 - a000120 n + 1
where phi2 = 2 * a000010 n
-- Reinhard Zumkeller, Feb 04 2015
(PARI) A035532(n)=2*eulerphi(n)-if(isprime(n), hammingweight(n)-1, n==1) \\ M. F. Hasler, Mar 10 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
EXTENSIONS
More terms from James A. Sellers
Definition amended for a(1) = 1 by M. F. Hasler, Mar 10 2018
STATUS
approved