A131132 a(n) = a(n-1) + a(n-2) + 1 if n is a multiple of 6, otherwise a(n) = a(n-1) + a(n-2).
1, 1, 2, 3, 5, 8, 14, 22, 36, 58, 94, 152, 247, 399, 646, 1045, 1691, 2736, 4428, 7164, 11592, 18756, 30348, 49104, 79453, 128557, 208010, 336567, 544577, 881144, 1425722, 2306866, 3732588, 6039454, 9772042, 15811496, 25583539, 41395035, 66978574, 108373609
Offset: 0
Keywords
Examples
Since 5 is not a multiple of 6, a(5) = a(4) + a(3) = 5 + 3 = 8. Since 6 is a multiple of 6, a(6) = a(5) + a(4) + 1 = 8 + 5 + 1 = 14. - _Michael B. Porter_, Jul 26 2016
Links
- H. Matsui et al., Problem B-1035, Fibonacci Quarterly, Vol. 45, Number 2; 2007; p. 182.
- Index entries for linear recurrences with constant coefficients, signature (1,1,0,0,0,1,-1,-1).
Programs
-
Maple
A131132:=proc(n) option remember; local t1; if n <= 2 then RETURN(1); fi: if n mod 6 = 1 then t1:=1 else t1:=0; fi: procname(n-1)+procname(n-2)+t1; end; [seq(A131132(n), n=1..100)]; # N. J. A. Sloane, May 25 2008; Typo corrected by R. J. Mathar, May 30 2008
-
Mathematica
Print[Table[Round[(1 + Sqrt[5])/8 Fibonacci[n + 3]], {n, 0, 50}]] ; Print[RecurrenceTable[{c[n] == c[n - 1] + c[n - 2] + c[n - 6] - c[n - 7] - c[n - 8], c[0] == 1, c[1] == 1, c[2] == 2, c[3] == 3, c[4] == 5, c[5] == 8, c[6] == 14, c[7] == 22}, c, {n, 0, 50}]] ; (* John M. Campbell, Jul 07 2016 *) LinearRecurrence[{1, 1, 0, 0, 0, 1, -1, -1}, {1, 1, 2, 3, 5, 8, 14, 22}, 40] (* Vincenzo Librandi, Jul 07 2016 *)
Formula
O.g.f.: 1/((1-x^6)(1 - x - x^2)). - R. J. Mathar, May 30 2008
a(n) = floor(A066983(n+4)/3). - Gary Detlefs, Dec 19 2010
a(n) = round((1 + sqrt(5))/8 A000045(n+3)). - John M. Campbell, Jul 06 2016
a(n) = (number of compositions of n consisting of only 1 or 2 or 6) - (number of compositions with only 7 or ((1 or 2) and 7)) - (number of compositions with only 8 or ((1 or 2) and 8)). The "or" is inclusive. - Gregory L. Simay, May 25 2017
Extensions
More specific name from R. J. Mathar, Dec 09 2009
Comments