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.

Previous Showing 11-20 of 2116 results. Next

A034931 Triangle read by rows: Pascal's triangle (A007318) mod 4.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 0, 2, 0, 1, 1, 1, 2, 2, 1, 1, 1, 2, 3, 0, 3, 2, 1, 1, 3, 1, 3, 3, 1, 3, 1, 1, 0, 0, 0, 2, 0, 0, 0, 1, 1, 1, 0, 0, 2, 2, 0, 0, 1, 1, 1, 2, 1, 0, 2, 0, 2, 0, 1, 2, 1, 1, 3, 3, 1, 2, 2, 2, 2, 1, 3, 3, 1, 1, 0, 2, 0, 3, 0, 0, 0, 3, 0, 2, 0, 1, 1, 1, 2, 2, 3, 3, 0, 0, 3, 3, 2, 2, 1, 1
Offset: 0

Views

Author

Keywords

Comments

The number of 3's in row n is given by 2^(A000120(n)-1) if A014081(n) is nonzero, else by 0 [Davis & Webb]. - R. J. Mathar, Jul 28 2017

Examples

			Triangle begins:
                 1
                1 1
               1 2 1
              1 3 3 1
             1 0 2 0 1
            1 1 2 2 1 1
           1 2 3 0 3 2 1
          1 3 1 3 3 1 3 1
         1 0 0 0 2 0 0 0 1
        1 1 0 0 2 2 0 0 1 1
       1 2 1 0 2 0 2 0 1 2 1
      1 3 3 1 2 2 2 2 1 3 3 1
  ...
		

Crossrefs

