Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #28 Jul 18 2023 02:29:37
%S 3,1,5,6,15,9,23,10,27,63,12,95,29,17,30,111,119,18,123,39,20,125,43,
%T 126,255,45,24,46,33,51,16383,53,159,34,1023,36,175,183,54,187,189,40,
%U 1535,48,57,65,4095,6143,58,66,60,190,68,1791,207,215,219,72,221,71
%N a(n) is the smallest positive integer not already in the sequence such that Sum_{i=1..n} binary_weight(a(i)) is prime.
%C A binary analog of A269415.
%C Clearly 1 is the only term of odd weight that can appear, and if it is true (which is not presently known) that there infinitely many prime gaps of 2, 4, 6, 8, etc. then every number of even weight will appear.
%H Chai Wah Wu, <a href="/A278032/b278032.txt">Table of n, a(n) for n = 1..10000</a>
%t a[1] = 3; a[n_] := a[n] = Module[{k = 1, s = Sum[DigitCount[a[i], 2, 1], {i, 1, n - 1}]}, While[!FreeQ[Array[a, n - 1], k] || !PrimeQ[s + DigitCount[k, 2, 1]], k++]; k]; Array[a, 100] (* _Amiram Eldar_, Jul 18 2023 *)
%Y Cf. A000120 (binary weight), A269415.
%K nonn,base
%O 1,1
%A _N. J. A. Sloane_, Nov 11 2016
%E a(13) corrected by _Chai Wah Wu_, Nov 11 2016
%E More terms from _Chai Wah Wu_, Nov 11 2016