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.

A094495 Table of binomial coefficients mod m^2, read by rows: T(m, n) = binomial(m, n) mod m^2.

Original entry on oeis.org

0, 0, 0, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, 1, 5, 10, 10, 5, 1, 1, 6, 15, 20, 15, 6, 1, 1, 7, 21, 35, 35, 21, 7, 1, 1, 8, 28, 56, 6, 56, 28, 8, 1, 1, 9, 36, 3, 45, 45, 3, 36, 9, 1, 1, 10, 45, 20, 10, 52, 10, 20, 45, 10, 1, 1, 11, 55, 44, 88, 99, 99, 88, 44, 55, 11, 1, 1, 12, 66, 76, 63, 72, 60, 72, 63, 76, 66, 12, 1
Offset: 0

Views

Author

Labos Elemer, Jun 02 2004

Keywords

Comments

a(0) = 0 by convention.

Examples

			First deviation from A007318 is at a(40) = T(8,4) because binomial(8,4)=70 and 70 mod 64 = 6.
		

Crossrefs

Programs

  • Mathematica
    Flatten[Table[Table[Mod[Binomial[n, j], n^2], {j, 0, n}], {n, 1, 20}], 1]
  • PARI
    T(m,n)=binomial(m,n)%m^2 \\ Charles R Greathouse IV, Jul 29 2014
    
  • Python
    from math import comb, isqrt
    def A094495(n): return comb(r:=(m:=isqrt(k:=n+1<<1))-(k<=m*(m+1)),n-comb(r+1,2))%(r**2) if n else 0 # Chai Wah Wu, Apr 30 2025