OFFSET
1,1
COMMENTS
Compare the definition of a(n) to phi(n) = number of integers in {1, 2, ..., n} that are coprime to n.
LINKS
Sean A. Irvine, Table of n, a(n) for n = 1..1000
FORMULA
a(n) = Sum_{d|n} mu(d)*floor(2^n/d). - Ridouane Oudra, Mar 26 2025
EXAMPLE
There are six integers in {1, 2, ..., 2^3} that are coprime to 3, i.e. 1, 2, 4, 5, 7, 8. Hence a(3) = 6.
MAPLE
with(numtheory): seq(add(mobius(d)*floor(2^n/d), d in divisors(n)), n=1..60); # Ridouane Oudra, Mar 26 2025
MATHEMATICA
h[n_] := Module[{l}, l = {}; For[i = 1, i <= 2^n, i++, If[GCD[i, n] == 1, l = Append[l, i]]]; l]; Table[Length[h[i]], {i, 1, 15}]
CROSSREFS
KEYWORD
nonn
AUTHOR
Joseph L. Pe, Oct 04 2002
EXTENSIONS
a(16)-a(34) from Donovan Johnson, Nov 03 2011
STATUS
approved
