OFFSET
1,1
LINKS
Index entries for linear recurrences with constant coefficients, signature (1,0,0,-1,1).
FORMULA
a(1) = a(2) = a(3) = a(4) = 1, a(5) = a(6) = a(7) = a(8) = 0; for n > 8, a(n) = a(n-8).
G.f.: x/((1-x)*(1+x^4)).
a(n) = floor(((n+4) mod 8)/4). [Gary Detlefs, May 17 2011]
From Wesley Ivan Hurt, May 30 2015: (Start)
a(n) = a(n-1)-a(n-4)+a(n-5), n>5.
a(n) = (1+(-1)^((2*n+11-(-1)^n+2*(-1)^((2*n+5-(-1)^n)/4))/8))/2. (End)
From Ridouane Oudra, Nov 17 2019: (Start)
a(n) = binomial(n+3,4) mod 2
a(n) = floor((n+3)/4) - 2*floor((n+3)/8). (End)
PROG
(PARI) {m=105; for(n=1, m, print1((n-1)%8<4, ", "))}
(Magma) m:=105; [ [1, 1, 1, 1, 0, 0, 0, 0][ (n-1) mod 8 + 1 ]: n in [1..m] ];
(Magma) &cat[[1, 1, 1, 1, 0, 0, 0, 0]: n in [0..10]];
/* or */ [Floor((1+(-1)^((2*n+11-(-1)^n+2*(-1)^((2*n+5-(-1)^n)/4))/8))/2): n in [1..60]]; // Vincenzo Librandi, May 31 2015
(Python)
def A131078(n): return int(not n-1&4) # Chai Wah Wu, Jan 31 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Klaus Brockhaus, following a suggestion of Paul Curtz, Jun 14 2007
STATUS
approved