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