cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-2 of 2 results.

A010881 Simple periodic sequence: n mod 12.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
Offset: 0

Views

Author

Keywords

Comments

The value of the rightmost digit in the base-12 representation of n. - Hieronymus Fischer, Jun 11 2007

Examples

			a(27) = 3 since 27 = 12*2+3.
		

Crossrefs

Partial sums: A130490. Other related sequences A130481, A130482, A130483, A130484, A130485, A130486, A130487, A130488, A130489.

Programs

Formula

From Hieronymus Fischer, May 31 2007: (Start)
a(n) = n mod 12.
Complex representation: a(n) = (1/12)*(1-r^n)*Sum_{k=1..11} k*Product_{m=1..11, m<>k} (1-r^(n-m)) where r = exp(Pi/6*i) = (sqrt(3)+i)/2 and i = sqrt(-1).
Trigonometric representation: a(n) = (512/3)^2*(sin(n*Pi/12))^2*Sum_{k=1..11} k*Product_{m=1..11, m<>k} (sin((n-m)*Pi/12))^2.
G.f.: (Sum_{k=1..11} k*x^k)/(1-x^12).
G.f.: x*(11*x^12-12*x^11+1)/((1-x^12)*(1-x)^2). (End)
From Hieronymus Fischer, Jun 11 2007: (Start)
a(n) = (n mod 2)+2*(floor(n/2) mod 6) = A000035(n)+2*A010875(A004526(n)).
a(n) = (n mod 3)+3*(floor(n/3) mod 4) = A010872(n)+3*A010873(A002264(n)).
a(n) = (n mod 4)+4*(floor(n/4) mod 3) = A010873(n)+4*A010872(A002265(n)).
a(n) = (n mod 6)+6*(floor(n/6) mod 2) = A010875(n)+6*A000035(A152467(n)).
a(n) = (n mod 2)+2*(floor(n/2) mod 2)+4*(floor(n/4) mod 3) = A000035(n)+2*A000035(A004526(n))+4*A010872(A002265(n)). (End)
a(A001248(k) + 17) = 6 for k>2. - Reinhard Zumkeller, May 12 2010
a(n) = A034326(n+1)-1. - M. F. Hasler, Sep 25 2014

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

Original entry on oeis.org

0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 78, 79, 81, 84, 88, 93, 99, 106, 114, 123, 133, 144, 156, 156, 157, 159, 162, 166, 171, 177, 184, 192, 201, 211, 222, 234, 234, 235, 237, 240, 244, 249, 255, 262, 270, 279, 289, 300, 312, 312, 313, 315, 318, 322, 327, 333, 340, 348
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 31 2016

Keywords

Comments

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)).
Sum_{k = 0..n} (k mod m) = m*(m - 1)/2 + Sum_{k = 1..(m - 1)} k*floor((n - k)/m), m>0.

Examples

			(see Extended example in Links section)
a(0)  = 0;
a(1)  = 0+1 = 1;
a(2)  = 0+1+2 = 3;
a(3)  = 0+1+2+3 = 6;
a(4)  = 0+1+2+3+4 = 10;
a(5)  = 0+1+2+3+4+5 = 15;
...
a(11) = 0+1+2+3+4+5+6+7+8+9+10+11 = 66;
a(12) = 0+1+2+3+4+5+6+7+8+9+10+11+12 = 78;
a(13) = 0+1+2+3+4+5+6+7+8+9+10+11+12+0 = 78;
a(14) = 0+1+2+3+4+5+6+7+8+9+10+11+12+0+1 = 79;
a(15) = 0+1+2+3+4+5+6+7+8+9+10+11+12+0+1+2 = 81, etc.
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[Mod[k, 13], {k, 0, n}], {n, 0, 60}]
    Table[Sum[k - 13 Floor[k/13], {k, 0, n}], {n, 0, 60}]
    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]
    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 *)
    Accumulate[Mod[Range[0,60],13]] (* Harvey P. Dale, May 10 2021 *)
  • PARI
    a(n) = sum(k = 0, n, k % 13); \\ Michel Marcus, Jan 31 2016

Formula

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)).
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.
a(n) = 6*n + r*(r-11)/2 where r = (n mod 13). - Hoang Xuan Thanh, Jun 02 2025
Showing 1-2 of 2 results.