OFFSET
0,1
LINKS
Harry J. Smith, Table of n, a(n) for n = 0..20003
Index entries for linear recurrences with constant coefficients, signature (2,-2,2,-1).
FORMULA
G.f.: (3-4*x+3*x^2)/((1+x^2)*(1-x)^2).
a(4n) = 4n+3, a(4n+1) = 4n+2, a(4n+2) = 4n+1, a(4n+3) = 4n+4.
a(n) = n+1+i^n+(-i)^n, where i is the imaginary unit. - Bruno Berselli, Feb 08 2011
From Wesley Ivan Hurt, May 09 2021: (Start)
a(n) = 2*a(n-1)-2*a(n-2)+2*a(n-3)-a(n-4).
a(n) = 1 + n + 2*cos(n*Pi/2). (End)
Sum_{n>=0} (-1)^n/a(n) = log(2) (A002162). - Amiram Eldar, Nov 28 2023
MATHEMATICA
Flatten[Partition[Range[80], 4]/.{a_, b_, c_, d_}->{c, b, a, d}] (* Harvey P. Dale, Aug 12 2012 *)
PROG
(PARI) { f="b092486.txt"; for (n=0, 5000, a0=4*n + 3; a1=a0 - 1; a2=a1 - 1; a3=a0 + 1; write(f, 4*n, " ", a0); write(f, 4*n+1, " ", a1); write(f, 4*n+2, " ", a2); write(f, 4*n+3, " ", a3); ); } \\ Harry J. Smith, Jun 21 2009
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Ralf Stephan, Apr 04 2004
STATUS
approved