login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) is the least positive multiple of n that is an evil number (A001969).
2

%I #19 Aug 07 2023 02:11:54

%S 3,6,3,12,5,6,63,24,9,10,33,12,39,126,15,48,17,18,57,20,63,66,23,24,

%T 75,78,27,252,29,30,1023,96,33,34,105,36,111,114,39,40,123,126,43,132,

%U 45,46,141,48,147,150,51,156,53,54,165,504,57,58,177,60,183,2046

%N a(n) is the least positive multiple of n that is an evil number (A001969).

%C This sequence is well defined: for any n > 0, A020330(n) is both a multiple of n and an evil number.

%H Robert Israel, <a href="/A360981/b360981.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A180938(n) * n.

%F a(n) = n iff n belongs to A001969.

%p f:= proc(n) local k;

%p for k from n by n do

%p if convert(convert(k,base,2),`+`)::even then return k fi

%p od

%p end proc:

%p map(f, [$1..100]); # _Robert Israel_, Mar 29 2023

%t a[n_] := Module[{k = n}, While[OddQ[DigitCount[k, 2, 1]], k +=n]; k]; Array[a, 100] (* _Amiram Eldar_, Aug 07 2023 *)

%o (PARI) a(n) = { forstep (m=n, oo, n, if (hammingweight(m)%2==0, return (m))) }

%o (Python)

%o def A360981(n):

%o k = n

%o while k.bit_count()&1:

%o k += n

%o return k # _Chai Wah Wu_, Feb 28 2023

%Y Cf. A001969, A020330, A180938, A360980 (variant for odious numbers).

%K nonn,base,look

%O 1,1

%A _Rémy Sigrist_, Feb 27 2023