login
Numbers divisible by 3 with an odd number of 1s in their base 2 representation.
5

%I #15 Aug 06 2023 03:06:23

%S 21,42,69,81,84,87,93,117,138,162,168,171,174,186,213,234,261,273,276,

%T 279,285,309,321,324,327,333,336,339,342,345,348,351,357,369,372,375,

%U 381,405,426,453,465,468,471,477,501,522,546,552,555,558,570,597,618

%N Numbers divisible by 3 with an odd number of 1s in their base 2 representation.

%C Not the same as multiples of 3 with a nonzero alternating binary digit sum: a(142) = 1368, but that sequence has 1365 as the 142nd term. - _Charles R Greathouse IV_, Feb 06 2015

%H Charles R Greathouse IV, <a href="/A180963/b180963.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = 3*A036556(n). - _Amiram Eldar_, Aug 06 2023

%t Select[3 * Range[210], OddQ[DigitCount[#, 2, 1]] &] (* _Amiram Eldar_, Aug 06 2023 *)

%o (PARI) isok(n) = (hammingweight(n) % 2) && (n % 3 == 0) \\ _Michel Marcus_, Jul 16 2013

%Y Intersection of A000069 and A008585.

%Y Cf. A036556.

%K nonn,easy,base

%O 1,1

%A _Dylan Hamilton_, Sep 28 2010