OFFSET
0,2
COMMENTS
Empirical: a(base, n) = a(base-1, n) + A005191(n+1) for base >= 2*floor(n/2) + 1 where base is the number of letters in the alphabet.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (5,-3,-5,1,1).
FORMULA
From Colin Barker, Jun 04 2017: (Start)
G.f.: (1 - 3*x^2 - 10*x^3 + 3*x^4 + 4*x^5) / ((1 - x - x^2)*(1 - 4*x + x^3)).
a(n) = 5*a(n-1) - 3*a(n-2) - 5*a(n-3) + a(n-4) + a(n-5) for n>5. (End)
MATHEMATICA
LinearRecurrence[{5, -3, -5, 1, 1}, {1, 5, 19, 65, 247, 955}, 60] (* G. C. Greubel, Aug 03 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) R<x>:=PowerSeriesRing(Integers(), 30); Coefficients(R!( (1-3*x^2-10*x^3+3*x^4+4*x^5)/((1-x-x^2)*(1-4*x+x^3)) )); // G. C. Greubel, Aug 03 2023
(SageMath)
@CachedFunction
def a(n): # a = A124806
if (n<6): return (1, 5, 19, 65, 247, 955)[n]
else: return 5*a(n-1)-3*a(n-2)-5*a(n-3)+a(n-4)+a(n-5)
[a(n) for n in range(31)] # G. C. Greubel, Aug 03 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
R. H. Hardin, Dec 28 2006
STATUS
approved