OFFSET
1,1
REFERENCES
Jean-Pierre Serre, Linear Representations of Finite Groups, Springer-Verlag Graduate Texts in Mathematics 42.
LINKS
Harry J. Smith, Table of n, a(n) for n=1,...,1000
Index entries for linear recurrences with constant coefficients, signature (1, 1, -1).
FORMULA
For odd n: a(n) = (n+3)/2; for even n: a(n) = (n+6)/2.
a(1)=2,a(2)=4. For odd n:a(n)=(a(n-1)+a(n-2))/2; for even n: a(n)=(a(n-1)+a(n-2)+3)/2. [Vincenzo Librandi, Dec 20 2010]
a(n)=a(n-1)+a(n-2)-a(n-3). G.f.: x*(2+2*x-3*x^2)/((1-x)^2*(1+x)). [Colin Barker, Apr 19 2012]
MATHEMATICA
a[1] = 2; a[2] = 4; a[n_] := a[n] = (a[n - 1] + a[n - 2] + If[ OddQ@ n, 0, 3])/2; Array[a, 74]
LinearRecurrence[{1, 1, -1}, {2, 4, 3}, 74] (* Robert G. Wilson v, Apr 19 2012 *)
PROG
(Magma) [ IsOdd(n) select (n+3)/2 else n/2+3 : n in [1..10] ]; // Sergei Haller (sergei(AT)sergei-haller.de), Dec 21 2006
(PARI) { for (n=1, 1000, if (n%2, a=(n + 3)/2, a=(n + 6)/2); write("b060762.txt", n, " ", a); ) } \\ Harry J. Smith, Jul 11 2009
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ahmed Fares (ahmedfares(AT)my-deja.com), Apr 23 2001
EXTENSIONS
More terms from Jonathan Vos Post, May 27 2007
STATUS
approved