A112027 a(1)=1; then successively add 1, divide by 2, add 2 and then total up the last 4 terms.
1, 2, 1, 3, 7, 8, 4, 6, 25, 26, 13, 15, 79, 80, 40, 42, 241, 242, 121, 123, 727, 728, 364, 366, 2185, 2186, 1093, 1095, 6559, 6560, 3280, 3282, 19681, 19682, 9841, 9843, 59047, 59048, 29524, 29526, 177145, 177146, 88573, 88575, 531439, 531440, 265720, 265722, 1594321
Offset: 1
References
- Joshua Zucker, Posting to Seq Fan mailing list, Nov 24 2005
Links
- Paolo Xausa, Table of n, a(n) for n = 1..5000
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,4,0,0,0,-3).
Programs
-
Maple
a[1]:=1; k:=1; for n from 1 to 16 do k:=k+1; a[k]:=a[k-1]+1; k:=k+1; a[k]:=a[k-1]/2; k:=k+1; a[k]:=a[k-1]+2; k:=k+1; a[k]:=a[k-1]+a[k-2]+a[k-3]+a[k-4]; od;
-
Mathematica
LinearRecurrence[{0, 0, 0, 4, 0, 0, 0, -3}, {1, 2, 1, 3, 7, 8, 4, 6}, 50] (* Paolo Xausa, May 20 2024 *)
Formula
G.f.: -x*(6*x^7-3*x^4-3*x^3-x^2-2*x-1) / ((x-1)*(x+1)*(x^2+1)*(3*x^4-1)). - Colin Barker, Jul 28 2013
Extensions
Definition found by Franklin T. Adams-Watters, Feb 01 2006
More terms from N. J. A. Sloane, Feb 22 2006