Combination Lock

Author

Eric W. Weisstein
January 16, 2009

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Combinatorics/CombinationLock.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/CombinationLock.html.

©2009 Wolfram Research, Inc. except for portions noted otherwise

Initialization

<<Combinatorica`

CombinationLocks[n_]:=Flatten[Permutations/@Select[Nest[Rest[Subsets[#]]&,n,2],Sort[Flatten[#]]==Range[n]&],1]

Lists of Nonempty Subsets Containing Each Element Once

CombinationLocks[1]

Sort@CombinationLocks[2]//ColumnForm

Sort@CombinationLocks[3]//ColumnForm

Table[Length[CombinationLocks[n]],{n,4}]//Timing

Recurrence Sequence

V5

Sum[Binomial[n,n-i]a[i],{i,0,n-1}]

V7

Sum[Binomial[n,n-i]a[i],{i,0,n-1}]

Derivative

Table[Derivative[n][1/(2-Exp[#])&][0],{n,10}]

Closed Forms

Comparison

FullSimplify[#,Re[n]>0]&/@{(1/2) PolyLog[-n,(1/2)],(1/2) HurwitzLerchPhi[(1/2),-n,0],(1/2) PolyLog[-n,(1/2)]-(1/2) HurwitzLerchPhi[(1/2),-n,0]}

ByteCount/@{(1/2) PolyLog[-n,(1/2)],(1/2) HurwitzLerchPhi[(1/2),-n,0]}

Subtract@@@Table[{(1/2) PolyLog[-n,(1/2)],(1/2) HurwitzLerchPhi[(1/2),-n,0]}/.n->RandomReal[{1,10}],{100}]//Chop//Union

Subtract@@@Table[{(1/2) PolyLog[-n,(1/2)],(1/2) HurwitzLerchPhi[(1/2),-n,0]}/.n->RandomComplex[{-I,I+5}],{100}]//Chop//Union

(1/2)(PolyLog[-n, (1/2)])

Table[(1/2) PolyLog[-n,(1/2)],{n,10}]

(1/2)(HurwitzLerchPhi[(1/2), -n, 0])

Table[(1/2) HurwitzLerchPhi[(1/2),-n,0],{n,10}]

(1/2) (((π (ln2)))^(-n-1)) (i (i^n) (((coth^(-1))(3))^(n+1)) ((PolyGamma2[n, -((i (coth^(-1))(3))/π)])-(((-1))^n) (PolyGamma2[n, ((i (coth^(-1))(3))/π)]))-(π^(n+1)) n!)

Table[-(I^(1+n)) (2^(-2-n)) ((((I ArcCoth[3]))^(-1-n)) n!+(π^(-1-n)) (-PolyGamma[n,-((I ArcCoth[3])/π)]+(((-1))^n) PolyGamma[n,((I ArcCoth[3])/π)])),{n,10}]//FullSimplify

Sums

(1/2) (∑_(k=0)^∞)((k^n)/(2^k))==((PolyLog[-n, (1/2)])/2)==((HurwitzLerchPhi[(1/2), -n, 0])/2)

V5

FullSimplify[1/2Sum[k^n/2^k,{k,0,∞}]]

V7

(1/2)Sum[k^n/2^k,{k,0,∞}]

FullSimplify[%]

(∑_k^n)(2^(n-k)) ⟨({{n}, {k-1}})⟩

Sum[Eulerian[n,k-1]2^(n-k),{k,n}]

Table[Sum[Eulerian[n,k-1]2^(n-k),{k,n}],{n,10}]

Sum[Eulerian[n,k-1]2^(k-1),{k,n}]

Table[Sum[Eulerian[n,k-1]2^(k-1),{k,n}],{n,10}]

(∑_k^n)k! (StirlingS2[n, k])

Sum[k! StirlingS2[n,k],{k,n}]

FullSimplify[%,n∈Integers&&n>0]

Table[-(I^(1+n)) (2^(-2-n)) ((((I ArcCoth[3]))^(-1-n)) n!+(π^(-1-n)) (-PolyGamma[n,-((I ArcCoth[3])/π)]+(((-1))^n) PolyGamma[n,((I ArcCoth[3])/π)])),{n,10}]//FullSimplify

Related sequence b[n]

b[0]:=1
b[n_]:=b[n]=Sum[b[i]Binomial[n,n-i],{i,0,n-1}]

Table[b[i],{i,10}]