OFFSET
0,2
COMMENTS
Decimal expansion of 1256/9999. - Klaus Brockhaus, May 20 2010
LINKS
Salvatore Gambino, Terne pitagoriche primitive (in Italian).
Index entries for linear recurrences with constant coefficients, signature (0,0,0,1).
FORMULA
a(n) = (7 + (-1)^n + 4*(-1)^(2*n + 1 - (-1)^n)/4)/2.
G.f.: (1 + 2*x + 5*x^2 + 6*x^3)/((1-x)*(x+1)*(x^2+1)). - R. J. Mathar, Jan 13 2008
a(n) = A000111(n+2) mod 10.
a(n) = 7/2 - 2*cos(Pi*n/2) - 2*sin(Pi*n/2) - (-1)^n/2. - R. J. Mathar, Oct 08 2011
a(n) = a(n-4) for n>3. - Wesley Ivan Hurt, Jul 10 2016
MAPLE
seq(op([1, 2, 5, 6]), n=0..50); # Wesley Ivan Hurt, Jul 10 2016
MATHEMATICA
PadRight[{}, 100, {1, 2, 5, 6}] (* Wesley Ivan Hurt, Jul 10 2016 *)
PROG
(PARI) a(n)=[1, 2, 5, 6][n%4+1] \\ Charles R Greathouse IV, Oct 07 2015
(Magma) &cat [[1, 2, 5, 6]^^30]; // Wesley Ivan Hurt, Jul 10 2016
(Python)
def A131800(n): return (1, 2, 5, 6)[n&3] # Chai Wah Wu, Apr 18 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Salvatore Gambino (salvatore.gambino(AT)fastwebnet.it), Oct 04 2007
EXTENSIONS
More terms from R. J. Mathar, Jan 13 2008
STATUS
approved