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 A088696 #43 Feb 16 2025 22:31:16 %S A088696 1,1,2,1,2,3,2,1,2,3,2,3,4,3,2,1,2,3,2,3,4,3,2,3,4,5,4,3,4,3,2,1,2,3, %T A088696 2,3,4,3,2,3,4,5,4,3,4,3,2,3,4,5,4,5,6,5,4,3,4,5,4,3,4,3,2,1,2,3,2,3, %U A088696 4,3,2,3,4,5,4,3,4,3,2,3,4,5,4,5,6,5,4,3,4,5,4,3,4,3,2,3,4,5,4,5,6,5,4,5,6 %N A088696 Triangle read by rows, giving number of partial quotients in continued fraction representation of terms in the left branch of the infinite Stern-Brocot tree. %C A088696 Each next row is the last row concatenated with the last row reversed with elements incremented. A000120 is produced by a similar principle, omitting the reversal step. [Edited by _Andrey Zabolotskiy_, Mar 27 2020] %C A088696 From _Gary W. Adamson_, Aug 08 2009: (Start) %C A088696 The row with 8 terms: (1, 2, 3, 2, 3, 4, 3, 2); can be used to generate the numbers of hydrogen bonds per codon/anti-codon; superimposed on the DNA codon array of A147995 as follows: top row and left column of an 8 X 8 array is composed of the 8 terms (1, 2, 3, 2, 3, 4, 3, 2). If rows and columns have an offset of "1", then odd rows circulate downward starting from the position (n,n). Even rows circulate in the opposite direction starting from position (n,n). %C A088696 This produces the array: %C A088696 1 2 3 2 3 4 3 2 %C A088696 2 1 2 3 4 3 2 3 %C A088696 3 2 1 2 3 2 3 4 %C A088696 2 3 2 1 2 3 2 3 %C A088696 3 4 3 2 1 2 3 2 %C A088696 4 3 2 3 2 1 4 3 %C A088696 3 2 3 4 3 2 1 2 %C A088696 2 3 4 3 2 3 2 1 %C A088696 ... %C A088696 This produces a semi-magic square with a diagonal of (1,1,1,...). Using the simple replacement rule ("complement to 10"): (1->9); (2->8); (3->7); (4->6) we obtain the chart of DNA hydrogen bonds per codon/anti-codon shown in A147995. Top row of the hydrogen bond array as well as left column = (9, 8, 7, 8, 7, 6, 7, 8). %C A088696 Alternatively, using the circulant rule for alternate rows and putting all 9's along the diagonal, we obtain the chart of hydrogen bonds. (End) %C A088696 Rows tend to A088748 (which can also be generated from the dragon curve, A014577). - _Gary W. Adamson_, Aug 30 2009 %C A088696 Positions of records are A081254. - _Andrey Zabolotskiy_, Mar 27 2020 %D A088696 R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990, pp. 116-117. %H A088696 Andrey Zabolotskiy, <a href="/A088696/b088696.txt">Table of n, a(n) for n = 1..8191</a> %e A088696 Fractions in the left branch of the infinite Stern-Brocot tree (the fractions between 0 and 1), are: %e A088696 1/2; %e A088696 1/3, 2/3; %e A088696 1/4, 2/5, 3/5, 3/4; %e A088696 1/5, 2/7, 3/8, 3/7, 4/7, 5/8, 5/7, 4/5; %e A088696 ... %e A088696 and their corresponding continued fraction representations are: %e A088696 [2] %e A088696 [3] [1,2] %e A088696 [4] [2,2] [1,1,2] [1,3] %e A088696 [5] [3,2] [2,1,2] [2,3] [1,1,3] [1,1,1,2] [1,2,2] [1,4] %e A088696 ... %e A088696 with the number of terms in each continued fraction representation generating the present triangle: %e A088696 1 %e A088696 1 2 %e A088696 1 2 3 2 %e A088696 1 2 3 2 3 4 3 2 %e A088696 ... %t A088696 sb[n_List] := Block[{k = l = Length[n], a = n}, While[k > 1, a = Insert[ a, (Numerator[ a[[k]]] + Numerator[ a[[k - 1]]]) / (Denominator[ a[[k]]] + Denominator[ a[[k - 1]]]), k]; k-- ]; a]; sbn[n_] := Complement[ Nest[ sb, {0, 1}, n], Nest[ sb, {0, 1}, n - 1]]; f[n_] := Length /@ (ContinuedFraction /@ sbn[n]) - 1; Flatten[ Table[ f[n], {n, 7}]] (* _Robert G. Wilson v_, Jun 09 2004 *) %t A088696 Flatten[NestList[Join[#, Reverse[#] + 1] &, {1}, 7]]; (* from A164738, _Jon Maiga_, Sep 26 2019 *) %o A088696 (Haskell) %o A088696 a088696 n = a088696_list !! (n-1) %o A088696 a088696_list = f [1] where %o A088696 f (x:xs) = x : f (xs ++ [x + 1 - x `mod` 2, x + x `mod` 2]) %o A088696 -- _Reinhard Zumkeller_, Mar 07 2011 %o A088696 (Python) %o A088696 a = [[1]] %o A088696 for n in range(6): %o A088696 a.append(a[-1] + [x+1 for x in a[-1][::-1]]) %o A088696 print(sum(a, [])) %o A088696 # _Andrey Zabolotskiy_, Mar 27 2020, after _Jon Maiga_ %Y A088696 Cf. A000120, A007305, A007306. %Y A088696 Cf. A147995. %Y A088696 Cf. A088748, A014577. %K A088696 nonn,tabf %O A088696 1,3 %A A088696 _Gary W. Adamson_, Oct 07 2003 %E A088696 Edited and extended by _Robert G. Wilson v_, Jun 09 2004