A088431 Half of the (n+1)-st component of the continued fraction expansion of Sum_{k>=0} 1/2^(2^k).
2, 1, 2, 2, 3, 2, 1, 2, 3, 1, 2, 3, 2, 2, 1, 2, 3, 1, 2, 2, 3, 2, 1, 3, 2, 1, 2, 3, 2, 2, 1, 2, 3, 1, 2, 2, 3, 2, 1, 2, 3, 1, 2, 3, 2, 2, 1, 3, 2, 1, 2, 2, 3, 2, 1, 3, 2, 1, 2, 3, 2, 2, 1, 2, 3, 1, 2, 2, 3, 2, 1, 2, 3, 1, 2, 3, 2, 2, 1, 2, 3, 1, 2, 2, 3, 2, 1, 3, 2, 1, 2, 3, 2, 2, 1, 3, 2, 1, 2, 2, 3, 2, 1, 2, 3
Offset: 1
Keywords
Examples
Example to illustrate the comment: a(a(1)+1)=a(3)=2 and a(2) is undefined. The rule requires a(2)=1. Next, a(a(1)+a(2)+1)=a(4)=2, a(a(1)+a(2)+a(3)+1)=a(6)=2 and a(5) is undefined. The rule now requires a(5)=3.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..8192
- Martin Bunder, Bruce Bates, and Stephen Arnold, The summed paperfolding sequence, Bull. Austral. Math. Soc. 110 (2024), 189-198.
- Kevin Ryde, Iterations of the Dragon Curve, see index "TurnRun", with a(n) = TurnRun(n-1).
- Jeffrey Shallit, Runs in Paperfolding Sequences, arXiv:2412.17930 [math.CO], 2024. See p. 10.
Programs
-
Mathematica
a[n_] := a[n] = Which[n < 3, {0, 1, 4}[[n + 1]], Mod[n, 8] == 1, a[(n + 1)/2], Mod[n, 8] == 2, a[(n + 2)/2], True, {2, 0, 0, 2, 4, 4, 6, 4, 2, 0, 0, 2, 4, 6, 4, 4}[[Mod[n, 16] + 1]]]; Array[a[# + 1]/2 &, 98] (* after Jean-François Alcover at A007400 *)
-
Scheme
(define (A088431 n) (* 1/2 (A007400 (+ 1 n)))) ;; Code for A007400 given under that entry. - Antti Karttunen, Aug 12 2017
Formula
a(n) = (1/2)*A007400(n+1); a(a(1) + a(2) + ... + a(n) + 1) = 2.
Comments