A364857 a(n) = n^n/E, where E is the expected number of rolls of a fair n-sided die before obtaining 3 consecutive strictly increasing rolls.
1, 15, 225, 3781, 72078, 1550016, 37259191, 991980099, 29008029501, 924873082849, 31944725060988, 1188568865803032, 47403638535874501, 2017753008682107135, 91309129890388047873, 4377769140759352823773, 221687675024545322612226
Offset: 3
Keywords
Crossrefs
Cf. A000312.
Programs
-
Mathematica
a[n_]:=Module[{O,I,M},O=ConstantArray[1,{n,n}];I=IdentityMatrix[n]; M=LowerTriangularize[O]; Det[nI-M+MatrixPower[M,2]/n-O.M/n]]; Table[a[i],{i,3,19}] (* Robert P. P. McKone, Aug 12 2023 *) A[n_]:=I (n+1)/Sqrt[3]; B[n_]:=I Sqrt[3]/2; a[n_]:=(n-1+A[n])/2(n-1/2+B[n])^(n-1) + (n-1-A[n])/2(n-1/2-B[n])^(n-1); Simplify[Table[a[n],{n,3,19}]] (* Stefano Spezia, Aug 23 2023 *)
-
Python
def a(n): A,B = n-1,n*(n-2) for i in range(n-2): A,B = B,(2*n-1)*B-(n*n-n+1)*A return B
Formula
a(n) = (n-1+A)/2(n-1/2+B)^(n-1) + (n-1-A)/2(n-1/2-B)^(n-1), where A=i*(n+1)/sqrt(3) and B=i*(sqrt(3)/2).
a(n) = f(n), where f(2) = n-1, f(3) = n*(n-2) and f(m+1) = (2n-1)*f(m)-(n^2-n+1)*f(m-1).
Comments