%I #38 Mar 29 2024 10:44:43
%S 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,
%T 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,
%U 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
%N Half of the (n+1)-st component of the continued fraction expansion of Sum_{k>=0} 1/2^(2^k).
%C To construct the sequence use the rule: a(1)=2, then a(a(1) + a(2) + ... + a(n) + 1) = 2 and fill in any undefined places with the sequence 1,3,1,3,1,3,1,3,1,3,1,3,....
%C This sequence appears to be the sequence of run lengths of the regular paperfolding sequence A014577, i.e., the latter starts as follows: 2 zeros, 1 one, 2 zeros, 2 ones, etc. - _Dimitri Hendriks_, May 06 2010
%H Antti Karttunen, <a href="/A088431/b088431.txt">Table of n, a(n) for n = 1..8192</a>
%H Martin Bunder, Bruce Bates, and Stephen Arnold, <a href="https://doi.org/10.1017/S0004972724000169">The summed paperfolding sequence</a>, Bull. Austral. Math. Soc. (2024).
%H Kevin Ryde, <a href="http://user42.tuxfamily.org/dragon/index.html">Iterations of the Dragon Curve</a>, see index "TurnRun", with a(n) = TurnRun(n-1).
%F a(n) = (1/2)*A007400(n+1); a(a(1) + a(2) + ... + a(n) + 1) = 2.
%e 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.
%t 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 *)
%o (Scheme) (define (A088431 n) (* 1/2 (A007400 (+ 1 n)))) ;; Code for A007400 given under that entry. - _Antti Karttunen_, Aug 12 2017
%Y Cf. A007400, A014577, A088435, A092910.
%K nonn,changed
%O 1,1
%A _Benoit Cloitre_, Nov 08 2003
|