login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A343765
Lexicographically earliest sequence of distinct nonprime numbers such that for any n > 0, a(n+1) = a(n) XOR 2^k for some k >= 0 as small as possible (where XOR denotes the bitwise XOR operator).
1
1, 9, 8, 10, 14, 15, 143, 142, 140, 141, 133, 132, 134, 135, 391, 390, 388, 384, 385, 387, 386, 394, 395, 393, 392, 396, 398, 399, 415, 414, 412, 413, 405, 404, 406, 407, 403, 402, 400, 408, 410, 411, 475, 474, 472, 473, 477, 476, 478, 470, 471, 469, 468, 464
OFFSET
1,2
COMMENTS
This sequence is similar to A003188 and to A059459; here we deal with nonprime numbers, there with integers and prime numbers, respectively.
Will the value 4 ever appear?
EXAMPLE
The first terms, alongside their binary expansion, are:
n a(n) bin(a(n))
-- ---- ---------
1 1 1
2 9 1001
3 8 1000
4 10 1010
5 14 1110
6 15 1111
7 143 10001111
8 142 10001110
9 140 10001100
10 141 10001101
11 133 10000101
12 132 10000100
13 134 10000110
14 135 10000111
15 391 110000111
16 390 110000110
17 388 110000100
18 384 110000000
19 385 110000001
20 387 110000011
PROG
(PARI) s=2^0; v=1; for (n=1, 54, print1 (v", "); s+=2^v; for (x=0, oo, if (!bittest(s, w=bitxor(v, 2^x)) && !isprime(w), v=w; break)))
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Apr 28 2021
STATUS
approved