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

A366451 The sum s > n which has the greatest probability of occurring when summing rolls of an n-sided die.

Original entry on oeis.org

4, 6, 8, 9, 11, 13, 15, 16, 18, 20, 21, 23, 25, 27, 28, 30, 32, 34, 35, 37, 39, 40, 42, 44, 46, 47, 49, 51, 52, 54, 56, 58, 59, 61, 63, 64, 66, 68, 70, 71, 73, 75, 76, 78, 80, 82, 83, 85, 87, 88, 90, 92, 94, 95, 97, 99, 101, 102, 104, 106, 107, 109, 111, 113
Offset: 2

Views

Author

Keywords

Comments

A player chooses a target t > n and rolls a fair n-sided die repeatedly, keeping a running total of the numbers rolled. The player wins if t occurs in the sequence of running totals. a(n) is the choice of t that maximizes the probability of winning
A fair die with sides numbered 1 through n is assumed.
For given n, sum s occurs by adding one die role to a sum s-n .. s-1; so the probability p(s) of s occurring is p(s) = Sum_{i=1..n} p(s-i)*(1/n), i.e., the mean of the preceding n probabilities, and starting from p(0) = 1 for s=0 always occurring and p(s) = 0 for s < 0 never occurring.
It is immediately apparent upon plotting the probabilities from sum s = n+1 onwards that the highest probability is achieved at s = a(n).
It can be shown that, given the equation of n < s <= 2n, the maximum near a(n) is the only zero of the first derivative, and the second derivative is always negative, therefore any following probability must necessarily be less the maximum of the previous n probabilities, and therefore less than p(a(n)). Therefore any subsequent terms must then be less than p(a(n)). Because this is appending a rolling average of the previous n terms the probabilities dampen in their oscillations about a value of 2/(n+1).

Examples

			For n=20, the probability of occurrence p(s) of sum s > n begins at p(21) = 0.08266... and rises to p(35) = 0.09767... before decreasing to p(36) = 0.09760... and never reaches p(35) again, so a(20) = 35 is the sum s with greatest probability of occurrence.
           s     p(s)
          --  ----------
          21  0.08266...
          ...
          34  0.09751...
  a(20) = 35  0.09767... <--- maximum probability
          36  0.09760...
          ...
          42  0.09350...
		

Crossrefs

Programs

  • Mathematica
    A366451[n_] := Floor[(n+1)^(n+1)/n^n] - n; Array[A366451, 100, 2] (* Paolo Xausa, Oct 12 2024 *)
  • Python
    from fractions import Fraction
    a = lambda n: int(Fraction((n+1)*(n+1)**n-n**(n+1),n**n))

Formula

For n < s < 2n, the probability of sum s occurring is p(s) = ((n+1)^(s-1) - s*n^n*(n+1)^(s-n-2))/n^s, which means that, from the difference between s and s-1, the sequence value is given by:
a(n) = floor(((n+1)*(n+1)^n - n^(n+1))/n^n).
a(n) = A060644(n) - n.
An empirical observation is that a(n) is well approximated by (e-1)*(n+1/2).
From Javier Múgica, May 01 2025: (Start)
Taylor expansion of the maximum of p(s) gives a(n) ~ (e-1)*(n+1/2) - (e-2)/(24n).
The maximum for s > 2n is attained at s ~ (e-sqrt(-e^2+2e+2))*n, approx. 2.5*n. In general, the position of the maximum for s > kn is given by an algebraic equation in s and e of degree k in each of them. (End)

A069322 Square array read by antidiagonals of floor[(n+k)^(n+k)/(n^n*k^k)].

Original entry on oeis.org

1, 1, 1, 1, 4, 1, 1, 6, 6, 1, 1, 9, 16, 9, 1, 1, 12, 28, 28, 12, 1, 1, 14, 45, 64, 45, 14, 1, 1, 17, 65, 119, 119, 65, 17, 1, 1, 20, 89, 198, 256, 198, 89, 20, 1, 1, 23, 117, 307, 484, 484, 307, 117, 23, 1, 1, 25, 149, 449, 837, 1024, 837, 449, 149, 25, 1, 1, 28, 184, 629
Offset: 0

Views

Author

Henry Bottomley, Mar 14 2002

Keywords

Comments

T(n,k)*sqrt(3)/(n*k*Pi) provides a rough approximation for A067059.
a(n,k) is an analog of the binomial coefficients over transformations instead of permutations. - Chad Brewbaker, Nov 25 2013

Examples

			Rows start: 1,1,1,1,1,1,...; 1,4,6,9,12,14,...; 1,6,16,28,45,65,...; 1,9,28,64,119,198,...; etc. T(3,5)=floor[8^8/(3^3*5^5)]=floor[16777216 /84375]=floor[198.84...]=198.
		

Crossrefs

Initial columns and rows are A000012 and A060644, main diagonal is A000302.

