cp's OEIS Frontend

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.

A287823 a(n) = A287729(n)*A001511(n).

This page as a plain text file.
%I A287823 #81 May 08 2019 15:43:04
%S A287823 1,0,1,3,2,2,1,0,1,2,2,3,3,4,3,5,4,6,5,6,5,6,4,4,3,4,3,3,2,2,1,0,1,2,
%T A287823 2,3,3,4,3,4,4,6,5,6,5,6,4,5,5,8,7,9,8,10,7,8,7,10,8,9,7,8,5,7,6,10,9,
%U A287823 12,11,14,10,12,11,16,13,15,12,14,9,10,9
%N A287823 a(n) = A287729(n)*A001511(n).
%C A287823 For n > 0, define the sequence chf(n) of Christoffel words over an alphabet {-,+} by recursion with chf(1) = '-' and chf(2*n+0) = negate(chf(n)), chf(2*n+1) = negate(concatenate(chf(n),chf(n+1))).
%C A287823 The chf(n) word has length fusc(n) = A002487(n) and splits uniquely into two parent Christoffel words - the left Christoffel word lef(n) of length l-fusc(n) = A288002(n) and the right Christoffel word rig(n) of length r-fusc(n) = A288003(n).
%C A287823 For n > 0, define the lap(n) word to be the chf(n) word taken to the power A001511(n), so that the factor-word chf(n) repeats in lap(n) A001511(n) times.
%C A287823 Consider the odd bisection CHF(n) of the chf(n) sequence. Each CHF(n) word has length A007306(n). Then the sequence lap(n) is obtained by cutting off the word lef(n) of length A288002(n) at the left side of negate(CHF(n)) and negating the first letter of the new word iff lef(n) is empty, i.e., iff A288002(n)==0.
%C A287823 The length of the lap(n) word is A287896(n), the number of '-'-signs in the lap(n) word is a(n) and the number of '+'-signs in the lap(n) word is A287824(n).
%C A287823 There are exactly n words of length n in the sequence lap(n). These n words lap(j) are all different with 1<=a(j)<=n for 1<=j<=n.
%C A287823 a(n)/A287824(n) enumerates all fractions along the tree of fractions.
%C A287823 a(n)/A287896(n) enumerates all proper fractions along the tree of proper fractions.
%C A287823 See the Serov links and the example below.
%H A287823 I. V. Serov, <a href="/A287823/b287823.txt">Table of n, a(n) for n = 1..8192</a>
%H A287823 J. Berstel, A. Lauve, C. Reutenauer & F. Saliola, <a href="http://www-igm.univ-mlv.fr/~berstel/LivreCombinatoireDesMots/2008wordsbookMtlUltimate.pdf">Combinatorics on Words: Christoffel Words and Repetitions in Words</a>, 2008.
%H A287823 I. V. Serov, <a href="/A287823/a287823_1.png">OEIS: The tree of all fractions as sequence a(n)/A287824(n)</a>
%H A287823 I. V. Serov, <a href="/A287823/a287823_1.jpg">OEIS: The tree of all proper fractions as sequence a(n)/A287896</a>
%H A287823 I. V. Serov, <a href="http://www.chf.nu/CHF_DIATOMIC_ALGORITHM_BENCHMARK.pdf">CHF Diatomic Algorithm Benchmark</a>
%F A287823 a(n) = A287896(n) - A287824(n).
%F A287823 a(n) = (A287729(n-1) + A287729(n) + A287729(n+1))/2 + A154269(n).
%F A287823 gcd(a(n), A287896(n)) == gcd(a(n), A287824(n)) == A001511(n).
%F A287823 From _Yosu Yurramendi_, Apr 09 2019: (Start)
%F A287823 For m >= 0, m even, 0 <= k < 2^m, a(2^m+k) = A287896(2^m-k).
%F A287823 For m >= 0, m odd,  0 <= k < 2^m, a(2^m+k) = A287896(k).  A287896(0) = 0 is needed. (End)
%e A287823 n  chf(n)  A070939(n) A001511(n) A002487(n) lef(n) CHF(n)     lap(n)   a(n)
%e A287823 1  '-'     1          1          1          ''     '-'        '-'      1
%e A287823 2  '+'     2          2          1          ''     '+-'       '++'     0
%e A287823 3  '+-'    2          2          2          '+'    '--+'      '+-'     1
%e A287823 4  '-'     3          1          1          ''     '-++'      '---'    3
%e A287823 5  '--+'   3          3          3          '-'    '+++-'     '--+'    2
%e A287823 6  '-+'    3          1          2          '-'    '++-+-'    '-+-+'   2
%e A287823 7  '-++'   3          1          3          '-+'   '+-+--'    '-++'    1
%e A287823 8  '+'     4          1          1           ''    '+---'     '++++'   0
%e A287823 9  '+++-'  4          4          4          '+'    '----+'    '+++-'   1
%e A287823 10 '++-'   4          1          3          '+'    '---+--+'  '++-++-' 2
%e A287823 11 '++-+-' 4          1          5          '++-'  '--+--+-+' '++-+-'  2
%e A287823 12 '+-'    4          1          2          '+'    '--+-+-+'  '+-+-+-' 3
%e A287823 13 '+-+--' 4          2          5          '+-'   '-+-+-++'  '+-+--'  3
%e A287823 14 '+--'   4          1          3          '+-'   '-+-++-++' '+--+--' 4
%e A287823 15 '+---'  4          1          4          '+--'  '-++-+++'  '+---'   3
%e A287823 16 '-'     5          1          1          ''     '-++++'    '-----'  5
%e A287823 17 '----+' 5          5          5          '-'    '+++++-'   '----+'  4 .
%o A287823 (Python)
%o A287823 def c(n): return 1 if n==1 else s(n/2) if n%2==0 else s((n - 1)/2) + s((n + 1)/2)
%o A287823 def s(n): return 0 if n==1 else c(n/2) if n%2==0 else c((n - 1)/2) + c((n + 1)/2)
%o A287823 def a001511(n): return bin(n)[2:][::-1].index("1") + 1
%o A287823 def a(n): return c(n)*a001511(n) # _Indranil Ghosh_, Jun 08 2017
%Y A287823 Cf. A001511, A287729, A287824, A002487, A070939, A287896, A154269.
%K A287823 nonn,frac
%O A287823 1,4
%A A287823 _I. V. Serov_, Jun 03 2017