login
A360981
a(n) is the least positive multiple of n that is an evil number (A001969).
2
3, 6, 3, 12, 5, 6, 63, 24, 9, 10, 33, 12, 39, 126, 15, 48, 17, 18, 57, 20, 63, 66, 23, 24, 75, 78, 27, 252, 29, 30, 1023, 96, 33, 34, 105, 36, 111, 114, 39, 40, 123, 126, 43, 132, 45, 46, 141, 48, 147, 150, 51, 156, 53, 54, 165, 504, 57, 58, 177, 60, 183, 2046
OFFSET
1,1
COMMENTS
This sequence is well defined: for any n > 0, A020330(n) is both a multiple of n and an evil number.
LINKS
FORMULA
a(n) = A180938(n) * n.
a(n) = n iff n belongs to A001969.
MAPLE
f:= proc(n) local k;
for k from n by n do
if convert(convert(k, base, 2), `+`)::even then return k fi
od
end proc:
map(f, [$1..100]); # Robert Israel, Mar 29 2023
MATHEMATICA
a[n_] := Module[{k = n}, While[OddQ[DigitCount[k, 2, 1]], k +=n]; k]; Array[a, 100] (* Amiram Eldar, Aug 07 2023 *)
PROG
(PARI) a(n) = { forstep (m=n, oo, n, if (hammingweight(m)%2==0, return (m))) }
(Python)
def A360981(n):
k = n
while k.bit_count()&1:
k += n
return k # Chai Wah Wu, Feb 28 2023
CROSSREFS
Cf. A001969, A020330, A180938, A360980 (variant for odious numbers).
Sequence in context: A210201 A275535 A160899 * A336769 A337035 A203491
KEYWORD
nonn,base,look
AUTHOR
Rémy Sigrist, Feb 27 2023
STATUS
approved