login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A192395
a(n) = 2*a(n-1) - 2*a(n-2) + a(n-3) + 2*a(n-4) starting with a(0..3) = 0, 0, 0, 1.
2
0, 0, 0, 1, 2, 2, 1, 2, 8, 17, 22, 22, 33, 78, 156, 233, 298, 442, 833, 1546, 2464, 3553, 5390, 9230, 16161, 26358, 40404, 62713, 103298, 174290, 285505, 451154, 712184, 1156145, 1910086, 3122374, 5005089, 7987806, 12907980, 21090185, 34362394, 55428010
OFFSET
0,5
FORMULA
From R. J. Mathar, Jul 14 2011: (Start)
G.f.: x^3/((1-x+2*x^2)*(1-x-x^2)).
a(n) = (A000045(n) - A107920(n))/3. (End)
MAPLE
a:= n-> (<<0|1|0|0>, <0|0|1|0>, <0|0|0|1>, <2|1|-2|2>>^n)[1, 4]:
seq(a(n), n=0..45); # Alois P. Heinz, Jul 11 2023
MATHEMATICA
LinearRecurrence[{2, -2, 1, 2}, {0, 0, 0, 1}, 100] (* Vincenzo Librandi, Nov 25 2011 *)
PROG
(Magma) I:=[0, 0, 0, 1]; [n le 4 select I[n] else 2*Self(n-1)-2*Self(n-2)+Self(n-3)+2*Self(n-4): n in [1..50]]; // Vincenzo Librandi, Nov 25 2011
(SageMath)
@CachedFunction
def a(n): # a = A192395
if (n<4): return n//3
else: return 2*a(n-1) - 2*a(n-2) + a(n-3) + 2*a(n-4)
[a(n) for n in range(51)] # G. C. Greubel, Jul 10 2023
CROSSREFS
Sequence in context: A162663 A005007 A188792 * A014243 A366375 A366285
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Jun 29 2011
STATUS
approved