A131081 Periodic sequence (8, 7, 4, 1, 0, 1, 4, 7).
8, 7, 4, 1, 0, 1, 4, 7, 8, 7, 4, 1, 0, 1, 4, 7, 8, 7, 4, 1, 0, 1, 4, 7, 8, 7, 4, 1, 0, 1, 4, 7, 8, 7, 4, 1, 0, 1, 4, 7, 8, 7, 4, 1, 0, 1, 4, 7, 8, 7, 4, 1, 0, 1, 4, 7, 8, 7, 4, 1, 0, 1, 4, 7, 8, 7, 4, 1, 0, 1, 4, 7, 8, 7, 4, 1, 0, 1, 4, 7, 8, 7, 4, 1, 0, 1, 4, 7, 8, 7, 4, 1, 0, 1, 4, 7, 8, 7, 4, 1, 0, 1, 4, 7, 8
Offset: 1
Links
- Index entries for linear recurrences with constant coefficients, signature (1,0,0,-1,1).
Programs
-
Magma
m:=105; [ [8, 7, 4, 1, 0, 1, 4, 7][(n-1) mod 8 + 1]: n in [1..m] ];
-
Mathematica
PadRight[{},120,{8,7,4,1,0,1,4,7}] (* Harvey P. Dale, May 20 2012 *)
-
PARI
{m=105; for(n=1, m, r=(n-1)%8; print1(if(r==0, 8, if(r==1||r==7, 7, if(r==2||r==6, 4, if(r==4, 0, 1)))), ","))}
Formula
a(1) = 8, a(2) = a(8) = 7, a(3) = a(7) = 4, a(4) = a(6) = 1, a(5) = 0; for n > 8, a(n) = a(n-8).
G.f.: (8-x-3*x^2-3*x^3+7*x^4)/((1-x)*(1+x^4)).
Comments