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.
%I A295642 #12 Nov 28 2017 11:55:45 %S A295642 3,2,7,5,13,23,31,11,29,43,47,61,79,127,191,17,19,59,83,53,149,151, %T A295642 223,89,157,251,283,317,349,383,479,37,41,103,107,101,109,167,239,173, %U A295642 233,367,379,431,509,751,1087,113,179,307,311,181,373,439,503,313,443 %N 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). %C A295642 This sequence is a permutation of the prime numbers (A000040) and for any prime p, a(n) = p for some n <= p. %C A295642 For any n > 0, a(n) >= A295609(n). %H A295642 Rémy Sigrist, <a href="/A295642/b295642.txt">Table of n, a(n) for n = 1..10000</a> %H A295642 Rémy Sigrist, <a href="/A295642/a295642.png">Scatterplot of the first 2^17 terms</a> %H A295642 Rémy Sigrist, <a href="/A295642/a295642_1.png">Colored scatterplot of the first 2^17 terms</a> (where the color is function of A000120(n), the Hamming weight of n) %H A295642 Rémy Sigrist, <a href="/A295642/a295642.txt">C++ program for A295642</a> %e A295642 The first terms, alongside the binary representation of n and a(n), are: %e A295642 n a(n) bin(n) bin(a(n)) %e A295642 -- ---- ------ --------- %e A295642 1 3 1 11 %e A295642 2 2 10 10 %e A295642 3 7 11 111 %e A295642 4 5 100 101 %e A295642 5 13 101 1101 %e A295642 6 23 110 10111 %e A295642 7 31 111 11111 %e A295642 8 11 1000 1011 %e A295642 9 29 1001 11101 %e A295642 10 43 1010 101011 %e A295642 11 47 1011 101111 %e A295642 12 61 1100 111101 %e A295642 13 79 1101 1001111 %e A295642 14 127 1110 1111111 %e A295642 15 191 1111 10111111 %e A295642 16 17 10000 10001 %e A295642 17 19 10001 10011 %e A295642 18 59 10010 111011 %e A295642 19 83 10011 1010011 %e A295642 20 53 10100 110101 %t A295642 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 *) %o A295642 (C++) See Links section. %Y A295642 Cf. A000040, A000120, A295609. %K A295642 nonn,base %O A295642 1,1 %A A295642 _Rémy Sigrist_, Nov 25 2017