The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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). 2
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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
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.
LINKS
Rémy Sigrist, PARI program
EXAMPLE
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
PROG
(PARI) See Links section.
CROSSREFS
Cf. A295609, A295989, A370728 (inverse).
Sequence in context: A275902 A008347 A112387 * A193174 A126084 A294022
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Feb 28 2024
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 21 10:20 EDT 2024. Contains 372735 sequences. (Running on oeis4.)