OFFSET
1,1
COMMENTS
The 1's in the binary expansion of 2^n - a(n) correspond to k such that 1 < gcd(k,n) < k < n. - Robert Israel, Jul 21 2014
MAPLE
f:= proc(k, n) local g; g:= igcd(k, n); g = 1 or g = k end proc:
A:= n -> 1 + add(2^(k-1), k=select(f, [$1..n], n));
seq(A(n), n=1..100); # Robert Israel, Jul 21 2014
PROG
(PARI) sum(k=1, n, if (gcd(k, n)==1, 2^(k-1), 0)) + sumdiv(n, k, k*2^(k-1));
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Marcus, Jul 21 2014
STATUS
approved