

A278032


a(n) is the smallest positive integer not already in the sequence such that Sum_{i=1..n} binary_weight(a(i)) is prime.


2



3, 1, 5, 6, 15, 9, 23, 10, 27, 63, 12, 95, 29, 17, 30, 111, 119, 18, 123, 39, 20, 125, 43, 126, 255, 45, 24, 46, 33, 51, 16383, 53, 159, 34, 1023, 36, 175, 183, 54, 187, 189, 40, 1535, 48, 57, 65, 4095, 6143, 58, 66, 60, 190, 68, 1791, 207, 215, 219, 72, 221, 71
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,1


COMMENTS

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.


LINKS



MATHEMATICA

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 *)


CROSSREFS



KEYWORD

nonn,base


AUTHOR



EXTENSIONS



STATUS

approved



