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 A382357 #11 Mar 26 2025 16:17:03 %S A382357 1,2,3,6,4,8,12,10,5,14,7,18,9,22,11,26,13,30,15,34,17,38,19,42,20,24, %T A382357 16,32,48,40,28,46,21,50,23,54,25,58,27,62,29,66,31,70,33,74,35,78,36, %U A382357 56,44,72,52,82,37,86,39,90,41,94,43,98,45,102,47,106,49 %N A382357 Lexicographically earliest sequence of distinct positive integers such that the 2-adic valuations of adjacent terms differ exactly by one. %C A382357 The first term with a given 2-adic valuation, say k, is necessarily 2^k. %C A382357 Empirically, powers of two appear as pairs of consecutive terms. %C A382357 We cannot have three consecutive powers of 2: if a(n) = 2^k and a(n+1) = 2^(k+1) then a(n+2) <= 3*2^k < 2^(k+2). %C A382357 All powers of two appear in the sequence: %C A382357 - by contradiction: if 2^m is missing, then the 2-adic valuation of the terms of the sequence is bounded by m, %C A382357 - by necessity, we have some k < m such that all the integers with 2-adic valuation k appear in the sequence, %C A382357 - hence all integers with 2-adic valuation k+1 (and k-1 provided k > 0) will appear in the sequence, %C A382357 - gradually, all integers with 2-adic valuation k+2, k+3, etc. and eventually 2^m, will appear, a contradiction. %C A382357 Conjecture: this sequence is a permutation of the positive integers. %C A382357 The fact that A007814 contains every positive integer infinitely many times is not sufficient to guarantee that the present sequence is a permutation of the positive integers (the variant based on A003602 instead of A007814 contains only finitely many even numbers, and so is not a permutation of the positive integers, although A003602 contains every positive integer infinitely many times). %H A382357 Rémy Sigrist, <a href="/A382357/b382357.txt">Table of n, a(n) for n = 1..10000</a> %H A382357 Rémy Sigrist, <a href="/A382357/a382357.png">Colored scatterplot of the first million terms</a> (blue pixels for even n's, red pixels for odd n's) %H A382357 Rémy Sigrist, <a href="/A382357/a382357.gp.txt">PARI program</a> %e A382357 The initial terms are: %e A382357 n a(n) A007814(a(n)) %e A382357 -- ---- ------------- %e A382357 1 1 0 %e A382357 2 2 1 %e A382357 3 3 0 %e A382357 4 6 1 %e A382357 5 4 2 %e A382357 6 8 3 %e A382357 7 12 2 %e A382357 8 10 1 %e A382357 9 5 0 %e A382357 10 14 1 %e A382357 11 7 0 %e A382357 12 18 1 %e A382357 13 9 0 %e A382357 14 22 1 %e A382357 15 11 0 %o A382357 (PARI) \\ See Links section. %Y A382357 Cf. A003602, A007814, A073675, A266089, A382360. %K A382357 nonn,base %O A382357 1,2 %A A382357 _Rémy Sigrist_, Mar 22 2025