OFFSET
1,2
COMMENTS
Also the number of subsets A of {1, 2, 3, ..., n} such that gcd(A) divides n.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..3321
P. Pongsriiam, Relatively Prime Sets, Divisor Sums, and Partial Sums, arXiv:1306.4891 and J. Int. Seq. 16 (2013) #13.9.1.
P. Pongsriiam, A remark on relative prime sets, Integers 13 (2013), A49.
FORMULA
a(n) = sum{d | n} sum_{k <= d} mu(k)*(2^floor(n/k) - 1) where mu is the Moebius function.
PROG
(PARI) A085945(n)=sum(k=1, n, moebius(k)*(2^(n\k)-1))
a(n)=sumdiv(n, d, A085945(d)) \\ Charles R Greathouse IV, Sep 19 2013
(PARI) a(n)=my(v=vector(n, i, i)); sum(i=1, 2^n-1, n%gcd(vecextract(v, i))==0) \\ Charles R Greathouse IV, Sep 19 2013
CROSSREFS
KEYWORD
nonn
AUTHOR
Prapanpong Pongsriiam, Sep 18 2013
EXTENSIONS
a(19)-a(34) from Charles R Greathouse IV, Sep 19 2013
STATUS
approved