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

A034868 Left half of Pascal's triangle.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 1, 4, 6, 1, 5, 10, 1, 6, 15, 20, 1, 7, 21, 35, 1, 8, 28, 56, 70, 1, 9, 36, 84, 126, 1, 10, 45, 120, 210, 252, 1, 11, 55, 165, 330, 462, 1, 12, 66, 220, 495, 792, 924, 1, 13, 78, 286, 715, 1287, 1716, 1, 14, 91, 364, 1001, 2002, 3003, 3432, 1, 15
Offset: 0

Views

Author

Keywords

Examples

			1;
1;
1, 2;
1, 3;
1, 4,  6;
1, 5, 10;
1, 6, 15, 20;
...
		

Crossrefs

Cf. A007318, A107430, A062344, A122366, A027306 (row sums).
Cf. A008619.
Cf. A225860.
Cf. A126257.
Cf. A034869 (right half), A014413, A014462, A265848.

Programs

  • Haskell
    a034868 n k = a034868_tabf !! n !! k
    a034868_row n = a034868_tabf !! n
    a034868_tabf = map reverse a034869_tabf
    -- Reinhard Zumkeller, improved Dec 20 2015, Jul 27 2012
    
  • Mathematica
    Flatten[ Table[ Binomial[n, k], {n, 0, 15}, {k, 0, Floor[n/2]}]] (* Robert G. Wilson v, May 28 2005 *)
  • PARI
    for(n=0, 14, for(k=0, floor(n/2), print1(binomial(n, k),", ");); print();) \\ Indranil Ghosh, Mar 31 2017
    
  • Python
    import math
    from sympy import binomial
    for n in range(15):
        print([binomial(n, k) for k in range(int(math.floor(n/2)) + 1)]) # Indranil Ghosh, Mar 31 2017
    
  • Python
    from itertools import count, islice
    def A034868_gen(): # generator of terms
        yield from (s:=(1,))
        for i in count(0):
            yield from (s:=(1,)+tuple(s[j]+s[j+1] for j in range(len(s)-1)) + ((s[-1]<<1,) if i&1 else ()))
    A034868_list = list(islice(A034868_gen(),30)) # Chai Wah Wu, Oct 17 2023

Formula

T(n,k) = A034869(n,floor(n/2)-k), k = 0..floor(n/2). - Reinhard Zumkeller, Jul 27 2012

A126256 Number of distinct terms in rows 0 through n of Pascal's triangle.

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 9, 12, 16, 20, 24, 29, 35, 41, 48, 53, 60, 68, 77, 86, 95, 103, 114, 125, 137, 149, 162, 175, 188, 202, 217, 232, 248, 264, 281, 297, 314, 332, 351, 370, 390, 410, 431, 452, 474, 495, 518, 541, 565, 589, 614, 639, 665, 691, 718, 744, 770, 798
Offset: 0

Views

Author

Nick Hobson, Dec 24 2006

Keywords

Comments

An easy upper bound is 1 + floor(n^2/4) = A033638(n).
First differences are in A126257.

Examples

			There are 9 distinct terms in rows 0 through 6 of Pascal's triangle (1, 1, 1, 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); hence a(6)=9.
		

Crossrefs

