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 A379719 #16 Jan 18 2025 09:10:57 %S A379719 0,1,-1,-2,2,3,4,-4,-3,5,6,7,8,-8,-6,-5,-7,9,10,11,12,13,14,15,16,-16, %T A379719 -12,-10,-9,-11,-13,-14,-15,17,18,19,20,21,22,23,24,25,26,27,28,29,30, %U A379719 31,32,-32,-24,-20,-18,-17,-19,-21,-22,-23,-25,-26,-27,-28 %N A379719 a(0) = 0, and for any n > 0, a(n) is the least integer (in absolute value) not yet in the sequence such that the absolute difference of a(n-1) and a(n) is a power of 2; in case of a tie, preference is given to the positive value. %C A379719 This sequence is a variant of A377091, based on powers of 2 instead of squares. %C A379719 Every integer (positive or negative) appears in this sequence. %C A379719 This sequence has indeed the following structure: %C A379719 - a transient block T corresponding to the initial terms a(0) to a(8), %C A379719 - then, for k = 2, 3, etc., blocks B(k) with the following features: %C A379719 - the initial blocks T, B(2), ..., B(k-1) form a permutation of -2^k..2^k and end with the value -2^k + 1, %C A379719 - the block B(k) starts with the positive values 2^k+1, 2^k+2, ..., 2^(k+1), %C A379719 - then continues with the negative values -2^(k+1), -2^(k+1) + 2^(k-1), -2^(k+1) + 2^(k-1) + 2^(k-2), ..., -2^(k+1) + 2^(k-1) + 2^(k-2) + ... + 2^0, %C A379719 - then continues with the missing negative values down to -2^(k+1) + 1 with steps of -1 or -2. %C A379719 As a consequence, nonnegative values appear in natural order. %H A379719 Rémy Sigrist, <a href="/A379719/b379719.txt">Table of n, a(n) for n = 0..10000</a> %H A379719 Rémy Sigrist, <a href="/A379719/a379719.gp.txt">PARI program</a> %e A379719 The first terms are: %e A379719 n a(n) |a(n)-a(n-1)| %e A379719 -- ---- ------------- %e A379719 0 0 N/A %e A379719 1 1 2^0 %e A379719 2 -1 2^1 %e A379719 3 -2 2^0 %e A379719 4 2 2^2 %e A379719 5 3 2^0 %e A379719 6 4 2^0 %e A379719 7 -4 2^3 %e A379719 8 -3 2^0 %e A379719 9 5 2^3 %e A379719 10 6 2^0 %e A379719 11 7 2^0 %e A379719 12 8 2^0 %e A379719 13 -8 2^4 %e A379719 14 -6 2^1 %o A379719 (PARI) \\ See Links section. %Y A379719 Cf. A377091, A377092. %K A379719 sign %O A379719 0,4 %A A379719 _Rémy Sigrist_, Dec 31 2024