OFFSET
1,2
LINKS
Robert Israel, Table of n, a(n) for n = 1..9999
Index entries for linear recurrences with constant coefficients, signature (1,0,1,-1).
FORMULA
a(n) = a(n-3) + 8, n > 3, with initial conditions a(1) = 1, a(2) = 4, a(3) = 5. - L. Edson Jeffery, May 04 2015
G.f.: x*(1+3*x)*(1+x^2)/(1-x-x^3+x^4). - Robert Israel, May 04 2015
MAPLE
seq(op([8*i+1, 8*i+4, 8*i+5]), i=0..100); # Robert Israel, May 04 2015
MATHEMATICA
a[1] := 1; a[2] := 4; a[3] := 5; a[n_] := a[n - 3] + 8; Table[a[n], {n, 10}] (* L. Edson Jeffery, May 04 2015 *)
Select[Range[0, 200], MemberQ[{1, 4, 5}, Mod[#, 8]] &] (* Vincenzo Librandi, May 07 2015 *)
LinearRecurrence[{1, 0, 1, -1}, {1, 4, 5, 9}, 60] (* Harvey P. Dale, Nov 21 2015 *)
PROG
(PARI) is(n)=n%8==1||n%8>>1==2 \\ Charles R Greathouse IV, May 04 2015
(Magma) [n : n in [0..160] | n mod 8 in [1, 4, 5]]; // Vincenzo Librandi, May 07 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved