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.

A000667 Boustrophedon transform of all-1's sequence.

Original entry on oeis.org

1, 2, 4, 9, 24, 77, 294, 1309, 6664, 38177, 243034, 1701909, 13001604, 107601977, 959021574, 9157981309, 93282431344, 1009552482977, 11568619292914, 139931423833509, 1781662223749884, 23819069385695177, 333601191667149054, 4884673638115922509
Offset: 0

Views

Author

Keywords

Comments

Fill in a triangle, like Pascal's triangle, beginning each row with a 1 and filling in rows alternately right to left and left to right.
Row sums of triangle A109449. - Reinhard Zumkeller, Nov 04 2013

Examples

			...............1..............
............1..->..2..........
.........4..<-.3...<-..1......
......1..->.5..->..8...->..9..
		

Crossrefs

Absolute value of pairwise sums of A009337.
Column k=1 of A292975.

Programs

  • Haskell
    a000667 n = if x == 1 then last xs else x
                where xs@(x:_) = a227862_row n
    -- Reinhard Zumkeller, Nov 01 2013
    
  • Mathematica
    With[{nn=30},CoefficientList[Series[Exp[x](Tan[x]+Sec[x]),{x,0,nn}], x]Range[0,nn]!] (* Harvey P. Dale, Nov 28 2011 *)
    t[, 0] = 1; t[n, k_] := t[n, k] = t[n, k-1] + t[n-1, n-k];
    a[n_] := t[n, n];
    Array[a, 30, 0] (* Jean-François Alcover, Feb 12 2016 *)
  • PARI
    x='x+O('x^33); Vec(serlaplace( exp(x)*(tan(x) + 1/cos(x)) ) ) \\ Joerg Arndt, Jul 30 2016
    
  • Python
    from itertools import islice, accumulate
    def A000667_gen(): # generator of terms
        blist = tuple()
        while True:
            yield (blist := tuple(accumulate(reversed(blist),initial=1)))[-1]
    A000667_list = list(islice(A000667_gen(),20)) # Chai Wah Wu, Jun 11 2022
  • Sage
    # Algorithm of L. Seidel (1877)
    def A000667_list(n) :
        R = []; A = {-1:0, 0:0}
        k = 0; e = 1
        for i in range(n) :
            Am = 1
            A[k + e] = 0
            e = -e
            for j in (0..i) :
                Am += A[k]
                A[k] = Am
                k += e
            # print [A[z] for z in (-i//2..i//2)]
            R.append(A[e*i//2])
        return R
    A000667_list(10)  # Peter Luschny, Jun 02 2012
    

Formula

E.g.f.: exp(x) * (tan(x) + sec(x)).
Limit_{n->infinity} 2*n*a(n-1)/a(n) = Pi; lim_{n->infinity} a(n)*a(n-2)/a(n-1)^2 = 1 + 1/(n-1). - Gerald McGarvey, Aug 13 2004
a(n) = Sum_{k=0..n} binomial(n, k)*A000111(n-k). a(2*n) = A000795(n) + A009747(n), a(2*n+1) = A002084(n) + A003719(n). - Philippe Deléham, Aug 28 2005
a(n) = A227862(n, n * (n mod 2)). - Reinhard Zumkeller, Nov 01 2013
G.f.: E(0)*x/(1-x)/(1-2*x) + 1/(1-x), where E(k) = 1 - x^2*(k + 1)*(k + 2)/(x^2*(k + 1)*(k + 2) - 2*(x*(k + 2) - 1)*(x*(k + 3) - 1)/E(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Jan 16 2014
a(n) ~ n! * exp(Pi/2) * 2^(n+2) / Pi^(n+1). - Vaclav Kotesovec, Jun 12 2015

A008280 Boustrophedon version of triangle of Euler-Bernoulli or Entringer numbers read by rows.

Original entry on oeis.org

1, 0, 1, 1, 1, 0, 0, 1, 2, 2, 5, 5, 4, 2, 0, 0, 5, 10, 14, 16, 16, 61, 61, 56, 46, 32, 16, 0, 0, 61, 122, 178, 224, 256, 272, 272, 1385, 1385, 1324, 1202, 1024, 800, 544, 272, 0, 0, 1385, 2770, 4094, 5296, 6320, 7120, 7664, 7936, 7936
Offset: 0

Views

Author

Keywords

Comments

The earliest known reference for this triangle is Seidel (1877). - Don Knuth, Jul 13 2007
Sum of row n = A000111(n+1). - Reinhard Zumkeller, Nov 01 2013

Examples

			This version of the triangle begins:
  [0] [   1]
  [1] [   0,    1]
  [2] [   1,    1,    0]
  [3] [   0,    1,    2,    2]
  [4] [   5,    5,    4,    2,    0]
  [5] [   0,    5,   10,   14,   16,   16]
  [6] [  61,   61,   56,   46,   32,   16,    0]
  [7] [   0,   61,  122,  178,  224,  256,  272,  272]
  [8] [1385, 1385, 1324, 1202, 1024,  800,  544,  272,    0]
  [9] [   0, 1385, 2770, 4094, 5296, 6320, 7120, 7664, 7936, 7936]
See A008281 and A108040 for other versions.
		

References

  • M. D. Atkinson: Partial orders and comparison problems, Sixteenth Southeastern Conference on Combinatorics, Graph Theory and Computing, (Boca Raton, Feb 1985), Congressus Numerantium 47, 77-88.
  • J. H. Conway and R. K. Guy, The Book of Numbers, Copernicus Press, NY, 1996, p. 110.
  • A. J. Kempner, On the shape of polynomial curves, Tohoku Math. J., 37 (1933), 347-362.
  • A. A. Kirillov, Variations on the triangular theme, Amer. Math. Soc. Transl., (2), Vol. 169, 1995, pp. 43-73, see p. 53.
  • R. P. Stanley, Enumerative Combinatorics, volume 1, second edition, chapter 1, exercise 141, Cambridge University Press (2012), p. 128, 174, 175.

Crossrefs

Cf. A000657 (central terms); A227862.

Programs

  • Haskell
    a008280 n k = a008280_tabl !! n !! k
    a008280_row n = a008280_tabl !! n
    a008280_tabl = ox True a008281_tabl where
      ox turn (xs:xss) = (if turn then reverse xs else xs) : ox (not turn) xss
    -- Reinhard Zumkeller, Nov 01 2013
    
  • Mathematica
    max = 9; t[0, 0] = 1; t[n_, m_] /; n < m || m < 0 = 0; t[n_, m_] := t[n, m] = Sum[t[n-1, n-k], {k, m}]; tri = Table[t[n, m], {n, 0, max}, {m, 0, n}]; Flatten[ {Reverse[#[[1]]], #[[2]]} & /@ Partition[tri, 2]] (* Jean-François Alcover, Oct 24 2011 *)
    T[0,0] := 1; T[n_?OddQ,k_]/;0<=k<=n := T[n,k]=T[n,k-1]+T[n-1,k-1]; T[n_?EvenQ,k_]/;0<= k<=n := T[n,k]=T[n,k+1]+T[n-1,k]; T[n_,k_] := 0; Flatten@Table[T[n,k], {n,0,9}, {k,0,n}] (* Oliver Seipel, Nov 24 2024 *)
  • Maxima
    T(n, m):=abs(sum(binomial(m, k)*euler(n-m+k), k, 0, m)); /* Vladimir Kruchinin, Apr 06 2015 */
  • Python
    # Python 3.2 or higher required.
    from itertools import accumulate
    A008280_list = blist = [1]
    for n in range(10):
        blist = list(reversed(list(accumulate(reversed(blist))))) + [0] if n % 2 else [0]+list(accumulate(blist))
        A008280_list.extend(blist)
    print(A008280_list) # Chai Wah Wu, Sep 20 2014
    
  • Python
    # Uses function seidel from A008281.
    def A008280row(n): return seidel(n) if n % 2 else seidel(n)[::-1]
    for n in range(8): print(A008280row(n)) # Peter Luschny, Jun 01 2022
    
  • Sage
    # Algorithm of L. Seidel (1877)
    # Prints the first n rows of the triangle.
    def A008280_triangle(n) :
        A = {-1:0, 0:1}
        k = 0; e = 1
        for i in range(n) :
            Am = 0
            A[k + e] = 0
            e = -e
            for j in (0..i) :
                Am += A[k]
                A[k] = Am
                k += e
            print([A[z] for z in (-i//2..i//2)])
    A008280_triangle(10) # Peter Luschny, Jun 02 2012
    

Formula

T(n,m) = abs( Sum_{k=0..n} C(m,k)*Euler(n-m+k) ). - Vladimir Kruchinin, Apr 06 2015
E.g.f.: (cos(x) + sin(x))/cos(x+y). - Ira M. Gessel, Nov 18 2024

A261880 Array of higher-order differences of the sequence (-1)^n*A000111(n) read by downward antidiagonals.

Original entry on oeis.org

1, -1, -2, 1, 2, 4, -2, -3, -5, -9, 5, 7, 10, 15, 24, -16, -21, -28, -38, -53, -77, 61, 77, 98, 126, 164, 217, 294, -272, -333, -410, -508, -634, -798, -1015, -1309, 1385, 1657, 1990, 2400, 2908, 3542, 4340, 5355, 6664
Offset: 0

Views

Author

Paul Curtz, Jul 10 2016

Keywords

Comments

Difference array of (-1)^n*A000111(n):
1, -1, 1, -2, 5, ...
-2, 2, -3, 7,...
4, -5, 10, ...
-9, 15, ...
24, ... .
First column:(-1)^n*A000667(n).
Antidiagonal sums: b(n) = 1, -3, 7, -19, 61, -233, 1037, -5279, 30241, ..., i.e., row sums of the triangle.
Any triangle with entries T(n, m) built from some sequence in column m=0, and the recurrence T(n, m) = T(n, m-1) - T(n-1, m-1) for m >= 1, has the property that the new triangle t(n, m) = T(n+1, m+1) - T(n+1, m), 0 <= m <= n, equals -T(n, m). See the question in the example. - Wolfdieter Lang, Aug 08 2016

Examples

			The triangle T(n, m) begins:
n\m  0   1   2   3   4   5 ...
0:   1
1:  -1  -2
2:   1   2   4
3:  -2  -3  -5  -9
4:   5   7  10  15  24,
5: -16 -21 -28 -38 -53 -77
...
Triangle of differences of the row entries of the preceding triangle starting with row n=1:
n\m  0   1    2   3   4 ...
0:  -1
1:   1   2
2:  -1  -2   -4
3:   2   3    5   9
4:  -5  -7  -10 -15 -24
... .
This is the negative of the first triangle. Are there other sequences with the same property?
		

Crossrefs

Formula

Recurrence: T(n, 0) = (-1)^n*A000111(n), n >= 0. T(n, m) = T(n, m-1) - T(n-1, m-1), m >= 1. (from the fact that the differences of the rows, starting with n = 1 produce the negative of the triangle. See the example and a comment). - Wolfdieter Lang, Aug 08 2016

Extensions

Edited by Wolfdieter Lang, Aug 08 2016
Showing 1-3 of 3 results.