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.

A295642 Lexicographically earliest sequence of distinct prime numbers such that, for any n > 0, a(n) AND n = n (where AND denotes the binary AND operator).

Original entry on oeis.org

3, 2, 7, 5, 13, 23, 31, 11, 29, 43, 47, 61, 79, 127, 191, 17, 19, 59, 83, 53, 149, 151, 223, 89, 157, 251, 283, 317, 349, 383, 479, 37, 41, 103, 107, 101, 109, 167, 239, 173, 233, 367, 379, 431, 509, 751, 1087, 113, 179, 307, 311, 181, 373, 439, 503, 313, 443
Offset: 1

Views

Author

Rémy Sigrist, Nov 25 2017

Keywords

Comments

This sequence is a permutation of the prime numbers (A000040) and for any prime p, a(n) = p for some n <= p.
For any n > 0, a(n) >= A295609(n).

Examples

			The first terms, alongside the binary representation of n and a(n), are:
  n   a(n)   bin(n)  bin(a(n))
  --  ----   ------  ---------
   1     3        1         11
   2     2       10         10
   3     7       11        111
   4     5      100        101
   5    13      101       1101
   6    23      110      10111
   7    31      111      11111
   8    11     1000       1011
   9    29     1001      11101
  10    43     1010     101011
  11    47     1011     101111
  12    61     1100     111101
  13    79     1101    1001111
  14   127     1110    1111111
  15   191     1111   10111111
  16    17    10000      10001
  17    19    10001      10011
  18    59    10010     111011
  19    83    10011    1010011
  20    53    10100     110101
		

Crossrefs

Programs

  • Mathematica
    Fold[Append[#1, Block[{p = 2}, While[Nand[FreeQ[#1, p], BitAnd[p, #2] == #2], p = NextPrime@ p]; p]] &, {3}, Range[2, 57]] (* Michael De Vlieger, Nov 26 2017 *)