login
A047360
Numbers that are congruent to {1, 2, 3} mod 7.
1
1, 2, 3, 8, 9, 10, 15, 16, 17, 22, 23, 24, 29, 30, 31, 36, 37, 38, 43, 44, 45, 50, 51, 52, 57, 58, 59, 64, 65, 66, 71, 72, 73, 78, 79, 80, 85, 86, 87, 92, 93, 94, 99, 100, 101, 106, 107, 108, 113, 114, 115, 120, 121, 122, 127, 128, 129, 134, 135, 136, 141
OFFSET
1,2
FORMULA
a(n) = 7*floor(n/3)+(n mod 3)+1, with offset 0. - Gary Detlefs, Mar 09 2010
G.f.: x*(1+x+x^2+4*x^3)/((1+x+x^2)*(x-1)^2). - R. J. Mathar, Oct 08 2011
a(n) = 4*floor((n-1)/3)+n. - Gary Detlefs, Dec 22 2011
From Wesley Ivan Hurt, Jun 10 2016: (Start)
a(n) = a(n-1) + a(n-3) - a(n-4) for n>4.
a(n) = (21*n-24-12*cos(2*n*Pi/3)+4*sqrt(3)*sin(2*n*Pi/3))/9.
a(3k) = 7k-4, a(3k-1) = 7k-5, a(3k-2) = 7k-6. (End)
MAPLE
seq(7*floor(n/3)+(n mod 3)+1, n=0..52); # Gary Detlefs, Mar 09 2010
MATHEMATICA
Select[Range[0, 200], Mod[#, 7] == 1 || Mod[#, 7] == 2 || Mod[#, 7] == 3 &] (* Vladimir Joseph Stephan Orlovsky, Jul 10 2011 *)
{1, 2, 3}+#&/@(7*Range[0, 20])//Flatten (* or *) LinearRecurrence[{1, 0, 1, -1}, {1, 2, 3, 8}, 90] (* Harvey P. Dale, Jul 23 2024 *)
PROG
(Magma) [n : n in [0..150] | n mod 7 in [1..3]]; // Wesley Ivan Hurt, Jun 10 2016
CROSSREFS
Sequence in context: A169868 A363088 A191159 * A004825 A272830 A028821
KEYWORD
nonn,easy
STATUS
approved