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, 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
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
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..10000
- Rémy Sigrist, PARI program
- Index entries for sequences that are permutations of the natural numbers
Programs
-
PARI
See Links section.
Comments