A287823 a(n) = A287729(n)*A001511(n).
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, 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, 12, 11, 14, 10, 12, 11, 16, 13, 15, 12, 14, 9, 10, 9
Offset: 1
Examples
n chf(n) A070939(n) A001511(n) A002487(n) lef(n) CHF(n) lap(n) a(n) 1 '-' 1 1 1 '' '-' '-' 1 2 '+' 2 2 1 '' '+-' '++' 0 3 '+-' 2 2 2 '+' '--+' '+-' 1 4 '-' 3 1 1 '' '-++' '---' 3 5 '--+' 3 3 3 '-' '+++-' '--+' 2 6 '-+' 3 1 2 '-' '++-+-' '-+-+' 2 7 '-++' 3 1 3 '-+' '+-+--' '-++' 1 8 '+' 4 1 1 '' '+---' '++++' 0 9 '+++-' 4 4 4 '+' '----+' '+++-' 1 10 '++-' 4 1 3 '+' '---+--+' '++-++-' 2 11 '++-+-' 4 1 5 '++-' '--+--+-+' '++-+-' 2 12 '+-' 4 1 2 '+' '--+-+-+' '+-+-+-' 3 13 '+-+--' 4 2 5 '+-' '-+-+-++' '+-+--' 3 14 '+--' 4 1 3 '+-' '-+-++-++' '+--+--' 4 15 '+---' 4 1 4 '+--' '-++-+++' '+---' 3 16 '-' 5 1 1 '' '-++++' '-----' 5 17 '----+' 5 5 5 '-' '+++++-' '----+' 4 .
Links
- I. V. Serov, Table of n, a(n) for n = 1..8192
- J. Berstel, A. Lauve, C. Reutenauer & F. Saliola, Combinatorics on Words: Christoffel Words and Repetitions in Words, 2008.
- I. V. Serov, OEIS: The tree of all fractions as sequence a(n)/A287824(n)
- I. V. Serov, OEIS: The tree of all proper fractions as sequence a(n)/A287896
- I. V. Serov, CHF Diatomic Algorithm Benchmark
Programs
-
Python
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) 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) def a001511(n): return bin(n)[2:][::-1].index("1") + 1 def a(n): return c(n)*a001511(n) # Indranil Ghosh, Jun 08 2017
Formula
From Yosu Yurramendi, Apr 09 2019: (Start)
For m >= 0, m even, 0 <= k < 2^m, a(2^m+k) = A287896(2^m-k).
Comments