A131800 Period 4: repeat [1, 2, 5, 6].
1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6, 1, 2, 5, 6
Offset: 0
Links
- Salvatore Gambino, Terne pitagoriche primitive (in Italian).
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,1).
Programs
-
Magma
&cat [[1, 2, 5, 6]^^30]; // 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 *)
-
PARI
a(n)=[1,2,5,6][n%4+1] \\ Charles R Greathouse IV, Oct 07 2015
-
Python
def A131800(n): return (1,2,5,6)[n&3] # Chai Wah Wu, Apr 18 2023
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
Extensions
More terms from R. J. Mathar, Jan 13 2008
Comments