login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A268291 a(n) = Sum_{k = 0..n} (k mod 13). 1

%I

%S 0,1,3,6,10,15,21,28,36,45,55,66,78,78,79,81,84,88,93,99,106,114,123,

%T 133,144,156,156,157,159,162,166,171,177,184,192,201,211,222,234,234,

%U 235,237,240,244,249,255,262,270,279,289,300,312,312,313,315,318,322,327,333,340,348

%N a(n) = Sum_{k = 0..n} (k mod 13).

%C More generally, the ordinary generating function for the Sum_{k = 0..n} (k mod m) is (Sum_{k = 1..(m - 1)} k*x^k)/((1 - x^m)*(1 - x)).

%C Sum_{k = 0..n} (k mod m) = m*(m - 1)/2 + Sum_{k = 1..(m - 1)} k*floor((n - k)/m), m>0.

%H Ilya Gutkovskiy, <a href="/A268291/a268291.pdf">Extended example</a>

%H <a href="/index/Rec#order_14">Index entries for linear recurrences with constant coefficients</a>, signature (1,0,0,0,0,0,0,0,0,0,0,0,1,-1).

%F G.f.: (x + 2*x^2 + 3*x^3 + 4*x^4 + 5*x^5 + 6*x^6 + 7*x^7 + 8*x^8 + 9*x^9 + 10*x^10 + 11*x^11 + 12*x^12)/((1 - x^13)*(1 - x)).

%F a(n) = 12*floor((n - 12)/13) + 11*floor((n - 11)/13) + 10*floor((n - 10)/13) + 9*floor((n - 9)/13) + 8*floor((n - 8)/13) + 7*floor((n - 7)/13) + 6*floor((n - 6)/13) + 5*floor((n - 5)/13) + 4*floor((n - 4)/13) + 3*floor((n - 3)/13) + 2*floor((n - 2)/13) + floor((n - 1)/13) + 78.

%e (see Extended example in Links section)

%e a(0) = 0;

%e a(1) = 0+1 = 1;

%e a(2) = 0+1+2 = 3;

%e a(3) = 0+1+2+3 = 6;

%e a(4) = 0+1+2+3+4 = 10;

%e a(5) = 0+1+2+3+4+5 = 15;

%e ...

%e a(11) = 0+1+2+3+4+5+6+7+8+9+10+11 = 66;

%e a(12) = 0+1+2+3+4+5+6+7+8+9+10+11+12 = 78;

%e a(13) = 0+1+2+3+4+5+6+7+8+9+10+11+12+0 = 78;

%e a(14) = 0+1+2+3+4+5+6+7+8+9+10+11+12+0+1 = 79;

%e a(15) = 0+1+2+3+4+5+6+7+8+9+10+11+12+0+1+2 = 81, etc.

%t Table[Sum[Mod[k, 13], {k, 0, n}], {n, 0, 60}]

%t Table[Sum[k - 13 Floor[k/13], {k, 0, n}], {n, 0, 60}]

%t LinearRecurrence[{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -1}, {0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 78}, 61]

%t CoefficientList[Series[(x + 2 x^2 + 3 x^3 + 4 x^4 + 5 x^5 + 6 x^6 + 7 x^7 + 8 x^8 + 9 x^9 + 10 x^10 + 11 x^11 + 12 x^12) / ((1 - x^13) (1 - x)), {x, 0, 70}], x] (* _Vincenzo Librandi_, Jan 31 2016 *)

%o (PARI) a(n) = sum(k = 0, n, k % 13); \\ _Michel Marcus_, Jan 31 2016

%Y Cf. A004526, A130481-A130490.

%K nonn,easy

%O 0,3

%A _Ilya Gutkovskiy_, Jan 31 2016

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified February 22 13:09 EST 2018. Contains 299454 sequences. (Running on oeis4.)