A047388 Numbers that are congruent to {0, 1, 2, 5} mod 7.
0, 1, 2, 5, 7, 8, 9, 12, 14, 15, 16, 19, 21, 22, 23, 26, 28, 29, 30, 33, 35, 36, 37, 40, 42, 43, 44, 47, 49, 50, 51, 54, 56, 57, 58, 61, 63, 64, 65, 68, 70, 71, 72, 75, 77, 78, 79, 82, 84, 85, 86, 89, 91, 92, 93, 96, 98, 99, 100, 103, 105, 106, 107, 110, 112
Offset: 1
Links
- Vincenzo Librandi, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (1,0,0,1,-1).
Programs
-
Magma
I:=[0, 1, 2, 5, 7]; [n le 5 select I[n] else Self(n-1)+Self(n-4)-Self(n-5): n in [1..70]]; // Vincenzo Librandi, May 15 2012
-
Maple
A047388:=n->(-19+I^(2*n)+(1+3*I)*(-I)^n+(1-3*I)*I^n+14*n)/8: seq(A047388(n), n=1..100); # Wesley Ivan Hurt, Jun 01 2016
-
Mathematica
Select[Range[0,300], MemberQ[{0,1,2,5}, Mod[#,7]]&] (* Vincenzo Librandi, May 15 2012 *) LinearRecurrence[{1,0,0,1,-1},{0,1,2,5,7},80] (* Harvey P. Dale, Jan 10 2023 *)
-
PARI
x='x+O('x^100); concat(0, Vec(x^2*(1+x+3*x^2+2*x^3)/((1-x)^2*(1+x)*(1+x^2)))) \\ Altug Alkan, Jun 02 2016
Formula
G.f.: x^2*(1+x+3*x^2+2*x^3)/((1-x)^2*(1+x)*(1+x^2)). - Colin Barker, May 13 2012
a(n) = (-19+(-1)^n+(1+3*i)*(-i)^n+(1-3*i)*i^n+14*n)/8 where i=sqrt(-1). - Colin Barker, May 14 2012
a(n) = a(n-1) + a(n-4) - a(n-5) for n>5. - Vincenzo Librandi, May 16 2012