Programs

  • Mathematica
    t[n_, 0] := 1; t[n_, n_] := 1; t[n_, k_] := Floor[(n^n)/((k^k)*((n - k)^(n - k)))];  Table[t[n, k], {n, 0, 20}, {k, 0, n}] // Flatten (* G. C. Greubel, Apr 22 2018 *)
  • PARI
    for(n=0,15, for(k=0,n, print1(if(k==0, 1, if(k==n,1,floor((n^n)/(( k^k)*((n - k)^(n - k)))))), ", "))) \\ G. C. Greubel, Apr 22 2018
  • Ruby
    def transitorial(n)
        return n**n
    end
    def transnomial(n,k)
           return transitorial(n)/(transitorial(k) *transitorial(n-k))
    end
    0.upto(15) do |i|
       0.upto(i) do |j|
           print transnomial(i,j).to_s + " "
       end
       puts ""
    end # Chad Brewbaker, Nov 25 2013
    

Formula

a(n,k) = (n^n) /((k^k)*((n-k)^(n-k))). - Chad Brewbaker, Nov 25 2013

A184588 floor[(n+1/2)*e/(e-1)].

Original entry on oeis.org

2, 3, 5, 7, 8, 10, 11, 13, 15, 16, 18, 19, 21, 22, 24, 26, 27, 29, 30, 32, 34, 35, 37, 38, 40, 41, 43, 45, 46, 48, 49, 51, 52, 54, 56, 57, 59, 60, 62, 64, 65, 67, 68, 70, 71, 73, 75, 76, 78, 79, 81, 83, 84, 86, 87, 89, 90, 92, 94, 95, 97, 98, 100, 102, 103, 105, 106, 108, 109, 111, 113, 114, 116, 117, 119, 121, 122, 124, 125, 127, 128, 130, 132, 133, 135, 136, 138, 140, 141, 143, 144, 146, 147, 149, 151, 152, 154, 155, 157, 158, 160, 162, 163, 165, 166, 168, 170, 171, 173, 174, 176, 177, 179, 181, 182, 184, 185, 187, 189, 190
Offset: 1

Views

Author

Clark Kimberling, Jan 17 2011

Keywords

Comments

The complement of A184588 appears to be A060644.

Crossrefs

Cf. A060644.

Programs

  • Mathematica
    r=E; c=1/2; s=r/(r-1);
    Table[Floor[n*r-c*r],{n,1,120}] (* A060644? *)
    Table[Floor[n*s+c*s],{n,1,120}]  (* A184588 *)

Formula

a(n)=floor[(n+1/2)*e/(e-1)].

A062458 Nearest integer to (n+1)^(n+1)/n^n.

Original entry on oeis.org

1, 4, 7, 9, 12, 15, 18, 20, 23, 26, 29, 31, 34, 37, 39, 42, 45, 48, 50, 53, 56, 58, 61, 64, 67, 69, 72, 75, 77, 80, 83, 86, 88, 91, 94, 96, 99, 102, 105, 107, 110, 113, 116, 118, 121, 124, 126, 129, 132, 135, 137, 140, 143, 145, 148, 151, 154, 156, 159, 162, 164
Offset: 0

Views

Author

Olivier Gérard, Jun 23 2001

Keywords

Crossrefs

Cf. A060644.

Programs

  • Mathematica
    Join[{1},Table[Round[(1+n)^(1+n)/n^n],{n,60}]] (* Harvey P. Dale, Aug 24 2025 *)
  • PARI
    a(n)=if(n<1,1,round(exp(1)*(n+1/2-1/24/n))) \\ Benoit Cloitre, Apr 24 2008

Formula

For n>0: a(n)=round(exp(1)*(n+1/2-1/24/n)). Coming from: (n+1)^(n+1)/n^n=exp(1)*(n+1/2-1/24/n)+O(1/n^2) - Benoit Cloitre, Apr 24 2008

Extensions

Previous Mathematica program replaced by Harvey P. Dale, Aug 24 2025

A078111 a(n) = floor((n+2)^(n+2)/n^n).

Original entry on oeis.org

4, 27, 64, 115, 182, 263, 359, 470, 596, 736, 891, 1061, 1246, 1445, 1660, 1889, 2132, 2391, 2664, 2953, 3256, 3573, 3906, 4253, 4615, 4992, 5384, 5790, 6211, 6647, 7098, 7563, 8044, 8539, 9049, 9573, 10113, 10667, 11236, 11820, 12418, 13031, 13659
Offset: 0

Views

Author

Benoit Cloitre, Dec 03 2002

Keywords

Crossrefs

Cf. A060644.

Programs

Formula

a(n) - e^2(n+1)^2 is bounded. Conjecture: there's a constant c = 2.462... such that a(n) = floor(e^2*(n+1)^2-c).
I believe (n+2)^(n+2)/n^n = e^2(n^2 + 2n + 2/3 + o(1)), so the conjecture should be correct (with perhaps finitely many exceptions) with c = e^2/3 = 2.463.... - Charles R Greathouse IV, May 07 2013
Showing 1-5 of 5 results.