OFFSET
1,6
COMMENTS
a(n) = 0 iff n is in A093696.
EXAMPLE
12 has 6 divisors: {1, 2, 3, 4, 6, 12} of which three {3, 6, 12} have an even number of 1's in their binary expansion with 11, 110 and 11100 respectively; hence a(12) = 3.
MAPLE
A356018 := proc(n)
local a, d ;
a := 0 ;
for d in numtheory[divisors](n) do
if isA001969(d) then
a := a+1 ;
end if;
end do:
a ;
end proc:
seq(A356018(n), n=1..200) ; # R. J. Mathar, Aug 07 2022
MATHEMATICA
a[n_] := DivisorSum[n, 1 &, EvenQ[DigitCount[#, 2, 1]] &]; Array[a, 100] (* Amiram Eldar, Jul 23 2022 *)
PROG
(Python)
from sympy import divisors
def c(n): return bin(n).count("1")&1 == 0
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
(PARI) a(n) = my(v = valuation(n, 2)); n>>=v; d=divisors(n); sum(i=1, #d, bitand(hammingweight(d[i]), 1) == 0) * (v+1) \\ David A. Corneth, Jul 23 2022
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Bernard Schott, Jul 23 2022
EXTENSIONS
More terms from David A. Corneth, Jul 23 2022
STATUS
approved