OFFSET
1,2
LINKS
Peter J. C. Moses, Table of n, a(n) for n = 1..10000
FORMULA
a(2^n) = n+1. - Bernard Schott, Jul 22 2022
a(n) = 1 iff n is in A093688. - Bernard Schott, Jul 23 2022
MAPLE
A227872 := proc(n)
option remember ;
local a, d ;
a := 0 ;
for d in numtheory[divisors](n) do
if not isA001969(d) then
a := a+1 ;
end if;
end do:
a ;
end proc:
seq(A227872(n), n=1..200) ; # R. J. Mathar, Aug 07 2022
MATHEMATICA
a[n_] := DivisorSum[n, 1 &, OddQ[DigitCount[#, 2, 1]] &]; Array[a, 100] (* Amiram Eldar, Jul 23 2022 *)
PROG
(PARI) a(n) = sumdiv(n, d, hammingweight(d) % 2); \\ Michel Marcus, Feb 06 2016
(PARI) isod(n) = hammingweight(n) % 2; \\ A000069
a(n) = my(v=valuation(n, 2)); n >>= v; sumdiv(n, d, isod(d)) * (v+1) \\ David A. Corneth, Jul 23 2022
(Python)
from sympy import divisors
def c(n): return bin(n).count("1")&1
def a(n): return sum(1 for d in divisors(n, generator=True) if c(d))
print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Jul 23 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Vladimir Shevelev, Oct 25 2013
EXTENSIONS
More terms from Peter J. C. Moses, Oct 25 2013
STATUS
approved