A010886 Period 7: repeat [1, 2, 3, 4, 5, 6, 7].
1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0,0,0,0,0,0,1).
Crossrefs
Programs
-
Magma
&cat [[1, 2, 3, 4, 5, 6, 7]^^20]; // Wesley Ivan Hurt, Jul 18 2016
-
Maple
seq(op([1, 2, 3, 4, 5, 6, 7]), n=0..20); # Wesley Ivan Hurt, Jul 18 2016
-
Mathematica
PadRight[{}, 100, {1, 2, 3, 4, 5, 6, 7}] (* Wesley Ivan Hurt, Jul 18 2016 *)
-
PARI
a(n)=n%7+1 \\ Charles R Greathouse IV, Jul 13 2016
Formula
a(n) = 1 + (n mod 7). - Paolo P. Lava, Nov 21 2006
a(n) = A010876(n) + 1. G.f.: (Sum_{k=0..6} (k+1)*x^k)/(1-x^7). Also (7*x^8-8*x^7+1)/((1-x^7)*(1-x)^2). - Hieronymus Fischer, Jun 08 2007
From Wesley Ivan Hurt, Jul 18 2016: (Start)
a(n) = a(n-7) for n>6.
a(n) = 1 - 6*floor(n/7) + Sum_{k=1..6} floor((n + k)/7). (End)
Comments