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-5 of 5 results.

A053200 Binomial coefficients C(n,k) reduced modulo n, read by rows; T(0,0)=0 by convention.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 2, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 3, 2, 3, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 4, 0, 6, 0, 4, 0, 1, 1, 0, 0, 3, 0, 0, 3, 0, 0, 1, 1, 0, 5, 0, 0, 2, 0, 0, 5, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 6, 4, 3, 0, 0, 0, 3, 4, 6, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1
Offset: 0

Views

Author

Asher Auel, Dec 12 1999

Keywords

Comments

Pascal's triangle read by rows, where row n is read mod n.
A number n is a prime if and only if (1+x)^n == 1+x^n (mod n), i.e., if and only if the n-th row is 1,0,0,...,0,1. This result underlies the proof of Agrawal, Kayal and Saxena that there is a polynomial-time algorithm for primality testing. - N. J. A. Sloane, Feb 20 2004
A020475(n) = number of zeros in n-th row, for n > 0. - Reinhard Zumkeller, Jan 01 2013

Examples

			Row 4 = 1 mod 4, 4 mod 4, 6 mod 4, 4 mod 4, 1 mod 4 = 1, 0, 2, 0, 1.
Triangle begins:
  0;
  0,0;
  1,0,1;
  1,0,0,1;
  1,0,2,0,1;
  1,0,0,0,0,1;
  1,0,3,2,3,0,1;
  1,0,0,0,0,0,0,1;
  1,0,4,0,6,0,4,0,1;
  1,0,0,3,0,0,3,0,0,1;
  1,0,5,0,0,2,0,0,5,0,1;
  1,0,0,0,0,0,0,0,0,0,0,1;
  1,0,6,4,3,0,0,0,3,4,6,0,1;
  1,0,0,0,0,0,0,0,0,0,0,0,0,1;
		

Crossrefs

