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 A319268 #15 Nov 09 2018 07:33:45 %S A319268 1,2,4,8,3,9,6,16,5,12,7,18,10,24,14,32,36,20,11,25,13,15,33,72,19,21, %T A319268 22,49,26,28,30,64,17,144,38,40,42,45,23,50,52,27,57,60,31,66,34,288, %U A319268 37,39,81,84,43,91,47,98,101,105,54,56,29,120,62,128,132,68 %N A319268 Lexicographically earliest sequence of distinct positive terms such that for any n > 0, the binary representation of n^2 starts with the binary representation of a(n). %C A319268 This sequence is a permutation of the natural numbers with inverse A319499. %C A319268 We can build a variant of this sequence for any base b > 1. %C A319268 We can build a variant of this sequence for any strictly increasing sequence of nonnegative integers. %H A319268 Ivan Neretin, <a href="/A319268/b319268.txt">Table of n, a(n) for n = 1..10000</a> %H A319268 Rémy Sigrist, <a href="/A319268/a319268.gp.txt">PARI program for A319268</a> %H A319268 Rémy Sigrist, <a href="/A319268/a319268.png">Colored logarithmic scatterplot of the first 10000 terms</a> (where the color is function of A070939(n^2) - A070939(a(n))) %H A319268 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %e A319268 The first terms, alongside the binary representation of n^2 with a(n) in parentheses, are: %e A319268 n a(n) bin(n^2) %e A319268 -- ---- -------- %e A319268 1 1 (1) %e A319268 2 2 (10)0 %e A319268 3 4 (100)1 %e A319268 4 8 (1000)0 %e A319268 5 3 (11)001 %e A319268 6 9 (1001)00 %e A319268 7 6 (110)001 %e A319268 8 16 (10000)00 %e A319268 9 5 (101)0001 %e A319268 10 12 (1100)100 %e A319268 11 7 (111)1001 %e A319268 12 18 (10010)000 %e A319268 13 10 (1010)1001 %e A319268 14 24 (11000)100 %e A319268 15 14 (1110)0001 %e A319268 16 32 (100000)000 %e A319268 17 36 (100100)001 %e A319268 18 20 (10100)0100 %e A319268 19 11 (1011)01001 %e A319268 20 25 (11001)0000 %t A319268 a = {1}; Do[r = IntegerDigits[n^2, 2]; AppendTo[a, Min@Complement[Table[FromDigits[Take[r, k], 2], {k, Length@r}],a]], {n, 2, 66}]; a (* _Ivan Neretin_, Oct 24 2018 *) %o A319268 (PARI) See Links section. %Y A319268 Cf. A000290, A070939, A272679, A319499. %K A319268 nonn,base %O A319268 1,2 %A A319268 _Rémy Sigrist_, Sep 16 2018