login
A047370
Numbers that are congruent to {2, 3, 5} mod 7.
1
2, 3, 5, 9, 10, 12, 16, 17, 19, 23, 24, 26, 30, 31, 33, 37, 38, 40, 44, 45, 47, 51, 52, 54, 58, 59, 61, 65, 66, 68, 72, 73, 75, 79, 80, 82, 86, 87, 89, 93, 94, 96, 100, 101, 103, 107, 108, 110, 114, 115, 117, 121, 122, 124, 128, 129, 131, 135, 136, 138, 142
OFFSET
1,1
COMMENTS
Union of A017005, A017017 and A017041. - Michel Marcus, May 25 2014
FORMULA
G.f.: x*(2+x+2*x^2+2*x^3)/((1+x+x^2)*(x-1)^2). - R. J. Mathar, Dec 04 2011
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4, with a(1)=2, a(2)=3, a(3)=5, a(4)=9. - Harvey P. Dale, Apr 29 2013
a(n) = 7*floor((n-1)/3)+2^((n-1) mod 3)+1. - Gary Detlefs, May 25 2014
a(n) = (1/9)*(21*n+4*sqrt(3)*sin((2*Pi*n)/3)-6*cos((2*Pi*n)/3)-12). - Alexander R. Povolotsky, May 25 2014
a(3k) = 7k-2, a(3k-1) = 7k-4, a(3k-2) = 7k-5. - Wesley Ivan Hurt, Jun 10 2016
MAPLE
A047370:=n->7*floor((n-1)/3) + 2^((n-1) mod 3)+1; seq(A047370(n), n=1..50); # Wesley Ivan Hurt, May 25 2014
MATHEMATICA
Select[Range[200], MemberQ[{2, 3, 5}, Mod[#, 7]]&] (* or *) LinearRecurrence[ {1, 0, 1, -1}, {2, 3, 5, 9}, 60] (* Harvey P. Dale, Apr 29 2013 *)
Table[7*Floor[(n - 1)/3] + 2^Mod[n - 1, 3] + 1, {n, 50}] (* Wesley Ivan Hurt, May 25 2014 *)
PROG
(Magma) [7*Floor((n-1)/3)+2^((n-1) mod 3)+1: n in [1..50]]; // Wesley Ivan Hurt, May 25 2014
(PARI) x='x + O('x^50); Vec(x*(2+x+2*x^2+2*x^3)/((1+x+x^2)*(x-1)^2)) \\ G. C. Greubel, Feb 21 2017
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Dec 11 1999
EXTENSIONS
More terms from Wesley Ivan Hurt, May 25 2014
STATUS
approved