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-10 of 12 results. Next

A053204 Row sums of A053200.

Original entry on oeis.org

0, 0, 2, 2, 4, 2, 10, 2, 16, 8, 14, 2, 28, 2, 46, 38, 64, 2, 46, 2, 76, 50, 70, 2, 136, 32, 82, 80, 156, 2, 244, 2, 256, 74, 38, 88, 172, 2, 118, 86, 256, 2, 442, 2, 324, 332, 326, 2, 592, 128, 274, 416, 432, 2, 676, 98, 648, 122, 410, 2, 796, 2, 934, 386, 960, 292, 526
Offset: 0

Views

Author

Asher Auel, Dec 12 1999

Keywords

Comments

a(prime(n)) = 2, where prime(n) = prime numbers A000040, excluding the case where a(1) = 2.

Examples

			a(6) = 1 + 0 + 3 + 2 + 3 + 0 + 1 = 10.
		

Crossrefs

Cf. A053200.

Programs

Extensions

Corrected and extended by James Sellers, Dec 13 1999
Initial terms adjusted by Reinhard Zumkeller, Jan 01 2013

A020475 a(n) is the number of k for which binomial(n,k) is divisible by n.

Original entry on oeis.org

0, 2, 1, 2, 2, 4, 2, 6, 4, 6, 6, 10, 5, 12, 6, 8, 8, 16, 10, 18, 10, 14, 14, 22, 10, 20, 18, 18, 14, 28, 11, 30, 16, 26, 30, 26, 22, 36, 30, 30, 22, 40, 20, 42, 26, 26, 30, 46, 20, 42, 34, 32, 34, 52, 26, 46, 33, 50, 42, 58, 26, 60, 30, 46, 32, 50, 48, 66, 58, 50, 44, 70, 40, 72, 66, 46, 58
Offset: 0

Views

Author

Keywords

Comments

Note that n is prime iff a(n) = n-1. - T. D. Noe, Feb 23 2006
a(n) >= phi(n) (cf. Robbins). - Michel Marcus, Oct 31 2012
For n > 0: number of zeros in n-th row of A053200. - Reinhard Zumkeller, Jan 01 2013
binomial(n, k) / binomial(n, k-1) = k / (n - k + 1) which eases computation. - David A. Corneth, May 04 2025

Examples

			From _David A. Corneth_, May 04 2025: (Start)
a(6) = 2 as binomial(6, k) = 1, 6, 15, 20, 15, 6, 1 for k = 0 through 6 respectively. Among these, a(6) = 2 numbers are divisible by 6.
a(12) = 5. We start at 1 and know that 12 = 2^2 * 3^1 and so the valuation of 2 and 3 are 2 and 1 respectively.
We compute binomial(n, k) / binomial(n, k-1) = k / (n - k + 1) for k = 1 through floor((n-1)/2) = 3 and keep track the valuation of 2 and 3 of binomial(n, k) via this telescoping product.
We get (2, 1), (1, 1), (2, 0), (0, 2), (3, 2). Of them (2, 1) and (3, 2) indicate divisibility by 12 so that's two numbers and four via symmetry. For binomial(12, 6) we get (2, 1) which as symmetry doesn't give two solutions only counts towards one value of k. This gives a total 4+1 = 5 for a(12). (End)
		

Crossrefs

Cf. A007012.

