A047313 Numbers that are congruent to {1, 4, 5, 6} mod 7.
1, 4, 5, 6, 8, 11, 12, 13, 15, 18, 19, 20, 22, 25, 26, 27, 29, 32, 33, 34, 36, 39, 40, 41, 43, 46, 47, 48, 50, 53, 54, 55, 57, 60, 61, 62, 64, 67, 68, 69, 71, 74, 75, 76, 78, 81, 82, 83, 85, 88, 89, 90, 92, 95, 96, 97, 99, 102, 103, 104, 106, 109, 110, 111
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
[n : n in [0..150] | n mod 7 in [1, 4, 5, 6]]; // Wesley Ivan Hurt, May 23 2016
-
Maple
A047313:= n-> iquo(n-1, 4, 'r')*7 +[1, 4, 5, 6][r+1]: seq(A047313(n), n=1..80); # Alois P. Heinz, Dec 04 2011
-
Mathematica
Select[Range[100],MemberQ[{1,4,5,6},Mod[#,7]]&] (* Harvey P. Dale, Apr 17 2011 *) LinearRecurrence[{1, 0, 0, 1, -1}, {1, 4, 5, 6, 8}, 80] (* Jean-François Alcover, Feb 18 2016 *)
Formula
G.f.: x*(1+3*x+x^2+x^3+x^4) / ( (1+x)*(1+x^2)*(x-1)^2 ). - R. J. Mathar, Dec 03 2011
From Wesley Ivan Hurt, May 23 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n>5.
a(n) = (14n-3+i^(2n)-(3+i)*i^(-n)-(3-i)*i^n)/8 where i=sqrt(-1).
E.g.f.: (4 - sin(x) - 3*cos(x) + (7*x - 2)*sinh(x) + (7*x - 1)*cosh(x))/4. - Ilya Gutkovskiy, May 24 2016