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 A370727 #13 Mar 02 2024 06:34:04 %S A370727 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, %T A370727 34,35,37,48,14,128,129,130,21,22,25,131,38,40,49,52,15,192,68,66,67, %U A370727 23,97,69,41,39,80,26,256,257,260,258,261,264,27,288,50,51 %N 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). %C A370727 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. %C A370727 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. %H A370727 Rémy Sigrist, <a href="/A370727/b370727.txt">Table of n, a(n) for n = 1..10000</a> %H A370727 Rémy Sigrist, <a href="/A370727/a370727.gp.txt">PARI program</a> %H A370727 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %e A370727 The first terms, alongside the corresponding binary expansions, are: %e A370727 n a(n) bin(a(n)) bin(prime(n)) %e A370727 -- ---- --------- ------------- %e A370727 1 2 10 10 %e A370727 2 1 1 11 %e A370727 3 4 100 101 %e A370727 4 3 11 111 %e A370727 5 8 1000 1011 %e A370727 6 5 101 1101 %e A370727 7 16 10000 10001 %e A370727 8 17 10001 10011 %e A370727 9 6 110 10111 %e A370727 10 9 1001 11101 %o A370727 (PARI) See Links section. %Y A370727 Cf. A295609, A295989, A370728 (inverse). %K A370727 nonn,base %O A370727 1,1 %A A370727 _Rémy Sigrist_, Feb 28 2024