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, Table of n, a(n) for n = 1..10000
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
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Feb 28 2024
STATUS
approved