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).
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
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
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..10000
- Rémy Sigrist, Scatterplot of the first 2^17 terms
- Rémy Sigrist, Colored scatterplot of the first 2^17 terms (where the color is function of A000120(n), the Hamming weight of n)
- Rémy Sigrist, C++ program for A295642
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 *)
Comments