OFFSET
0,2
COMMENTS
a(base,n) = a(base-1,n) + 5^(n-1) for base >= 2*n - 1.
a(base,n) = a(base-1,n) + 5^(n-1) - 2 when base = 2*(n-1).
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Sergey Kitaev and Jeffrey Remmel, (a,b)-rectangle patterns in permutations and words, arXiv:1304.4286 [math.CO], 2013.
Index entries for linear recurrences with constant coefficients, signature (4,1,-1).
FORMULA
G.f.: 1 + 2*x*(3-x^2)/(1-4*x-x^2+x^3). - R. J. Mathar, Jun 06 2013
MATHEMATICA
LinearRecurrence[{4, 1, -1}, {1, 6, 24, 100}, 41] (* G. C. Greubel, Aug 08 2023 *)
PROG
(S/R) stvar $[N]:(0..M-1) init $[]:=0 asgn $[]->{*} kill +[i in 0..N-2](($[i]`-$[i+1]`>2)+($[i+1]`-$[i]`>2))
(Magma) I:=[1, 6, 24, 100]; [n le 4 select I[n] else 4*Self(n-1) +Self(n-2) -Self(n-3): n in [1..41]]; // G. C. Greubel, Aug 08 2023
(SageMath)
@CachedFunction
def a(n): # A126393
if (n<4): return (1, 6, 24, 100)[n]
else: return 4*a(n-1) +a(n-2) -a(n-3)
[a(n) for n in range(41)] # G. C. Greubel, Aug 08 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
R. H. Hardin, Dec 28 2006
STATUS
approved