OFFSET
1,2
COMMENTS
a(n) <= 2^(n-1) with equality for n = 1, 2, 3, 4, 5, 7, 11, 13 up to a(44).
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..100
EXAMPLE
a(6) = 28 since 28 has 6 divisors {1, 2, 4, 7, 14, 28} that have all an odd number of 1's in their binary expansion: 1, 10, 100, 111, 1110 and 11100; also, no positive integer smaller than 28 has six divisors that are odious.
MATHEMATICA
f[n_] := DivisorSum[n, 1 &, OddQ[DigitCount[#, 2, 1]] &]; seq[len_, nmax_] := Module[{s = Table[0, {len}], c = 0, n = 1, i}, While[c < len && n < nmax, i = f[n]; If[i <= len && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; seq[20, 10^6] (* Amiram Eldar, Jul 21 2022 *)
PROG
(PARI) isod(n) = hammingweight(n) % 2; \\ A000069
a(n) = my(k=1); while (sumdiv(k, d, isod(d)) != n, k++); k; \\ Michel Marcus, Jul 22 2022
(Python)
from sympy import divisors
from itertools import count, islice
def c(n): return bin(n).count("1")&1
def f(n): return sum(1 for d in divisors(n, generator=True) if c(d))
def agen():
n, adict = 1, dict()
for k in count(1):
fk = f(k)
if fk not in adict: adict[fk] = k
while n in adict: yield adict[n]; n += 1
print(list(islice(agen(), 36))) # Michael S. Branicky, Jul 25 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Jul 21 2022
EXTENSIONS
More terms from Amiram Eldar, Jul 21 2022
STATUS
approved