A226276 Period 4: repeat [8, 4, 4, 4].
8, 4, 4, 4, 8, 4, 4, 4, 8, 4, 4, 4, 8, 4, 4, 4, 8, 4, 4, 4, 8, 4, 4, 4, 8, 4, 4, 4, 8, 4, 4, 4, 8, 4, 4, 4, 8, 4, 4, 4, 8, 4, 4, 4, 8, 4, 4, 4, 8, 4, 4, 4, 8, 4, 4, 4, 8, 4, 4, 4, 8, 4, 4, 4, 8, 4, 4, 4, 8, 4, 4, 4, 8, 4, 4, 4, 8, 4, 4, 4, 8, 4, 4, 4
Offset: 0
Examples
s(1) = 9, s(2) = 13, s(3) = 17, s(4) = 21, s(5) = 29, s(6) = 33, s(7) = 37. s(-1) = -3, s(-2) = -7, s(-3) = -11, s(-4) = -19, s(-5) = -23, s(-6) = -27, s(-7) = -31.
Links
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,1).
Programs
-
Magma
&cat [[8, 4, 4, 4]^^30]; // Wesley Ivan Hurt, Jul 09 2016
-
Maple
seq(op([8, 4, 4, 4]), n=0..40); # Wesley Ivan Hurt, Jul 09 2016
-
Mathematica
Flatten[Table[{8, 4, 4, 4}, {20}]] (* Bruno Berselli, Jun 20 2013 *) PadRight[{},120,{8,4,4,4}] (* Harvey P. Dale, May 11 2025 *)
-
PARI
a(n)=if(n%4,4,8) \\ Charles R Greathouse IV, Jul 17 2016
Formula
For generating the summation sequence s, start with s(0) = 1, and a(0) = 8.
For positive values of s(n): s(n+1) = s(n) + a(n).
For negative values of s(n): s(n-1) = s(n) - a(n-1). Here, n is negative.
All values of a(n) are positive regardless of index. For example: a(-1) = a(-2) = a(-3) = 4; a(-4) = 8. Thus the simple pattern of a(n) and the simple arithmetic for generating s(n), are maintained across the n=0 boundary, in a manner similar to extending Fibonacci numbers to negative indices.
From Bruno Berselli, Jun 20 2013: (Start)
G.f.: 4*(2+x+x^2+x^3)/((1-x)*(1+x)*(1+x^2)).
a(n) = 4 + (1 + (-1)^n)*(1 + I^(n*(n+1))). (End)
From Wesley Ivan Hurt, Jul 09 2016: (Start)
a(n) = a(n-4) for n>3.
a(n) = 5 + I^(2*n) + I^(-n) + I^n.
a(n) = 5 + cos(n*Pi) + 2*cos(n*Pi/2) + I*sin(n*Pi). (End)
Extensions
Simpler name from Joerg Arndt, Jun 16 2013
Comments