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

A014631 Numbers in order in which they appear in Pascal's triangle.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

A permutation of the natural numbers. - Robert G. Wilson v, Jun 12 2014
In Pascal's triangle a(n) occurs the first time in row A265912(n). - Reinhard Zumkeller, Dec 18 2015

Crossrefs

Cf. A034868, A119629 (inverse), A265912.

Programs

  • Haskell
    import Data.List (nub)
    a014631 n = a014631_list !! (n-1)
    a014631_list = 1 : (nub $ concatMap tail a034868_tabf)
    -- Reinhard Zumkeller, Dec 19 2015
    
  • Mathematica
    lst = {1}; t = Flatten[Table[Binomial[n, m], {n, 16}, {m, Floor[n/2]}]]; Do[ If[ !MemberQ[lst, t[[n]]], AppendTo[lst, t[[n]] ]], {n, Length@t}]; lst (* Robert G. Wilson v *)
    DeleteDuplicates[Flatten[Table[Binomial[n,m],{n,20},{m,0,Floor[n/2]}]]] (* Harvey P. Dale, Apr 08 2013 *)
  • Python
    from itertools import count, islice
    def A014631_gen(): # generator of terms
        s, c =(1,), set()
        for i in count(0):
            for d in s:
                if d not in c:
                    yield d
                    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 ())
    A014631_list = list(islice(A014631_gen(),30)) # Chai Wah Wu, Oct 17 2023

Extensions

More terms from Erich Friedman
Offset changed by Reinhard Zumkeller, Dec 18 2015

A126257 Number of distinct new terms in row n of Pascal's triangle.

Original entry on oeis.org

1, 0, 1, 1, 2, 2, 2, 3, 4, 4, 4, 5, 6, 6, 7, 5, 7, 8, 9, 9, 9, 8, 11, 11, 12, 12, 13, 13, 13, 14, 15, 15, 16, 16, 17, 16, 17, 18, 19, 19, 20, 20, 21, 21, 22, 21, 23, 23, 24, 24, 25, 25, 26, 26, 27, 26, 26, 28, 29, 29, 30, 30, 31, 31, 32, 32, 32, 33, 34, 34, 34, 35, 36, 36, 37, 37, 38
Offset: 0

Views

Author

Nick Hobson, Dec 24 2006

Keywords

Comments

Partial sums are in A126256.
n occurs a(n) times in A265912. - Reinhard Zumkeller, Dec 18 2015

Examples

			Row 6 of Pascal's triangle is: 1, 6, 15, 20, 15, 6, 1. Of these terms, only 15 and 20 do not appear in rows 0-5. Hence a(6)=2.
		

Crossrefs

Programs

  • Haskell
    import Data.List.Ordered (minus, union)
    a126257 n = a126257_list !! n
    a126257_list = f [] a034868_tabf where
       f zs (xs:xss) = (length ys) : f (ys `union` zs) xss
                       where ys = xs `minus` zs
    -- Reinhard Zumkeller, Dec 18 2015
    
  • PARI
    lim=77; z=listcreate(1+lim^2\4); print1(1, ", "); r=1; for(a=1, lim, for(b=1, a\2, s=Str(binomial(a, b)); f=setsearch(z, s, 1); if(f, listinsert(z, s, f))); print1(1+#z-r, ", "); r=1+#z)
    
  • Python
    def A126257(n):
        if n:
            s, c = (1,), {1}
            for i in range(n-1):
                c.update(set(s:=(1,)+tuple(s[j]+s[j+1] for j in range(len(s)-1))+(1,)))
            return len(set((1,)+tuple(s[j]+s[j+1] for j in range(len(s)-1))+(1,))-c)
        return 1 # Chai Wah Wu, Oct 17 2023

A119629 Inverse permutation to sequence A014631.

Original entry on oeis.org

1, 2, 3, 4, 6, 5, 10, 13, 17, 7, 25, 30, 36, 42, 8, 54, 61, 69, 78, 9, 11, 104, 115, 126, 138, 150, 163, 14, 189, 203, 218, 233, 249, 265, 12, 18, 315, 333, 352, 371, 391, 411, 432, 453, 21, 496, 519, 542, 566, 590, 615, 640, 666, 692, 26, 15, 771, 799, 828, 857, 887
Offset: 1

Views

Author

Leroy Quet, Jun 08 2006

Keywords

Crossrefs

Cf. A014631.
Cf. A265912.

Programs

  • Haskell
    import Data.List (elemIndex); import Data.Maybe (fromJust)
    a119629 = (+ 1) . fromJust . (`elemIndex` a014631_list)
    -- Reinhard Zumkeller, Dec 18 2015
  • Mathematica
    lst = {1}; t = Flatten[Table[Binomial[n, m], {n, 16}, {m, Floor[n/2]}]]; Do[ If[ !MemberQ[lst, t[[n]]], AppendTo[lst, t[[n]] ]], {n, Length@t}]; Flatten@Table[ Position[lst, n], {n, 61}] (* Robert G. Wilson v *)

Extensions

More terms from Robert G. Wilson v, Jun 08 2006
Showing 1-3 of 3 results.