Programs

  • Haskell
    -- import Data.List.Ordered (insertSet)
    a126256 n = a126256_list !! n
    a126256_list = f a007318_tabl [] where
       f (xs:xss) zs = g xs zs where
         g []     ys = length ys : f xss ys
         g (x:xs) ys = g xs (insertSet x ys)
    -- Reinhard Zumkeller, May 26 2015, Nov 09 2011
    
  • Maple
    seq(nops(`union`(seq({seq(binomial(n,k),k=0..n)},n=0..m))),m=0..57); # Emeric Deutsch, Aug 26 2007
  • Mathematica
    Table[Length[Union[Flatten[Table[Binomial[n,k],{n,0,x},{k,0,n}]]]],{x,0,60}] (* Harvey P. Dale, Sep 10 2022 *)
  • PARI
    lim=57; z=listcreate(1+lim^2\4); for(n = 0, lim, for(r=1, n\2, s=Str(binomial(n, r)); f=setsearch(z, s, 1); if(f, listinsert(z, s, f))); print1(1+#z, ", "))
    
  • Python
    def A126256(n):
        s, c = (1,), {1}
        for i in range(n):
            s = (1,)+tuple(s[j]+s[j+1] for j in range(len(s)-1)) + (1,)
            c.update(set(s))
        return len(c) # Chai Wah Wu, Oct 17 2023

A126254 Number of distinct terms i^j for 1 <= i,j <= n.

Original entry on oeis.org

1, 3, 7, 11, 19, 28, 40, 50, 60, 76, 96, 115, 139, 163, 189, 207, 239, 270, 306, 340, 378, 417, 461, 503, 539, 585, 621, 670, 726, 779, 839, 881, 941, 1003, 1067, 1113, 1185, 1254, 1326, 1397, 1477, 1553, 1637, 1717, 1799, 1884, 1976, 2063, 2135, 2225
Offset: 1

Views

Author

Nick Hobson, Dec 24 2006

Keywords

Comments

An easy upper bound is n(n-1)+1 = A002061(n).

Examples

			a(4) = 11, as there are 11 distinct terms in 1^1=1, 1^2=1, 1^3=1, 1^4=1, 2^1=2, 2^2=4, 2^3=8, 2^4=16, 3^1=3, 3^2=9, 3^3=27, 3^4=81, 4^1=4, 4^2=16, 4^3=64, 4^4=256.
		

Crossrefs

Programs

  • Maple
    seq(nops({seq(seq(i^j, i=1..n),j=1..n)}),n=1..100); # Robert Israel, Feb 23 2015
  • PARI
    lim=50; z=listcreate(lim*(lim-1)+1); for(m=1, lim, for(i=1, m, x=factor(i); x[, 2]*=m; s=Str(x); f=setsearch(z, s, 1); if(f, listinsert(z, s, f))); t=factor(m); for(j=1, m, x=t; x[, 2]=j*t[, 2]; s=Str(x); f=setsearch(z, s, 1); if(f, listinsert(z, s, f))); print1(#z, ", "))
    
  • Python
    def A126254(n): return len({i**j for i in range(1,n+1) for j in range(1,n+1)}) # Chai Wah Wu, Oct 17 2023
  • R
    A126254 <- function(limit) {  if (limit == 1) { return(1) } ; num.powers <- c(1, rep(0, limit-1)) ; handled <- c(T, rep(F, limit-1)) ; for (base in 2:ceiling(sqrt(limit))) { if (!handled[base]) { num.handle <- floor(log(limit, base)) ; handled[base^(1:num.handle)] <- T ; num.powers[base] <- length(unique(as.vector(outer(1:num.handle, 1:limit)))) }} ; num.powers[!handled] <- limit ; sum(num.powers) } ; A126254(50) # John Silberholz, Feb 23 2015
    

A126255 Number of distinct terms i^j for 2 <= i,j <= n.

Original entry on oeis.org

1, 4, 8, 15, 23, 34, 44, 54, 69, 88, 106, 129, 152, 177, 195, 226, 256, 291, 324, 361, 399, 442, 483, 519, 564, 600, 648, 703, 755, 814, 856, 915, 976, 1039, 1085, 1156, 1224, 1295, 1365, 1444, 1519, 1602, 1681, 1762, 1846, 1937, 2023, 2095, 2184, 2279
Offset: 2

Views

Author

Nick Hobson, Dec 24 2006

Keywords

Comments

An easy upper bound is (n-1)^2 = A000290(n-1).

Examples

			a(4) = 8 as there are 8 distinct terms in 2^2=4, 2^3=8, 2^4=16, 3^2=9, 3^3=27, 3^4=81, 4^2=16, 4^3=64, 4^4=256.
		

Crossrefs

Programs

  • Mathematica
    SetAttributes[a, {Listable, NumericFunction}]
    a[n_ /; n < 2] := "error"
    a[2] := 1
    a[n_Integer?IntegerQ /; n > 2] :=
     Length[DeleteDuplicates[
       Distribute[f[Range[2, n], Range[2, n]], List,
         f] /. {f ->
          Power}]](*By using Distribute instead of Outer I avoid having to use Flatten on Outer*)
    a[Range[2, 100]]
    (* Peter Cullen Burbery, Aug 15 2023 *)
  • PARI
    lim=51; z=listcreate((lim-1)^2); for(m=2, lim, for(i=2, m, x=factor(i); x[, 2]*=m; s=Str(x); f=setsearch(z, s, 1); if(f, listinsert(z, s, f))); t=factor(m); for(j=2, m, x=t; x[, 2]=j*t[, 2]; s=Str(x); f=setsearch(z, s, 1); if(f, listinsert(z, s, f))); print1(#z, ", "))
    
  • Python
    def A126255(n): return len({i**j for i in range(2,n+1) for j in range(2,n+1)}) # Chai Wah Wu, Oct 17 2023

A132311 Triangle read by rows: T(n,k) is the number of partitions of binomial(n,k) into parts of the first n rows of Pascal's triangle, 0<=k<=n.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 4, 7, 4, 1, 1, 6, 28, 28, 6, 1, 1, 11, 117, 318, 117, 11, 1, 1, 14, 388, 3344, 3344, 388, 14, 1, 1, 21, 1757, 71277, 290521, 71277, 1757, 21, 1, 1, 29, 8270, 2031198, 53679222, 53679222, 2031198, 8270, 29, 1, 1, 42, 40243, 74464383, 19465193506, 147286801214, 19465193506, 74464383, 40243, 42, 1
Offset: 0

Views

Author

Reinhard Zumkeller, Aug 18 2007

Keywords

Comments

T(n,k) = T(n,n-k).
T(n,0) = 1 for n>0.
A000041(n) - 1 <= T(n,1) <= A000041(n) for n>1.

Examples

			A007318(4,2) = A007318(6,1) = 6: T(4,2) = #{3+3, 3+2+1, 3+1+1+1, 2+2+2, 2+2+1+1, 2+1+1+1+1, 1+1+1+1+1+1} = 7, but T(6,1) = A000041(6) = 11.
Triangle T(n,k) begins:
  0;
  1,  1;
  1,  1,    1;
  1,  2,    2,     1;
  1,  4,    7,     4,      1;
  1,  6,   28,    28,      6,     1;
  1, 11,  117,   318,    117,    11,    1;
  1, 14,  388,  3344,   3344,   388,   14,  1;
  1, 21, 1757, 71277, 290521, 71277, 1757, 21, 1;
  ...
		

Crossrefs

A132312 Triangle read by rows: T(n,k) = number of partitions of binomial(n,k) into distinct parts of the first n rows of Pascal's triangle, 0<=k<=n.

Original entry on oeis.org

0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 2, 1, 1, 4, 7, 6, 7, 4, 1, 1, 4, 11, 14, 14, 11, 4, 1, 1, 5, 28, 57, 56, 57, 28, 5, 1, 1, 7, 73, 273, 434, 434, 273, 73, 7, 1, 1, 10, 189, 1411, 3479, 3980, 3479, 1411, 189, 10, 1, 1, 11, 300, 4138, 16293, 26555, 26555, 16293, 4138, 300, 11, 1
Offset: 0

Views

Author

Reinhard Zumkeller, Aug 18 2007

Keywords

Comments

T(n,k) = T(n,n-k);
T(n,0) = 1 for n>0;
A000009(n) - 1 <= T(n,1) <= A000009(n) for n>1;

Examples

			T(9,1) = A000009(9)-1 = 7;
A007318(5,2) = A007318(10,1) = 10:
T(5,2) = #{6+4, 6+3+1, 4+3+2+1} = 3,
but T(10,1) = A000009(10) = 10.
		

Crossrefs

Programs

  • Mathematica
    T[n_] := T[n] = Table[Binomial[m, k], {m, 0, n-1}, {k, 0, m}] // Flatten // Union;
    T[n_, k_] /; k <= n/2 := T[n, k] = Select[ IntegerPartitions[ Binomial[n, k], Length[T[n]], T[n]], Length[#] == Length[Union[#]]&] // Length;
    T[n_, k_] /; k > n/2 := T[n, k] = T[n, n-k];
    Table[Print["T[", n, ",", k, "] = ", T[n, k]]; T[n, k], {n, 0, 11}, {k, 0, n}] // Flatten (* Jean-François Alcover, Oct 02 2020 *)

A265912 Smallest m such that A014631(n) occurs in row m of Pascal's triangle.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Dec 18 2015

Keywords

Comments

Each n occurs A126257(n) times consecutively.

Examples

			First occurrences of z(n)=A014631(n) in the left part of Pascal's triangle, repetitions marked:
.   0: z(1)                                       [1]
.   1: *z(1)                                      [1]
.   2: *z(1)  z(2)                                [1,2]
.   3: *z(1)  z(3)                                [1,3]
.   4: *z(1)  z(4)  z(5)                          [1,4,6]
.   5: *z(1)  z(6)  z(7)                          [1,5,10]
.   6: *z(1) *z(5)  z(8)  z(9)                    [1,6,15,20]
.   7: *z(1)  z(10) z(11) z(12)                   [1,7,21,35]
.   8: *z(1)  z(13) z(14) z(15) z(16)             [1,8,28,56,70]
.   9: *z(1)  z(17) z(18) z(19) z(20)             [1,9,36,84,126]
.  10: *z(1) *z(7)  z(21) z(22) z(23) z(24)       [1,10,45,120,210,252]
.  11: *z(1)  z(25) z(26) z(27) z(28) z(29)       [1,11,55,165,330,462]
.  12: *z(1)  z(30) z(31) z(32) z(33) z(34) z(35) [1,12,66,220,495,792,924]
---------------------------------------------------------------------------
.    n: 1  2  3  4  5  6   7   8   9  10  11  12  13  14  15  16  17  18
. z(n): 1  2  3  4  6  5  10  15  20   7  21  35   8  28  56  70   9  36
		

Crossrefs

Programs

  • Haskell
    import Data.List (findIndex); import Data.Maybe (fromJust)
    a265912 = fromJust . (flip findIndex a007318_tabl) . elem . a014631
    
  • Python
    from itertools import count, islice
    def A265912_gen(): # generator of terms
        s, c =(1,), set()
        for i in count(0):
            for d in s:
                if d not in c:
                    yield i
                    c.add(d)
            s=(1,)+tuple(s[j]+s[j+1] for j in range(len(s)-1)) + ((s[-1]<<1,) if i&1 else ())
    A265912_list = list(islice(A265912_gen(),30)) # Chai Wah Wu, Oct 17 2023
Showing 1-7 of 7 results.