A047610 Positive integers that are congruent to {1, 4, 5} mod 8.
1, 4, 5, 9, 12, 13, 17, 20, 21, 25, 28, 29, 33, 36, 37, 41, 44, 45, 49, 52, 53, 57, 60, 61, 65, 68, 69, 73, 76, 77, 81, 84, 85, 89, 92, 93, 97, 100, 101, 105, 108, 109, 113, 116, 117, 121, 124, 125, 129, 132, 133, 137, 140, 141, 145, 148, 149, 153, 156, 157
Offset: 1
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).
Programs
-
Magma
[n : n in [0..160] | n mod 8 in [1,4,5]]; // Vincenzo Librandi, May 07 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 *)
-
PARI
is(n)=n%8==1||n%8>>1==2 \\ Charles R Greathouse IV, May 04 2015
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