Programs

  • Haskell
    a020475 n = a020475_list !! n
    a020475_list = 0 : map (sum . map (0 ^)) (tail a053200_tabl)
    -- Reinhard Zumkeller, Jan 24 2014
    
  • Mathematica
    Table[cnt=0; Do[If[Mod[Binomial[n,k],n]==0, cnt++ ], {k,0,n}]; cnt,{n,0,100}] (* T. D. Noe, Feb 23 2006 *)
    Join[{0},Table[Count[Table[Binomial[n,k],{k,0,n}],?(Mod[#,n]==0&)],{n,100}]] (* _Harvey P. Dale, Sep 20 2024 *)
  • PARI
    apply( A020475(n)=sum(k=0,n, binomial(n,k)%n==0), [1..30]) \\ M. F. Hasler, May 04 2025
    
  • PARI
    \\ See Corneth link

Formula

a(n) = n + 1 - A007012(n). - T. D. Noe, Feb 23 2006

Extensions

More terms from T. D. Noe, Feb 23 2006

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

A053214 Central binomial coefficients (A000984) read mod 2n, with a(0)=1.

Original entry on oeis.org

1, 0, 2, 2, 6, 2, 0, 2, 6, 2, 16, 2, 4, 2, 20, 0, 6, 2, 24, 2, 20, 6, 28, 2, 12, 2, 32, 20, 0, 2, 4, 2, 6, 42, 40, 42, 52, 2, 44, 20, 20, 2, 0, 2, 48, 0, 52, 2, 60, 2, 56, 54, 96, 2, 60, 32, 88, 96, 64, 2, 96, 2, 68, 12, 70, 70, 0, 2, 36, 66, 40, 2, 36, 2, 80, 120, 32, 0, 144, 2, 20, 20, 88
Offset: 0

Views

Author

Asher Auel, Dec 16 1999

Keywords

Crossrefs

Programs

  • Haskell
    a053214 0 = 1
    a053214 n = a053200 (2 * n) n  -- Reinhard Zumkeller, Jan 24 2014
    
  • Mathematica
    Join[{1}, Table[Mod[Binomial[2*n, n], 2*n], {n, 1, 100}]] (* G. C. Greubel, Sep 04 2018 *)
  • PARI
    concat([1], vector(100, n, lift(Mod(binomial(2*n,n), 2*n)))) \\ G. C. Greubel, Sep 04 2018

Formula

a(n) = binomial(2*n, n) mod 2*n, with a(0)=1.
a(n) = A053200(2*n,n) for n > 0. - Reinhard Zumkeller, Jan 01 2013

Extensions

More terms from James Sellers, Dec 18 1999

A053202 Pascal's triangle (excluding first, last two elements of each row) read by rows, row n read mod n.

Original entry on oeis.org

2, 0, 0, 3, 2, 3, 0, 0, 0, 0, 4, 0, 6, 0, 4, 0, 3, 0, 0, 3, 0, 5, 0, 0, 2, 0, 0, 5, 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, 7, 0, 7, 0, 7, 2, 7, 0, 7, 0, 7, 0, 5, 0, 3, 10, 0, 0, 10, 3, 0, 5, 0, 8, 0, 12, 0, 8, 0, 6, 0, 8, 0, 12, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 4

Views

Author

Asher Auel, Dec 12 1999

Keywords

Comments

Prime numbered rows contain all zeros.

Examples

			Triangle begins:
  2;
  0, 0;
  3, 2, 3;
  0, 0, 0, 0;
  4, 0, 6, 0, 4;
  ...
row 8 = 28 mod 8, 56 mod 8, 70 mod 8, 56 mod 8, 28 mod 8 = 4, 0, 6, 0, 4.
		

Crossrefs

Sum of row n = A053205(n). Cf. A053200, A053201, A053203, A007318 (Pascal's triangle).

Programs

  • Haskell
    a053202 n k = a053202_tabl !! (n - 4) !! k
    a053202_row n = a053202_tabl !! (n - 4)
    a053202_tabl = zipWith (\k row -> take (k - 3) $ drop 2 row)
                           [4..] $ drop 4 a053200_tabl
    -- Reinhard Zumkeller, Jan 24 2014
  • Mathematica
    Table[Mod[Binomial[n, k], n], {n, 4, 18}, {k, 2, n-2}] // Flatten (* Jean-François Alcover, Jun 06 2017 *)

Extensions

a(44) corrected by T. D. Noe, Feb 08 2008

A053203 Pascal's triangle (excluding first, last three elements of each row) read by rows, row n read mod n.

Original entry on oeis.org

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

Views

Author

Asher Auel, Dec 12 1999

Keywords

Comments

Prime numbered rows contain all zeros.

Examples

			Triangle begins:
  2;
  0,0;
  0,6,0;
  3,0,0,3;
  0,0,2,0,0;
  ...
row 9 = 84 mod 9, 126 mod 9, 126 mod 9, 84 mod 9, = 3, 0, 0, 3.
		

Crossrefs

Row sums give A053206.
Cf. A053200, A053201, A053203, A007318 (Pascal's triangle).

Programs

  • Haskell
    a053203 n k = a053203_tabl !! (n - 6) !! k
    a053203_row n = a053203_tabl !! (n - 6)
    a053203_tabl = zipWith (\k row -> take (k - 5) $ drop 3 row)
                           [6..] $ drop 6 a053200_tabl
    -- Reinhard Zumkeller, Jan 24 2014
  • Mathematica
    Table[Mod[Binomial[n, k], n], {n, 6, 20}, {k, 3, n-3}] // Flatten (* Jean-François Alcover, Jan 17 2014 *)

Extensions

a(30) corrected by T. D. Noe, Feb 08 2008

A050870 T(h,k) = binomial(h,k) - A050186(h,k).

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, 10, 2, 10, 0, 5, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 6, 4, 15, 0, 24, 0, 15, 4, 6, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 7, 0, 21, 0, 35, 2, 35, 0, 21, 0, 7, 0, 1, 1, 0
Offset: 0

Views

Author

Keywords

Comments

T(h,k) = number of periodic binary words of k 1's and h-k 0's.

Examples

			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,10,2,10,0,5,0,1;
		

Crossrefs

Cf. A007318. Different from A053200.

Programs

  • Maple
    A050186 := proc(n,k)
            if n = 0 then
                    1;
            else
            add (numtheory[mobius](d)*binomial(n/d,k/d),d =numtheory[divisors](igcd(n,k))) ;
            end if;
    end proc:
    A050870 := proc(n,k)
            binomial(n,k)-A050186(n,k) ;
    end proc:
    seq(seq(A050870(n,k),k=0..n),n=0..20) ; # R. J. Mathar, Sep 24 2011
  • Mathematica
    T[n_, k_] := Binomial[n, k] - If[n == 0, 1, Sum[MoebiusMu[d] Binomial[n/d, k/d], {d, Divisors[GCD[n, k]]}]];
    Table[T[n, k], {n, 0, 15}, {k, 0, n}] (* Jean-François Alcover, Jul 01 2019 *)

Extensions

Edited by N. J. A. Sloane, Aug 29 2008

A007012 a(n) is number of k for which C(n,k) is not divisible by n.

Original entry on oeis.org

1, 0, 2, 2, 3, 2, 5, 2, 5, 4, 5, 2, 8, 2, 9, 8, 9, 2, 9, 2, 11, 8, 9, 2, 15, 6, 9, 10, 15, 2, 20, 2, 17, 8, 5, 10, 15, 2, 9, 10, 19, 2, 23, 2, 19, 20, 17, 2, 29, 8, 17, 20, 19, 2, 29, 10, 24, 8, 17, 2, 35, 2, 33, 18, 33, 16, 19, 2, 11, 20, 27, 2, 33, 2, 9, 30, 19, 16, 41, 2, 31, 28, 9, 2, 32, 16
Offset: 0

Views

Author

Keywords

Comments

The number of nonzero terms in the polynomial (1+x)^n (mod n). Note that n is prime iff a(n)=2. - T. D. Noe, Feb 23 2006
For n > 0: a(n) = number of terms > 0 in n-th row of triangle A053200. - Reinhard Zumkeller, Jan 24 2014

References

  • J. H. Conway, personal communication.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a007012 n = a007012_list !! n
    a007012_list = 1 : map (sum . map signum) (tail a053200_tabl)
    -- Reinhard Zumkeller, Jan 24 2014
  • Mathematica
    Prepend[ Array[ Length[ Select[ Table[ Binomial[ #, k ]/#, {k, 0, #} ], !IntegerQ[ # ]& ] ]&, 100 ], 1 ]

Formula

a(n) = n + 1 - A020475(n). - T. D. Noe, Feb 23 2006

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

A094496 Triangle read by rows: T(n,k) = binomial(n,k) - binomial(n,k) mod n^2, with T(0,0) = 1.

Original entry on oeis.org

1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 81, 81, 81, 81, 0, 0, 0, 0, 0, 0, 100, 200, 200, 200, 100, 0, 0, 0, 0, 0, 0, 121, 242, 363, 363, 242, 121, 0, 0, 0, 0, 0, 0, 144, 432, 720, 864, 720, 432, 144, 0, 0, 0
Offset: 0

Views

Author

Labos Elemer, Jun 02 2004

Keywords

Examples

			Triangle begins:
  1;
  1, 1;
  0, 0, 0;
  0, 0, 0,   0;
  0, 0, 0,   0,   0;
  0, 0, 0,   0,   0,   0;
  0, 0, 0,   0,   0,   0,   0;
  0, 0, 0,   0,   0,   0,   0,   0;
  0, 0, 0,   0,  64,   0,   0,   0, 0;
  0, 0, 0,  81,  81,  81,  81,   0, 0, 0;
  0, 0, 0, 100, 200, 200, 200, 100, 0, 0, 0;
  ...
T(8,6) = binomial(8,4) - binomial(8,4) mod 8^2 = 70 - 6 = 64.
		

Crossrefs

Programs

  • Mathematica
    Flatten[Table[Table[Binomial[n, j]-Mod[Binomial[n, j], n^2], {j, 0, n}], {n, 1, 20}], 1]
  • PARI
    T(n,k) = my(x=binomial(n,k)); x - if(n, x % n^2) \\ Andrew Howroyd, Dec 12 2024

Formula

T(n,k) = A007318(n,k) - A094495(n,k).
Showing 1-10 of 12 results. Next