Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #16 May 11 2023 23:44:36
%S 0,1,1,2,2,5,4,13,6,30,11,69,15,148,28,320,34,661,64,1380,75,2805,144,
%T 5743,159,11576,307,23444,335,47075,655,94777,689,189923,1350,381162,
%U 1414,763077,2794,1528884,2869,3059257,5674,6124113,5818,12251239,11561,24513895,11720,49033767
%N For n > 1 the sum of t := floor(n/2) + 1 consecutive previous terms, the leading t terms when n is even, the immediately-preceding t terms when n is odd; a(0) = 0, a(1) = 1.
%C Each bisection is strictly monotonically increasing (see formula).
%H Reinhard Zumkeller, <a href="/A238834/b238834.txt">Table of n, a(n) for n = 0..6000</a>
%F a(n) = a(n - 2) + a(n/2) for even n >= 2; a(0) = 0.
%F a(n) = 2*a(n - 2) - a((n - 3)/2) + a(n - 1) for odd n >= 5; a(1) = 1; a(3) = 2.
%e a(6) = a(0) + a(1) + a(2) + a(3) = 0 + 1 + 1 + 2 = 4.
%e a(7) = a(3) + a(4) + a(5) + a(6) = 2 + 2 + 5 + 4 = 13.
%e a(8) = a(0) + a(1) + a(2) + a(3) + a(4) = 0 + 1 + 1 + 2 + 2 = 6.
%e a(9) = a(4) + a(5) + a(6) + a(7) + a(8) = 2 + 5 + 4 + 13 + 6 = 30.
%o (PARI) a(n) = if(n < 2, n, sum(k = 0, n\2, a(k + (n%2)*(n - 1)/2))) \\ or, much faster for large n:
%o a = [0, 1]; for(n = 2, 50, a = concat(a, sum(k = 0, n\2, a[k + 1 + (n%2)*(n - 1)/2]))); a
%o (Haskell)
%o a238834 n = a238834_list !! n
%o a238834_list = 0 : 1 : f True (drop 2 a008619_list) [1, 0] where
%o f p (t:ts) xs = y : f (not p) ts (y:xs)
%o where y = sum $ take t (if p then reverse xs else xs)
%o -- _Reinhard Zumkeller_, Mar 10 2014
%Y Cf. A008619.
%K nonn
%O 0,4
%A _Rick L. Shepherd_, Mar 10 2014