Cf. A007318, A047999, A083093, A034930, A008975, A034932, A163000 (# 2's), A270438 (# 1's), A249732 (# 0's).
Sequences based on the triangles formed by reading Pascal's triangle mod m: A047999 (m = 2), A083093 (m = 3), (this sequence) (m = 4), A095140 (m = 5), A095141 (m = 6), A095142 (m = 7), A034930(m = 8), A095143 (m = 9), A008975 (m = 10), A095144 (m = 11), A095145 (m = 12), A275198 (m = 14), A034932 (m = 16).

Programs

  • Haskell
    a034931 n k = a034931_tabl !! n !! k
    a034931_row n = a034931_tabl !! n
    a034931_tabl = iterate
       (\ws -> zipWith ((flip mod 4 .) . (+)) ([0] ++ ws) (ws ++ [0])) [1]
    -- Reinhard Zumkeller, Mar 14 2015
    
  • Maple
    A034931 := proc(n,k)
        modp(binomial(n,k),4) ;
    end proc:
    seq(seq(A034931(n,k),k=0..n),n=0..10); # R. J. Mathar, Jul 28 2017
  • Mathematica
    Mod[ Flatten[ Table[ Binomial[n, k], {n, 0, 13}, {k, 0, n}]], 4] (* Robert G. Wilson v, May 26 2004 *)
  • PARI
    C(n, k)=binomial(n, k)%4 \\ Charles R Greathouse IV, Aug 09 2016
    
  • PARI
    f(n,k)=2*(bitand(n-k, k)==0);
    T(n,j)=if(j==0,return(1)); my(k=logint(n,2),K=2^k,K1=K/2,L=n-K); if(LCharles R Greathouse IV, Aug 11 2016
    
  • Python
    from math import isqrt, comb
    def A034931(n):
        g = (m:=isqrt(f:=n+1<<1))-(f<=m*(m+1))
        k = n-comb(g+1,2)
        if k.bit_count()+(g-k).bit_count()-g.bit_count()>1: return 0
        s, c, d = bin(g)[2:], 1, 0
        w = (bin(k)[2:]).zfill(l:=len(s))
        for i in range(0,l-1):
            r, t = s[i:i+2], w[i:i+2]
            if (x:=int(r,2)) < (y:=int(t,2)):
                d += (t[0]>r[0])+(t[1]>r[1])
            else:
                c = c*comb(x,y)&3
        d -= sum(1 for i in range(1,l-1) if w[i]>s[i])
        return (c<Chai Wah Wu, Jul 19 2025

Formula

T(n+1,k) = (T(n,k) + T(n,k-1)) mod 4. - Reinhard Zumkeller, Mar 14 2015

A091042 Triangle of even numbered entries of odd numbered rows of Pascal's triangle A007318.

Original entry on oeis.org

1, 1, 3, 1, 10, 5, 1, 21, 35, 7, 1, 36, 126, 84, 9, 1, 55, 330, 462, 165, 11, 1, 78, 715, 1716, 1287, 286, 13, 1, 105, 1365, 5005, 6435, 3003, 455, 15, 1, 136, 2380, 12376, 24310, 19448, 6188, 680, 17, 1, 171, 3876, 27132, 75582, 92378, 50388, 11628, 969, 19, 1, 210, 5985, 54264, 203490, 352716, 293930, 116280, 20349, 1330, 21
Offset: 0

Views

Author

Wolfdieter Lang, Jan 23 2004

Keywords

Comments

The row polynomials Pe(n, x) := Sum_{m=0..n} a(n, m)*x^m appear as numerators of the generating functions for the even numbered column sequences of array A034870.
Elements have the same parity as those of Pascal's triangle.
All zeros of polynomial Pe(n, x) are negative. They are -tan^2(Pi/2*n+1), -tan^2(2*Pi/2*n+1), ..., -tan^2(n*Pi/2*n+1). Moreover, for m >= 1, Pe(m, -x^2) is the characteristic polynomial of the linear difference equation with constant coefficients for differences between multiples of 2*m+1 with even and odd digit sum in base 2*m in the interval [0,(2*m)^n). - Vladimir Shevelev and Peter J. C. Moses, May 22 2012
Row reverse of A103327. - Peter Bala, Jul 29 2013
The row polynomial Pe(d, x), multiplied by (2*d)!/d! = A001813(d), gives the numerator polynomial of the o.g.f. of the sequence of the diagonal d, for d >= 0, of the Sheffer triangle Lah[4,1] given in A048854. - Wolfdieter Lang, Oct 12 2017

Examples

			Triangle a(n, m) begins:
n\m  0   1    2     3      4      5      6      7     8    9  10 ...
0:   1
1:   1   3
2:   1  10    5
3:   1  21   35     7
4:   1  36  126    84      9
5:   1  55  330   462    165     11
6:   1  78  715  1716   1287    286     13
7:   1 105 1365  5005   6435   3003    455     15
8:   1 136 2380 12376  24310  19448   6188    680    17
9:   1 171 3876 27132  75582  92378  50388  11628   969   19
10:  1 210 5985 54264 203490 352716 293930 116280 20349 1330  21
... reformatted and extended. - _Wolfdieter Lang_, Oct 12 2017
From _Peter Bala_, Jan 30 2022: (Start)
(1/2)*(N^2 + N) = Sum_{j = 1..N} j.
(1/2)*(N^2 + N)^3 = Sum_{j = 1..N} j^3 + 3*Sum_{j = 1..N} j^5.
(1/2)*(N^2 + N)^5 = Sum_{j = 1..N} j^5 + 10*Sum_{j = 1..N} j^7 + 5*Sum_{j = 1..N} j^9.
(1/2)*(N^2 + N)^7 = Sum_{j = 1..N} j^7 + 21*Sum_{j = 1..N} j^9 + 35*Sum_{j = 1..N} j^11 + 7*Sum_{j = 1..N} j^13. (End)
		

References

  • A. M. Yaglom and I. M. Yaglom, An elementary proof of the Wallis, Leibniz and Euler formulas for pi. Uspekhi Matem. Nauk, VIII (1953), 181-187(in Russian).

Crossrefs

Cf. A212500, A038754. A000302 (row sums), A085478, A103327 (row reverse), A048854, A103328.

Programs

  • GAP
    Flat(List([0..12], n-> List([0..n], k-> Binomial(2*n+1, 2*k) ))); # G. C. Greubel, Aug 01 2019
    
  • Magma
    [[Binomial(2*n+1,2*k): k in [0..n]]: n in [0..12]]; // G. C. Greubel, Aug 01 2019
    
  • Maple
    f := (x, t) -> cosh(sqrt(x)*t)*sinh(t); seq(seq(coeff(((2*n+1)!*coeff(series(f(x,t),t,2*n+2),t,2*n+1)),x,k),k=0..n),n=0..9); # Peter Luschny, Jul 29 2013
  • Mathematica
    T[n_, k_] /; 0 <= k <= n := T[n, k] = 2T[n-1, k] + 2T[n-1, k-1] + 2T[n-2, k-1] - T[n-2, k] - T[n-2, k-2]; T[0, 0] = T[1, 0] = 1; T[1, 1] = 3; T[, ] = 0;
    Table[T[n, k], {n, 0, 10}, {k, 0, n}]//Flatten (* Jean-François Alcover, Jul 29 2018, after Philippe Deléham *)
    Table[Binomial[2*n+1, 2*k], {n,0,12}, {k,0,n}]//Flatten (* G. C. Greubel, Aug 01 2019 *)
  • PARI
    T(n,k) = binomial(2*n+1, 2*k); \\ G. C. Greubel, Aug 01 2019
    
  • Python
    from math import comb, isqrt
    def A091042(n): return comb((r:=(m:=isqrt(k:=n+1<<1))-(k<=m*(m+1)))<<1|1,n-comb(r+1,2)<<1) # Chai Wah Wu, Apr 30 2025
  • Sage
    [[binomial(2*n+1, 2*k) for k in (0..n)] for n in (0..12)] # G. C. Greubel, Aug 01 2019
    

Formula

T(n, m) = binomial(2*n+1, 2*m) = A007318(2*n+1, 2*m), n >= m >= 0, otherwise 0.
From Peter Bala, Jul 29 2013: (Start)
E.g.f.: sinh(t)*cosh(sqrt(x)*t) = t + (1 + 3*x)*t^3/3! + (1 + 10*x + 5*x^2)*t^5/5! + (1 + 21*x + 35*x^2 + 7*x^3)*t^7/7! + ....
O.g.f.: A(x,t) = (1 + (x - 1)*t)/( (1 + (x - 1)*t)^2 - 4*t*x ) = 1 + (1 + 3*x)*t + (1 + 10*x + 5*x^2)*t^2 + ...
The function A( x/(x + 4), t*(x + 4)/4 ) = 1 + (1 + x)*t + (1 + 3*x + x^2)*t^2 + ... is the o.g.f. for A085478.
O.g.f. for n-th diagonal: ( Sum_{k = 0..n} binomial(2*n,2*k)*x^k )/(1 - x)^(2*n).
n-th row polynomial R(n,x) = (1/2)*( (1 + sqrt(x))^(2*n+1) - (sqrt(x) - 1)^(2*n+1) ).
Row sums A000302. (End)
T(n, k) = 2*T(n-1,k) + 2*T(n-1,k-1) + 2*T(n-2,k-1) - T(n-2,k) - T(n-2,k-2) with T(0,0)=T(1,0)=1, T(1,1)=3, T(n,k)=0 if k < 0 or if k > n. - Philippe Deléham, Nov 26 2013
From Peter Bala, Jan 31 2022: (Start)
Define S(r,N) = Sum_{j = 1..N} j^r. Then the following identity holds for n >= 0: (1/2)*(N^2 + N)^(2*n+1) = T(n,0)*S(2*n+1,N) + T(n,1)*S(2*n+3,N) + ... + T(n,n)* S(4*n+1,N). Some examples are given below. (End)

A008975 Triangle, read by rows, formed by reading Pascal's triangle (A007318) mod 10.

Original entry on oeis.org

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

Views

Author

Keywords

Crossrefs

Cf. A208278 (row sums), A208279 (central terms), A208134 (number of zeros per row), A208280 (distinct terms per row).
Sequences based on the triangles formed by reading Pascal's triangle mod m: A047999 (m = 2), A083093 (m = 3), A034931 (m = 4), A095140 (m = 5), A095141 (m = 6), A095142 (m = 7), A034930 (m = 8), A095143 (m = 9), (this sequence) (m = 10), A095144 (m = 11), A095145 (m = 12), A275198 (m = 14), A034932 (m = 16).

Programs

  • Haskell
    a008975 n k = a008975_tabl !! n !! k
    a008975_row n = a008975_tabl !! n
    a008975_tabl = iterate
       (\row -> map (`mod` 10) $ zipWith (+) ([0] ++ row) (row ++ [0])) [1]
    -- Reinhard Zumkeller, Feb 24 2012
    
  • Mathematica
    Mod[ Flatten[ Table[ Binomial[n, k], {n, 0, 13}, {k, 0, n}]], 10] (* Robert G. Wilson v, May 26 2004 *)
  • Python
    from math import isqrt, comb
    from sympy.ntheory.modular import crt
    def A008975(n):
        w, c = n-((r:=(m:=isqrt(k:=n+1<<1))-(k<=m*(m+1)))*(r+1)>>1), 1
        d = int(not ~r & w)
        while True:
            r, a = divmod(r,5)
            w, b = divmod(w,5)
            c = c*comb(a,b)%5
            if r<5 and w<5:
                c = c*comb(r,w)%5
                break
        return crt([5,2],[c,d])[0] # Chai Wah Wu, May 01 2025

Formula

T(i, j) = binomial(i, j) mod 10.

A035324 A convolution triangle of numbers, generalizing Pascal's triangle A007318.

Original entry on oeis.org

1, 3, 1, 10, 6, 1, 35, 29, 9, 1, 126, 130, 57, 12, 1, 462, 562, 312, 94, 15, 1, 1716, 2380, 1578, 608, 140, 18, 1, 6435, 9949, 7599, 3525, 1045, 195, 21, 1, 24310, 41226, 35401, 19044, 6835, 1650, 259, 24, 1, 92378, 169766, 161052, 97954, 40963, 12021, 2450
Offset: 1

Views

Author

Keywords

Comments

Replacing each '2' in the recurrence by '1' produces Pascal's triangle A007318(n-1,m-1). The columns appear as A001700, A008549, A045720, A045894, A035330, ...
Triangle T(n,k), 1 <= k <= n, given by (0, 3/1, 1/3, 5/3, 3/5, 7/5, 5/7, 9/7, 7/9, 11/9, 9/11, ...) DELTA (1, 0, 0, 0, 0, 0, 0, 0, 0, ...) where DELTA is the operator defined in A084938. - Philippe Deléham, Jan 28 2012
Riordan array (1, c(x)/sqrt(1-4x)) where c(x) = g.f. for Catalan numbers A000108, first column (k = 0) omitted. - Philippe Deléham, Jan 28 2012

Examples

			Triangle begins:
    1;
    3,   1;
   10,   6,   1;
   35,  29,   9,   1;
  126, 130,  57,  12,   1;
  462, 562, 312,  94,  15,   1;
Triangle (0, 3, 1/3, 5/3, 3/5, ...) DELTA (1,0,0,0,0,0, ...) has an additional first column (1,0,0,...).
		

Crossrefs

Row sums: A049027(n), n >= 1.
Alternating row sums give A000108 (Catalan numbers).
If offset 0 (n >= m >= 0): convolution triangle based on A001700 (central binomial coeffs. of odd order).

Programs

  • Haskell
    a035324 n k = a035324_tabl !! (n-1) !! (k-1)
    a035324_row n = a035324_tabl !! (n-1)
    a035324_tabl = map snd $ iterate f (1, [1]) where
       f (i, xs)  = (i + 1, map (`div` (i + 1)) $
          zipWith (+) ((map (* 2) $ zipWith (*) [2 * i + 1 ..] xs) ++ [0])
                      ([0] ++ zipWith (*) [2 ..] xs))
    -- Reinhard Zumkeller, Jun 30 2013
    
  • Mathematica
    a[n_, m_] /; n >= m >= 1 := a[n, m] = 2*(2*(n-1) + m)*(a[n-1, m]/n) + m*(a[n-1, m-1]/n); a[n_, m_] /; n < m = 0; a[n_, 0] = 0; a[1, 1] = 1; Flatten[ Table[ a[n, m], {n, 1, 10}, {m, 1, n}]] (* Jean-François Alcover, Feb 21 2012, from first formula *)
  • Sage
    @cached_function
    def T(n, k):
        if n == 0: return n^k
        return sum(binomial(2*i-1, i)*T(n-1, k-i) for i in (1..k-n+1))
    A035324 = lambda n,k: T(k, n)
    for n in (1..8): print([A035324(n, k) for k in (1..n)]) # Peter Luschny, Aug 16 2016

Formula

a(n+1, m) = 2*(2*n+m)*a(n, m)/(n+1) + m*a(n, m-1)/(n+1), n >= m >= 1; a(n, m) := 0, n
G.f. for column m: ((x*c(x)/sqrt(1-4*x))^m)/x, where c(x) = g.f. for Catalan numbers A000108.
a(n, m) =: s2(3; n, m).
With offset 0 (0 <= k <= n), T(n,k) = Sum_{j>=0} A039598(n,j)*binomial(j,k). - Philippe Deléham, Mar 30 2007
T(n+1,n) = 3*n = A008585(n).
T(n,k) = T(n-1,k-1) + 3*T(n-1,k) + Sum_{i>=0} T(n-1,k+1+i)*(-1)^i. - Philippe Deléham, Feb 23 2012
T(n,m) = Sum_{k=m..n} k*binomial(k-1,k-m)*2^(k-m)*binomial(2*n-k-1,n-k)/n. - Vladimir Kruchinin, Aug 07 2013

A048967 Number of even entries in row n of Pascal's triangle (A007318).

Original entry on oeis.org

0, 0, 1, 0, 3, 2, 3, 0, 7, 6, 7, 4, 9, 6, 7, 0, 15, 14, 15, 12, 17, 14, 15, 8, 21, 18, 19, 12, 21, 14, 15, 0, 31, 30, 31, 28, 33, 30, 31, 24, 37, 34, 35, 28, 37, 30, 31, 16, 45, 42, 43, 36, 45, 38, 39, 24, 49, 42, 43, 28, 45, 30, 31, 0, 63, 62, 63, 60, 65, 62, 63, 56, 69, 66, 67
Offset: 0

Keywords

Comments

In rows 2^k - 1 all entries are odd.
a(n) = 0 (all the entries in the row are odd) iff n = 2^m - 1 for some m >= 0 and then n belongs to sequence A000225. - Avi Peretz (njk(AT)netvision.net.il), Apr 21 2001
Also number of zeros in n-th row of Sierpiński's triangle (cf. A047999): a(n) = A023416(A001317(n)). - Reinhard Zumkeller, Nov 24 2012

Examples

			Row 4 is 1 4 6 4 1 with 3 even entries so a(4)=3.
		

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a048967 n = a048967_list !! n
    a048967_list = 0 : xs where
       xs = 0 : concat (transpose [zipWith (+) [1..] xs, map (* 2) xs])
    -- Reinhard Zumkeller, Nov 14 2014, Nov 24 2012
    
  • Mathematica
    Table[n + 1 - Sum[ Mod[ Binomial[n, k], 2], {k, 0, n} ], {n, 0, 100} ]
    a[n_] := n + 1 - 2^DigitCount[n, 2, 1]; Array[a, 100, 0] (* Amiram Eldar, Jul 27 2023 *)
  • PARI
    a(n)=if(n<1,0,if(n%2==0,a(n/2)+n/2,2*a((n-1)/2)))
    
  • Python
    def A048967(n): return n+1-(1<Chai Wah Wu, May 03 2023

Formula

a(n) = n+1 - A001316(n) = n+1 - 2^A000120(n) = n+1 - Sum_{k=0..n} (C(n, k) mod 2) = Sum_{k=0..n} ((1 - C(n, k)) mod 2).
a(2n) = a(n) + n, a(2n+1) = 2a(n). - Ralf Stephan, Oct 07 2003
a(n) = row sums in A219463 = A000120(A219843(n)). - Reinhard Zumkeller, Nov 30 2012
A249304(n+1) = a(n+1) + a(n). - Reinhard Zumkeller, Nov 14 2014
G.f.: 1/(1 - x)^2 - Product_{k>=0} (1 + 2*x^(2^k)). - Ilya Gutkovskiy, Jul 19 2019

A095143 Triangle, read by rows, formed by reading Pascal's triangle (A007318) mod 9.

Original entry on oeis.org

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

Author

Robert G. Wilson v, May 29 2004

Keywords

Examples

			Triangle begins:
              1;
            1,  1;
          1,  2,  1;
        1,  3,  3,  1;
      1,  4,  6,  4,  1;
    1,  5,  1,  1,  5,  1;
  1,  6,  6,  2,  6,  6,  1;
  ...
		

Crossrefs

Sequences based on the triangles formed by reading Pascal's triangle mod m: A047999 (m = 2), A083093 (m = 3), A034931 (m = 4), A095140 (m = 5), A095141 (m = 6), A095142 (m = 7), A034930 (m = 8), (this sequence) (m = 9), A008975 (m = 10), A095144 (m = 11), A095145 (m = 12), A275198 (m = 14), A034932 (m = 16).

Programs

  • Mathematica
    Mod[ Flatten[ Table[ Binomial[n, k], {n, 0, 13}, {k, 0, n}]], 9]
  • Python
    from math import isqrt, comb
    from gmpy2 import digits
    def A095143(n):
        g = (m:=isqrt(f:=n+1<<1))-(f<=m*(m+1))
        k = n-comb(g+1,2)
        if sum(int(d) for d in digits(k,3))+sum(int(d) for d in digits(g-k,3))-sum(int(d) for d in digits(g,3))>2: return 0
        s, c, d = digits(g,3), 1, 0
        w = (digits(k,3)).zfill(l:=len(s))
        if l == 1: return comb(g,k)%9
        for i in range(0,l-1):
            r, t = s[i:i+2], w[i:i+2]
            if (x:=int(r,3)) < (y:=int(t,3)):
                d += (t[0]>r[0])+(t[1]>r[1])
                if r[1]>=t[1]:
                    c = c*comb(int(r[1],3),int(t[1],3))%9
            else:
                c = c*comb(x,y)%9
        for i in range(1,l-1):
            if w[i]>s[i] or (z:=comb(int(s[i],3),int(w[i],3))) == 3:
                d -= 1
            else:
                c = c*pow(z,-1,9)%9
        return c*3**d%9 # Chai Wah Wu, Jul 19 2025

Formula

T(i, j) = binomial(i, j) mod 9.

A152198 Triangle read by rows, A007318 rows repeated.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 3, 3, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, 1, 4, 6, 4, 1, 1, 5, 10, 10, 5, 1, 1, 5, 10, 10, 5, 1, 1, 6, 15, 20, 15, 6, 1, 1, 6, 15, 20, 15, 6, 1, 1, 7, 21, 35, 35, 21, 7, 1, 1, 7, 21, 35, 35, 21, 7, 1, 1, 8, 28, 56, 70, 56, 28, 8, 1, 1, 8, 28, 56, 70, 56, 28, 8, 1
Offset: 0

Author

Gary W. Adamson, Nov 28 2008

Keywords

Comments

Eigensequence of the triangle = A051163: (1, 2, 5, 12, 30, 76,...)
Another version of A152815. - Philippe Deléham, Dec 13 2008
Row sums : A016116(n); Diagonal sums: A000931(n+5). - Philippe Deléham, Dec 13 2008
Triangle, with zeros omitted, given by (1, 0, -1, 0, 0, 0, 0, 0, 0, 0, ...) DELTA (0, 1, -1, 0, 0, 0, 0, 0, 0, 0, ...) where DELTA is the operator defined in A084938. - Philippe Deléham, Jan 16 2012
Sums along rising diagonals are A134816. - John Molokach, Jul 09 2013

Examples

			The triangle starts
1;
1;
1, 1;
1, 1;
1, 2, 1;
1, 2, 1;
1, 3, 3, 1;
1, 3, 3, 1;
1, 4, 6, 4, 1;
1, 4, 6, 4, 1;
1, 5, 10, 10, 5, 1;
1, 5, 10, 10, 5, 1;
...
Triangle (1,0,-1,0,0,...) DELTA (0,1,-1,0,0,...) begins:
1
1, 0
1, 1, 0
1, 1, 0, 0
1, 2, 1, 0, 0
1, 2, 1, 0, 0, 0
1, 3, 3, 1, 0, 0, 0
1, 3, 3, 1, 0, 0, 0, 0
1, 4, 6, 4, 1, 0, 0, 0, 0
1, 4, 6, 4, 1, 0, 0, 0, 0, 0
1, 5, 10, 10, 5, 1, 0, 0, 0, 0, 0...
		

Crossrefs

Programs

  • Mathematica
    t[n_, k_] := Binomial[ Floor[n/2], k]; Table[t[n, k], {n, 0, 17}, {k, 0, Floor[n/2]}] // Flatten (* Jean-François Alcover, Sep 13 2012 *)

Formula

Triangle read by rows, Pascal's triangle rows repeated.
Equals inverse binomial transform of A133156 unsigned.
G.f. : (1+x)/(1-(1+y)*x^2). - Philippe Deléham, Jan 16 2012
Sum_{k, 0<=k<=n} T(n,k)*x^k = A057077(n), A019590(n+1), A000012(n), A016116(n), A108411(n), A074872(n+1) for x = -2, -1, 0, 1, 2, 4 respectively. - Philippe Deléham, Jan 16 2012
T(n,k) = A065941(n-k, n-2*k) = abs(A108299(n-k, n-2*k)). - Johannes W. Meijer, Sep 05 2013

Extensions

More terms from Philippe Deléham, Dec 14 2008

A003016 Number of occurrences of n as an entry in rows <= n of Pascal's triangle (A007318).

Original entry on oeis.org

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

Keywords

Comments

Or, number of occurrences of n as a binomial coefficient. [Except for 1 which occurs infinitely many times. This is the only reason for the restriction "row <= n" in the definition. Any other number can only appear in rows <= n. - M. F. Hasler, Feb 16 2023]
Sequence A138496 gives record values and where they occur. - Reinhard Zumkeller, Mar 20 2008
Singmaster conjectures that this sequence is bounded. - Michael J. Hardy, Jun 09 2025

References

  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 93, #47.
  • C. S. Ogilvy, Tomorrow's Math. 2nd ed., Oxford Univ. Press, 1972, p. 96.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a003016 n = sum $ map (fromEnum . (== n)) $
                          concat $ take (fromInteger n + 1) a007318_tabl
    -- Reinhard Zumkeller, Apr 12 2012
    
  • Mathematica
    a[0] = 0; t = {{1}}; a[n_] := Count[ AppendTo[t, Table[ Binomial[n, k], {k, 0, n}]], n, {2}]; Table[a[n], {n, 0, 101}] (* Jean-François Alcover, Feb 20 2012 *)
  • PARI
    {A003016(n)=if(n<4, [0,3,1,2][n+1], my(c=2, k=2, r=sqrtint(2*n)+1, C=r*(r-1)/2); until(, while(C= r\2 && break; C *= r-k; C \= r; r -= 1); c)} \\ M. F. Hasler, Feb 16 2023
    
  • Python
    from math import isqrt # requires python3.8 or higher
    def A003016(n):
        if n < 4: return[0,3,1,2][n]
        cnt = k = 2; r = isqrt(2*n)+1; C = r*(r-1)//2
        while True:
           while C < n and k < r//2:
              C *= r-k; k += 1; C //= k
           if C == n: cnt += 2 - (r == 2*k)
           if k >= r//2: return cnt
           C *= r-k; C //= r; r -= 1 # M. F. Hasler, Feb 16 2023

Extensions

More terms from Erich Friedman
Edited by N. J. A. Sloane, Nov 18 2007, at the suggestion of Max Alekseyev

A034930 Triangle, read by rows, formed by reading Pascal's triangle (A007318) mod 8.

Original entry on oeis.org

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

Keywords

Crossrefs

Sequences based on the triangles formed by reading Pascal's triangle mod m: A047999 (m = 2), A083093 (m = 3), A034931 (m = 4), A095140 (m = 5), A095141 (m = 6), A095142 (m = 7), (this sequence) (m = 8), A095143 (m = 9), A008975 (m = 10), A095144 (m = 11), A095145 (m = 12), A275198 (m = 14), A034932 (m = 16).

Programs

  • Haskell
    a034930 n k = a034930_tabl !! n !! k
    a034930_row n = a034930_tabl !! n
    a034930_tabl = iterate
       (\ws -> zipWith (\u v -> mod (u + v) 8) ([0] ++ ws) (ws ++ [0])) [1]
    -- Reinhard Zumkeller, Jul 12 2013, Jun 21 2013
    
  • Mathematica
    Mod[ Flatten[ Table[ Binomial[n, k], {n, 0, 13}, {k, 0, n}]], 8] (* Robert G. Wilson v, May 26 2004 *)
  • Python
    from math import comb, isqrt
    def A034930(n):
        g = (m:=isqrt(f:=n+1<<1))-(f<=m*(m+1))
        k = n-comb(g+1,2)
        if k.bit_count()+(g-k).bit_count()-g.bit_count()>2: return 0
        def g1(s,w,e):
            c, d = 1, 0
            if len(s) == 0: return c, d
            a, b = int(s,2), int(w,2)
            if a>=b:
                k = comb(a,b)&7
                j = (~k & k-1).bit_length()
                d += j*e
                k >>= j
                c = c*pow(k,e,8)&7
            else:
                if int(s[0:1],2)Chai Wah Wu, Jul 20 2025

Formula

T(n+1,k) = (T(n,k) + T(n,k-1)) mod 8. - Reinhard Zumkeller, Jul 12 2013

A034932 Triangle, read by rows, formed by reading Pascal's triangle (A007318) mod 16.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, 1, 5, 10, 10, 5, 1, 1, 6, 15, 4, 15, 6, 1, 1, 7, 5, 3, 3, 5, 7, 1, 1, 8, 12, 8, 6, 8, 12, 8, 1, 1, 9, 4, 4, 14, 14, 4, 4, 9, 1, 1, 10, 13, 8, 2, 12, 2, 8, 13, 10, 1, 1, 11, 7, 5, 10, 14, 14, 10
Offset: 0

Keywords

Comments

T(n+1,k) = (T(n,k) + T(n,k-1)) mod 16. - Reinhard Zumkeller, Mar 14 2015

Examples

			Triangle begins:
                        1
                      1   1
                    1   2   1
                  1   3   3   1
                1   4   6   4   1
              1   5  10  10   5   1
            1   6  15   4  15   6   1
          1   7   5   3   3   5   7   1
        1   8  12   8   6   8  12   8   1
      1   9   4   4  14  14   4   4   9   1
    1  10  13   8   2  12   2   8  13  10   1
  1  11   7   5  10  14  14  10   5   7  11   1
.
Written in hexadecimal (with a=10, b=11, ..., f=15), rows 0..32 are
.
                                   1
                                  1 1
                                 1 2 1
                                1 3 3 1
                               1 4 6 4 1
                              1 5 a a 5 1
                             1 6 f 4 f 6 1
                            1 7 5 3 3 5 7 1
                           1 8 c 8 6 8 c 8 1
                          1 9 4 4 e e 4 4 9 1
                         1 a d 8 2 c 2 8 d a 1
                        1 b 7 5 a e e a 5 7 b 1
                       1 c 2 c f 8 c 8 f c 2 c 1
                      1 d e e b 7 4 4 7 b e e d 1
                     1 e b c 9 2 b 8 b 2 9 c b e 1
                    1 f 9 7 5 b d 3 3 d b 5 7 9 f 1
                   1 0 8 0 c 0 8 0 6 0 8 0 c 0 8 0 1
                  1 1 8 8 c c 8 8 6 6 8 8 c c 8 8 1 1
                 1 2 9 0 4 8 4 0 e c e 0 4 8 4 0 9 2 1
                1 3 b 9 4 c c 4 e a a e 4 c c 4 9 b 3 1
               1 4 e 4 d 0 8 0 2 8 4 8 2 0 8 0 d 4 e 4 1
              1 5 2 2 1 d 8 8 2 a c c a 2 8 8 d 1 2 2 5 1
             1 6 7 4 3 e 5 0 a c 6 8 6 c a 0 5 e 3 4 7 6 1
            1 7 d b 7 1 3 5 a 6 2 e e 2 6 a 5 3 1 7 b d 7 1
           1 8 4 8 2 8 4 8 f 0 8 0 c 0 8 0 f 8 4 8 2 8 4 8 1
          1 9 c c a a c c 7 f 8 8 c c 8 8 f 7 c c a a c c 9 1
         1 a 5 8 6 4 6 8 3 6 7 0 4 8 4 0 7 6 3 8 6 4 6 8 5 a 1
        1 b f d e a a e b 9 d 7 4 c c 4 7 d 9 b e a a e d f b 1
       1 c a c b 8 4 8 9 4 6 4 b 0 8 0 b 4 6 4 9 8 4 8 b c a c 1
      1 d 6 6 7 3 c c 1 d a a f b 8 8 b f a a d 1 c c 3 7 6 6 d 1
     1 e 3 c d a f 8 d e 7 4 9 a 3 0 3 a 9 4 7 e d 8 f a d c 3 e 1
    1 f 1 f 9 7 9 7 5 b 5 b d 3 d 3 3 d 3 d b 5 b 5 7 9 7 9 f 1 f 1
   1 0 0 0 8 0 0 0 c 0 0 0 8 0 0 0 6 0 0 0 8 0 0 0 c 0 0 0 8 0 0 0 1
		

Crossrefs

Sequences based on the triangles formed by reading Pascal's triangle mod m: A047999 (m = 2), A083093 (m = 3), A034931 (m = 4), A095140 (m = 5), A095141 (m = 6), A095142 (m = 7), A034930 (m = 8), A095143 (m = 9), A008975 (m = 10), A095144 (m = 11), A095145 (m = 12), A275198 (m = 14), (this sequence) (m = 16).

Programs

  • Haskell
    a034932 n k = a034932_tabl !! n !! k
    a034932_row n = a034932_tabl !! n
    a034932_tabl = iterate
       (\ws -> zipWith ((flip mod 16 .) . (+)) ([0] ++ ws) (ws ++ [0])) [1]
    -- Reinhard Zumkeller, Mar 14 2015
    
  • Mathematica
    Mod[ Flatten[ Table[ Binomial[n, k], {n, 0, 13}, {k, 0, n}]], 16] (* Robert G. Wilson v, May 26 2004 *)
  • Python
    from math import comb, isqrt
    def A034932(n):
        g = (m:=isqrt(f:=n+1<<1))-(f<=m*(m+1))
        k = n-comb(g+1,2)
        if k.bit_count()+(g-k).bit_count()-g.bit_count()>3: return 0
        def g1(s,w,e):
            c, d = 1, 0
            if len(s) == 0: return c, d
            a, b = int(s,2), int(w,2)
            if a>=b:
                k = comb(a,b)&15
                j = (~k & k-1).bit_length()
                d += j*e
                k >>= j
                c = c*pow(k,e,16)&15
            else:
                if int(s[0:1],2)Chai Wah Wu, Jul 20 2025

Formula

T(i, j) = binomial(i, j) mod 16.
Previous Showing 11-20 of 2116 results. Next