OFFSET
1,3
COMMENTS
All terms are odd since if 2*j and 2*j*n are both odious, then so are j and j*n. - Michael S. Branicky, Feb 21 2022
EXAMPLE
For n = 5, we have 5*7 = 35, and both 7 and 35 are odious, and no smaller odious multiple of 5 works.
MATHEMATICA
odiousQ[n_] := OddQ[DigitCount[n, 2, 1]]; a[n_] := Module[{k = 1}, While[!odiousQ[k] || !odiousQ[k*n], k++]; k]; Array[a, 100] (* Amiram Eldar, Feb 21 2022 *)
PROG
(Python)
def od(n): return bin(n).count("1")%2 == 1
def a(n):
k = 1
while not (od(k) and od(k*n)): k += 1
return k
print([a(n) for n in range(1, 81)]) # Michael S. Branicky, Feb 21 2022
(PARI) isodious(m) = hammingweight(m) % 2;
a(n) = my(k=1); while (!isodious(k) || !isodious(k*n), k++); k; \\ Michel Marcus, Feb 22 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jeffrey Shallit, Feb 21 2022
STATUS
approved