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.

A370727 Lexicographically earliest sequence of distinct positive integers such that for any n > 0, prime(n) AND a(n) = a(n) (where prime(n) denotes the n-th prime number and AND denotes the bitwise AND operator).

Original entry on oeis.org

2, 1, 4, 3, 8, 5, 16, 17, 6, 9, 7, 32, 33, 10, 11, 20, 18, 12, 64, 65, 72, 13, 19, 24, 96, 36, 34, 35, 37, 48, 14, 128, 129, 130, 21, 22, 25, 131, 38, 40, 49, 52, 15, 192, 68, 66, 67, 23, 97, 69, 41, 39, 80, 26, 256, 257, 260, 258, 261, 264, 27, 288, 50, 51
Offset: 1

Views

Author

Rémy Sigrist, Feb 28 2024

Keywords

Comments

In other words, the 1's in the binary expansion of the n-th term also appear in that of the n-th prime number.
This sequence is a permutation of the positive integers with inverse A370727: for any w > 0, there are infinitely many prime numbers whose binary expansions end with w 1's, and these are all occasions for an integer < 2^w to appear in the sequence.

Examples

			The first terms, alongside the corresponding binary expansions, are:
  n   a(n)  bin(a(n))  bin(prime(n))
  --  ----  ---------  -------------
   1     2         10             10
   2     1          1             11
   3     4        100            101
   4     3         11            111
   5     8       1000           1011
   6     5        101           1101
   7    16      10000          10001
   8    17      10001          10011
   9     6        110          10111
  10     9       1001          11101
		

Crossrefs

Cf. A295609, A295989, A370728 (inverse).

Programs

  • PARI
    See Links section.