Row sums give A053204. Cf. A053201, A053202, A053203, A007318 (Pascal's triangle).
Cf. also A092241.
Cf. A053214 (central terms, apart from initial 1).

Programs

  • Haskell
    a053200 n k = a053200_tabl !! n !! k
    a053200_row n = a053200_tabl !! n
    a053200_tabl = [0] : zipWith (map . flip mod) [1..] (tail a007318_tabl)
    -- Reinhard Zumkeller, Jul 10 2015, Jan 01 2013
    
  • Maple
    f := n -> seriestolist( series( expand( (1+x)^n ) mod n, x, n+1)); # N. J. A. Sloane
  • Mathematica
    Flatten[Join[{0},Table[Mod[Binomial[n,Range[0,n]],n],{n,20}]]] (* Harvey P. Dale, Apr 29 2013 *)
  • PARI
    T(n,k)=if(n, binomial(n,k)%n, 0) \\ Charles R Greathouse IV, Feb 07 2017

Extensions

Corrected by T. D. Noe, Feb 08 2008
Edited by N. J. A. Sloane, Aug 29 2008 at the suggestion of R. J. Mathar

A059288 a(n) = binomial(2*n,n) mod n.

Original entry on oeis.org

0, 0, 2, 2, 2, 0, 2, 6, 2, 6, 2, 4, 2, 6, 0, 6, 2, 6, 2, 0, 6, 6, 2, 12, 2, 6, 20, 0, 2, 4, 2, 6, 9, 6, 7, 16, 2, 6, 20, 20, 2, 0, 2, 4, 0, 6, 2, 12, 2, 6, 3, 44, 2, 6, 32, 32, 39, 6, 2, 36, 2, 6, 12, 6, 5, 0, 2, 36, 66, 40, 2, 36, 2, 6, 45, 32, 0, 66, 2, 20, 20, 6, 2
Offset: 1

Views

Author

N. J. A. Sloane, Jan 25 2001

Keywords

Crossrefs

Programs

  • Maple
    binomial(2*n,n) mod n;
    seq(irem(binomial(2*n,n),n),n=1..83); # Zerinvary Lajos, Apr 20 2008
  • Mathematica
    Table[Mod[Binomial[2*n, n], n], {n, 1, 25}] (* G. C. Greubel, Jan 04 2017 *)
  • PARI
    a(n) = binomial(2*n, n) % n; \\ Harry J. Smith, Jun 25 2009

Formula

a(n) = Catalan(n) mod n. - Jonathan Sondow, Dec 13 2013
a(p) = 2, p an odd prime (provable using Wolstenholme's theorem). - David Trimas, Feb 11 2025

A053201 Pascal's triangle (excluding first, last element of each row) read by rows, row n read mod n.

Original entry on oeis.org

0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 3, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 6, 0, 4, 0, 0, 0, 3, 0, 0, 3, 0, 0, 0, 5, 0, 0, 2, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 4, 3, 0, 0, 0, 3, 4, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 7, 0, 7, 2, 7, 0, 7, 0, 7, 0, 0, 0, 5, 0, 3, 10, 0, 0, 10, 3, 0, 5, 0
Offset: 2

Views

Author

Asher Auel, Dec 12 1999

Keywords

Comments

Prime numbered rows contain all zeros.

Examples

			0; 0,0; 0,2,0; 0,0,0,0; 0,3,2,3,0; ...
row 6 = 6 mod 6, 15 mod 6, 20 mod 6, 15 mod 6, 6 mod 6 = 0, 3, 2, 3, 0
		

Crossrefs

Row sums give A053205. Cf. A053200, A053202, A053203, A007318 (Pascal's triangle)
Cf. A053214 (central terms).

Programs

  • Haskell
    a053201 n k = a053201_tabl !! (n-2) !! (k-1)
    a053201_row n = a053201_tabl !! (n-2)
    a053201_tabl = zipWith (map . (flip mod)) [2..] a014410_tabl
    -- Reinhard Zumkeller, Aug 17 2013
  • Mathematica
    row[n_] := Table[ Mod[ Binomial[n, k], n], {k, 1, n-1}]; Table[row[n], {n, 2, 15}] // Flatten (* Jean-François Alcover, Aug 12 2013 *)

Formula

T(n,k) = A014410(n,k) mod n, k=1..n-1.

Extensions

a(62) and a(68) corrected by T. D. Noe, Feb 08 2008

A059289 a(n) = 1 + (binomial(2n,n) mod n).

Original entry on oeis.org

1, 1, 3, 3, 3, 1, 3, 7, 3, 7, 3, 5, 3, 7, 1, 7, 3, 7, 3, 1, 7, 7, 3, 13, 3, 7, 21, 1, 3, 5, 3, 7, 10, 7, 8, 17, 3, 7, 21, 21, 3, 1, 3, 5, 1, 7, 3, 13, 3, 7, 4, 45, 3, 7, 33, 33, 40, 7, 3, 37, 3, 7, 13, 7, 6, 1, 3, 37, 67, 41, 3, 37, 3, 7, 46, 33, 1, 67, 3, 21, 21, 7, 3
Offset: 1

Views

Author

N. J. A. Sloane, Jan 25 2001

Keywords

Crossrefs

Programs

  • Maple
    [seq((binomial(2*n,n) mod (n))+1,n=1..50)];
  • Mathematica
    1 + Table[Mod[Binomial[2*n, n], n], {n,1,25}] (* G. C. Greubel, Jan 04 2017 *)
  • PARI
    { for (n = 1, 5000, write("b059289.txt", n, " ", 1 + binomial(2*n, n) % n); ) } \\ Harry J. Smith, Jun 25 2009

A256277 C(2*n,n) mod 2*n+1.

Original entry on oeis.org

2, 1, 6, 7, 10, 1, 12, 1, 18, 19, 22, 6, 11, 1, 30, 9, 15, 1, 15, 1, 42, 15, 46, 29, 36, 1, 27, 55, 58, 1, 14, 19, 66, 21, 70, 1, 32, 35, 78, 43, 82, 40, 60, 1, 7, 60, 70, 1, 18, 1, 102, 96, 106, 1, 39, 1, 17, 96, 3, 111, 84, 31, 126, 84, 130, 37, 30, 1
Offset: 1

Views

Author

Robert Israel, Jun 12 2015

Keywords

Comments

a(n) == (-1)^n (mod 2*n+1) if 2*n+1 is prime or is in A163209.
a(n) = 0 for n in A073076.

Crossrefs

Programs

  • Magma
    [Binomial(2*n, n) mod (2*n+1): n in [1..70]]; // Vincenzo Librandi, May 03 2016
  • Maple
    seq(binomial(2*n,n) mod (2*n+1), n=1..100); # Robert Israel, Jun 12 2015
  • Mathematica
    Table[Mod[Binomial[2 n, n], 2 n + 1], {n, 200}] (* Vincenzo Librandi, May 03 2016 *)
Showing 1-5 of 5 results.