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

A033504 a(n)/4^n is the expected number of tosses of a coin required to obtain n+1 heads or n+1 tails.

Original entry on oeis.org

1, 10, 66, 372, 1930, 9516, 45332, 210664, 960858, 4319100, 19188796, 84438360, 368603716, 1598231992, 6889682280, 29551095248, 126193235194, 536799072924, 2275560109868, 9616650989560, 40527780684972, 170368957887656, 714556104675736, 2990728476330672
Offset: 0

Views

Author

Michael Ulm (ulm(AT)mathematik.uni-ulm.de)

Keywords

Comments

The number of rooted two-vertex n-edge maps in the plane (planar with a distinguished outside face). - Valery A. Liskovets, Mar 17 2005

Examples

			From _Jeremy Tan_, Mar 13 2018: (Start)
For n=1 the sequences of flips ending at two heads or two tails are:
HH, TT (probability 1/4 each)
HTH, HTT, THH, THT (1/8 each)
The expected number of flips is 2*2*1/4 + 3*4*1/8 = 10/4 = a(1)/4^1. (End)
		

References

  • M. Klamkin, ed., Problems in Applied Mathematics: Selections from SIAM Review, SIAM, 1990; see pp. 127-129.
  • V. A. Liskovets and T. R. Walsh, Enumeration of unrooted maps on the plane, Rapport technique, UQAM, No. 2005-01, Montreal, Canada, 2005.

Crossrefs

Programs

  • Magma
    [(n+1)*(2^(2*n+1)-Binomial(2*n+1,n+1)): n in [0..25]]; // Vincenzo Librandi, Jun 09 2011
  • Mathematica
    a[n_]:=(n+1)*(2^(2*n+1)-Binomial[2*n+1,n+1])
    a /@ Range[0,50] (* Julien Kluge, Jul 21 2016 *)

Formula

With a different offset: Sum_{j=0..n} Sum_{k=0..n} binomial(n, j)*binomial(n, k)*min(j, k) = n*2^(n-1) + (n/2)*binomial(2*n, n). [see Klamkin]
a(n-1) = 4^(n-1)*b(n, n), where b(n, m) = b(n-1, m)/2 + b(n, m-1)/2 + 1; b(n, 0)=b(0, n)=0.
a(n) = Sum_{k=0..n, l=0..n} 2^(2n - k - l) binomial(k+l, k).
a(n) = (2n+1)*Sum_{0<=i,j<=n} binomial(2n, i+j)/(i+j+1). - Benoit Cloitre, Mar 05 2005
a(n) = (n+1)*(2^(2*n+1) - binomial(2*n+1,n+1)). - Vladeta Jovovic, Aug 23 2007
n*a(n) + 6*(-2*n+1)*a(n-1) + 48*(n-1)*a(n-2) + 32*(-2*n+3)*a(n-3) = 0. - R. J. Mathar, Dec 22 2013
a(n) ~ 2^(2*n+1)*n. - Ilya Gutkovskiy, Jul 21 2016

Extensions

Name corrected by Jeremy Tan, Mar 13 2018

A201385 Irregular triangle T(n,k) (n >= 1, k >= 1) read by rows: T(n,1) = 2^n - 1; for k>1, T(n,k) = 0 for n <= 2*(k-1); otherwise T(n+1,k) = T(n,k-1) + T(n,k).

Original entry on oeis.org

1, 3, 7, 3, 15, 10, 31, 25, 10, 63, 56, 35, 127, 119, 91, 35, 255, 246, 210, 126, 511, 501, 456, 336, 126, 1023, 1012, 957, 792, 462, 2047, 2035, 1969, 1749, 1254, 462, 4095, 4082, 4004, 3718, 3003, 1716, 8191, 8177, 8086, 7722, 6721, 4719, 1716
Offset: 1

Views

Author

Jonathan Vos Post, Nov 30 2011

Keywords

Comments

A "Pascal Staircase".
The zero entries simplify the definition, but are not part of the official triangle.

Examples

			Triangle begins:
    1
    3
    7   3
   15  10
   31  25 10
   63  56 35
  127 119 91 35
  ...
		

Crossrefs

Columns k = 1, 2, 3 give A000225, A000247, A272352(n+1).
Row sums give A130783.

Programs

  • Mathematica
    With[{rowmax=20},DeleteCases[Transpose[PadLeft[NestWhileList[Accumulate[#[[2;;-2]]]&,2^Range[rowmax]-1,Length[#]>2&]]],0,2]] (* Paolo Xausa, Nov 07 2023 *)

Extensions

Entry revised by N. J. A. Sloane, Nov 07 2023

A327845 Number of permutations of {1,2,...,n} such that for every k >= 1, the k-th differences are distinct.

Original entry on oeis.org

1, 2, 4, 12, 40, 132, 428, 1668, 7628, 36924, 199000, 1161824, 7231332
Offset: 1

Views

Author

Peter Kagey, Sep 27 2019

Keywords

Comments

a(n) <= A131529(n).

Examples

			For n = 5 the a(5) = 40 solutions are one of following ten permutations, or a reversal, complement, or reversal and complement of one of these permutations:
[1,3,4,2,5]
[1,4,3,5,2]
[1,4,5,3,2]
[1,5,2,4,3]
[1,5,3,2,4]
[2,1,4,5,3]
[2,1,5,3,4]
[2,3,5,1,4]
[2,4,1,5,3]
[2,5,4,1,3]
As a non-example, [1,5,4,2,3] does not satisfy the k-th differences property, because while its first differences ([4,-1,-2,1]) and its second differences ([-5,-1,3]) are distinct, its third differences ([4,4]) are not.
		

Crossrefs

Extensions

a(11) from Giovanni Resta, Sep 29 2019
a(12)-a(13) from Freddy Barrera, Oct 07 2019

A329851 Sum of absolute values of n-th differences over all permutations of {0, 1, ..., n}.

Original entry on oeis.org

0, 2, 12, 120, 1320, 17856, 273056, 4772624, 92626944, 1986317024, 46556867456, 1184827221584, 32524270418432, 958020105786536
Offset: 0

Views

Author

Peter Kagey, Nov 22 2019

Keywords

Comments

a(n) <= ((n+1)! - 2*A131502(n))*A130783(n).
Every term is even because the n-th difference of a permutation and its reversal are the same up to sign.

Examples

			For n = 2, the second differences of the (2+1)! = 6 permutations of {0,1,2} are:
[0,1,2] ->  [1, 1] ->  0,
[0,2,1] ->  [2,-1] -> -3,
[1,0,2] -> [-1, 2] ->  3,
[1,2,0] ->  [1,-2] -> -3,
[2,0,1] -> [-2, 1] ->  3, and
[2,1,0] -> [-1,-1] ->  0.
The sum of the absolute values of these second differences is 0 + 3 + 3 + 3 + 3 + 0 = 12.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Block[{x, k}, k = CoefficientList[(x - 1)^n, x]; Sum[Abs[k.p], {p, Permutations@ Range[0, n]}]]; Array[a, 10, 0] (* Giovanni Resta, Nov 23 2019 *)
  • Python
    from math import comb
    from itertools import permutations
    def A329851(n):
        c = [-comb(n,i) if i&1 else comb(n,i) for i in range(n+1)]
        return sum(abs(sum(c[i]*p[i] for i in range(n+1))) for p in permutations(range(n+1)) if p[0]Chai Wah Wu, Jun 04 2024

Extensions

a(10) from Alois P. Heinz, Nov 22 2019
a(11)-a(13) from Giovanni Resta, Nov 23 2019
Showing 1-4 of 4 results.