cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Apr 28 2021

Keywords

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?

Examples

			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
		

Crossrefs

Programs

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