OFFSET
0,2
COMMENTS
[Empirical] a(base,n) = a(base-1,n) + A005191(n+1) for base >= 2*floor(n/2) + 1.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (6,-6,-8,5,2,-1).
FORMULA
From Colin Barker, Jun 04 2017: (Start)
G.f.: (1 - 6*x^2 - 16*x^3 + 15*x^4 + 8*x^5 - 5*x^6) / ((1 - 4*x - x^2 + x^3)*(1 - 2*x - x^2 + x^3)).
a(n) = 6*a(n-1) - 6*a(n-2) - 8*a(n-3) + 5*a(n-4) + 2*a(n-5) - a(n-6) for n > 6.
(End)
MATHEMATICA
LinearRecurrence[{6, -6, -8, 5, 2, -1}, {1, 6, 24, 84, 332, 1336, 5478}, 35] (* G. C. Greubel, Aug 04 2023 *)
PROG
(S/R) stvar $[N]:(0..M-1) init $[]:=0 asgn $[]->{*} kill +[i in 0..N-1](($[i]`-$[(i+1)mod N]`>2)+($[(i+1)mod N]`-$[i]`>2))
(Magma) I:=[1, 6, 24, 84, 332, 1336, 5478]; [n le 7 select I[n] else 6*Self(n-1) -6*Self(n-2) -8*Self(n-3) +5*Self(n-4) +2*Self(n-5) -Self(n-6): n in [1..41]]; // G. C. Greubel, Aug 04 2023
(SageMath)
@CachedFunction
def a(n): # a = A124807
if (n<7): return (1, 6, 24, 84, 332, 1336, 5478)[n]
else: return 6*a(n-1) -6*a(n-2) -8*a(n-3) +5*a(n-4) +2*a(n-5) -a(n-6)
[a(n) for n in range(41)] # G. C. Greubel, Aug 04 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
R. H. Hardin, Dec 28 2006
STATUS
approved