Combinatorics

I published a paclet to the Paclet repository you can install by evaluating PacletInstall[“PeterBurbery/Combinatorics”]. The paclet autoloads so you don’t need to do Needs[“PeterBurbery`Combinatorics”]. I study combinatorics. Therefore, I am a combinatorialist.
I have created two guide pages. One guide page includes all the functions. The other guide page highlights functions I understand in particular. I added some functions I do not really understand like Hasse diagram. I left these out of the guide page for functions I understand.
This paclet is based on many ResourceFunctions created by other people.
In[]:=
PacletInstall["PeterBurbery/Combinatorics"]
Out[]=
PacletObject
Name: PeterBurbery/Combinatorics
Version: 2.0.18

In[]:=
Names["PeterBurbery`Combinatorics`*"]
Out[]=
{CanonicalMultiset,CentralBinomialCoefficient,ConjugatePartition,DescendingSublists,DivisorHasseDiagram,DominatingIntegerPartitionQ,DurfeeSquare,EnumerateMultisetPartialDerangements,EulerianCatalanNumber,EulerianNumber,EulerianNumberOfTheSecondKind,FerrersDiagram,Fibbinary,FibonacciEncode,FrobeniusSymbolFromPartition,FromInversionVector,GaussFactorial,GrayCode,HasseDiagram,HookLengths,HuffmanCodeWords,HuffmanDecode,HuffmanEncode,IntegerPartitionQ,InverseFibonacci,InverseGrayCode,InversionCount,InversionVectorQ,LehmerCodeFromIndex,LehmerCodeFromPermutation,LucasNumberU1,LucasNumberV2,ModifiedCentralBinomialCoefficient,Multichoose,MultisetAssociation,MultisetCardinality,MultisetPartialDerangements,NarayanaNumber,NextPermutation,NumberOfTableaux,OrderedTupleFromIndex,OrderedTupleIndex,OrderlessCombinations,OrderlessCombinationsOfUnmarkedElements,PartialOrderGraphQ,PartitionCrank,PartitionFromFrobeniusSymbol,PartitionRank,PermutationAscents,PermutationCountByInversions,PermutationDescents,PermutationFromIndex,PermutationFromLehmerCode,PermutationGraph,PermutationIndex,PermutationMajorIndex,PermutationToTableaux,Phitorial,PosetQ,PosetToTableau,Primorial,QExponential,QMultinomial,RandomSelfConjugatePartition,RandomYoungTableau,RationalNumberRepeatingDecimalPeriod,ReflexiveGraphQ,SecantNumber,SelectPermutations,SelectSubsets,SelectTuples,SelfConjugatePartitionQ,SignedLahNumber,StandardYoungTableaux,SubsetFromIndex,SubsetIndex,TableauQ,TableauToPoset,TableauxToPermutation,TangentNumber,ToInversionVector,TransitiveGraphQ,TransposeTableau,TupleFromIndex,TupleIndex,UnsignedLahNumber,ZeckendorfRepresentation}
Real quick, I will see which ones are on the Function Repository.
In[]:=
ResourceFunction["HuffmanEncode"]
Out[]=
[◼]
HuffmanEncode
In[]:=
ResourceFunction["ResourceFunctionThatDoesNotExist"]
ResourceObject
:The ResourceObject ResourceFunctionThatDoesNotExist could not be found.
Out[]=
$Failed
In[]:=
FailureQ[ResourceFunction["ResourceFunctionThatDoesNotExist"]]
ResourceObject
:The ResourceObject ResourceFunctionThatDoesNotExist could not be found.
Out[]=
True
In[]:=
Quiet[FailureQ[ResourceFunction["ResourceFunctionThatDoesNotExist"]]]
Out[]=
True
In[]:=
Quiet[FailureQ[ResourceFunction["ResourceFunctionThatDoesNotExist"]],ResourceObject::notfname]
Out[]=
True
In[]:=
Not[Quiet[FailureQ[ResourceFunction["ResourceFunctionThatDoesNotExist"]],ResourceObject::notfname]]
Out[]=
False
In[]:=
resourceFunctionsInPaclet=Select[Not[Quiet[FailureQ[ResourceFunction[#]],ResourceObject::notfname]]&][Names["PeterBurbery`Combinatorics`*"]]
Out[]=
{ConjugatePartition,DescendingSublists,DivisorHasseDiagram,DominatingIntegerPartitionQ,EulerianNumber,FerrersDiagram,Fibbinary,FibonacciEncode,FrobeniusSymbolFromPartition,FromInversionVector,GrayCode,HasseDiagram,HookLengths,HuffmanCodeWords,HuffmanDecode,HuffmanEncode,IntegerPartitionQ,InverseFibonacci,InverseGrayCode,InversionCount,InversionVectorQ,LehmerCodeFromPermutation,MultisetCardinality,NextPermutation,NumberOfTableaux,OrderedTupleFromIndex,OrderedTupleIndex,OrderlessCombinations,PartialOrderGraphQ,PartitionCrank,PartitionFromFrobeniusSymbol,PartitionRank,PermutationAscents,PermutationCountByInversions,PermutationFromIndex,PermutationGraph,PermutationIndex,PermutationMajorIndex,PermutationToTableaux,PosetQ,PosetToTableau,Primorial,RandomYoungTableau,ReflexiveGraphQ,SelectPermutations,SelectSubsets,SelectTuples,StandardYoungTableaux,SubsetFromIndex,SubsetIndex,TableauQ,TableauToPoset,TableauxToPermutation,ToInversionVector,TransitiveGraphQ,TransposeTableau,TupleFromIndex,TupleIndex,ZeckendorfRepresentation}
In[]:=
ResourceObject["ConjugatePartition"]
Out[]=
ResourceObject
Name: ConjugatePartition
»
Type: Function
Description: Switch the rows and columns of a partition

In[]:=
Dataset[ResourceObject["ConjugatePartition"][All]]
Out[]=
Attributes
{}
AutoUpdate
Automatic
Categories
{Higher Mathematical Computation,Discrete Mathematics,Number Theory}
Compatibility
WolframLanguageVersionRequired10.0
ContributorInformation
PublisherIDGeorge Beck,DisplayNameGeorge Beck,PublisherSlugGeorgeBeck,ContributedByWolfram Staff
Details
DocumentationLink
https://resources.wolframcloud.com/FunctionReposit...
DownloadedVersion
None
FunctionLocation
CloudObject[
https://www.wolframcloud.com/obj/0860023c-2b58-419c-bc94-046a3a8d2a77
]
LicensingInformation

MyAccount
False
Originator
—
PublisherUUID
050bc8dd-0ceb-4b97-b056-855c16c66f85
RelatedSymbols
{PartitionsP,PartitionsQ,IntegerPartitions,Transpose}
ReleaseDate
Fri 31 May 2019
SeeAlso
{IntegerPartitionQ,FerrersDiagram,TableauQ,TransposeTableau}
ShortName
ConjugatePartition
SourceMetadata

SymbolName
FunctionRepository`$ef8b5caadb184deb80169ee6b8a698b8`ConjugatePartition
WolframLanguageVersionRequired
10.0
rows 10–29 of 29
In[]:=
Dataset[ResourceObject["ConjugatePartition"][All]]["ContributorInformation"]
Out[]=
PublisherID
George Beck
DisplayName
George Beck
PublisherSlug
GeorgeBeck
ContributedBy
Wolfram Staff
In[]:=
Dataset[List/@resourceFunctionsInPaclet]
Out[]=
ConjugatePartition
DescendingSublists
DivisorHasseDiagram
DominatingIntegerPartitionQ
EulerianNumber
FerrersDiagram
Fibbinary
FibonacciEncode
FrobeniusSymbolFromPartition
FromInversionVector
GrayCode
HasseDiagram
HookLengths
HuffmanCodeWords
HuffmanDecode
HuffmanEncode
IntegerPartitionQ
InverseFibonacci
InverseGrayCode
InversionCount
rows 1–20 of 59
In[]:=
AssociationMap[Dataset[ResourceObject[#][All]]["ContributorInformation"]&][resourceFunctionsInPaclet]
Out[]=
ConjugatePartition
PublisherID
George Beck
DisplayName
George Beck
PublisherSlug
GeorgeBeck
ContributedBy
Wolfram Staff
,DescendingSublists
PublisherID
George Beck
DisplayName
George Beck
PublisherSlug
GeorgeBeck
ContributedBy
George Beck
,DivisorHasseDiagram
PublisherID
shenghuiyang
DisplayName
Shenghui Yang
PublisherSlug
ShenghuiYang
ContributedBy
Shenghui Yang (Wolfram Research)
,DominatingIntegerPartitionQ
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Wolfram Staff (original content by Sriram V. Pemmaraju and Steven S. Skiena)
,EulerianNumber
PublisherID
George Beck
DisplayName
George Beck
PublisherSlug
GeorgeBeck
ContributedBy
Wolfram Staff
,FerrersDiagram
PublisherID
George Beck
DisplayName
George Beck
PublisherSlug
GeorgeBeck
ContributedBy
Wolfram Staff
,Fibbinary
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Wolfram Staff, based on work by Jörg Arndt, Robert G. Wilson and Eric W. Weisstein
,FibonacciEncode
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Wolfram Staff (original content by Stephen Wolfram)
,FrobeniusSymbolFromPartition
PublisherID
George Beck
DisplayName
George Beck
PublisherSlug
GeorgeBeck
ContributedBy
George Beck
,FromInversionVector
PublisherID
George Beck
DisplayName
George Beck
PublisherSlug
GeorgeBeck
ContributedBy
Wolfram Staff
,GrayCode
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Wolfram Staff
,HasseDiagram
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Wolfram Staff (original content by Sriram V. Pemmaraju and Steven S. Skiena)
,HookLengths
PublisherID
George Beck
DisplayName
George Beck
PublisherSlug
GeorgeBeck
ContributedBy
George Beck
,HuffmanCodeWords
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Wolfram Staff (original content by Stephen Wolfram)
,HuffmanDecode
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Wolfram Staff (original content by Stephen Wolfram)
,HuffmanEncode
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Wolfram Staff (original content by Stephen Wolfram)
,IntegerPartitionQ
PublisherID
George Beck
DisplayName
George Beck
PublisherSlug
GeorgeBeck
ContributedBy
Wolfram Staff
,InverseFibonacci
PublisherID
carlwoll
DisplayName
Carl Woll
PublisherSlug
CarlWoll
ContributedBy
Carl Woll
,InverseGrayCode
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Jan Mangaldan
,InversionCount
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Wolfram Staff (original content by Sriram V. Pemmaraju and Steven S. Skiena)
,InversionVectorQ
PublisherID
George Beck
DisplayName
George Beck
PublisherSlug
GeorgeBeck
ContributedBy
Wolfram Staff
,LehmerCodeFromPermutation
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Ed Pegg Jr
,MultisetCardinality
PublisherID
RobertNachbar
DisplayName
Robert Nachbar
PublisherSlug
RobertNachbar
ContributedBy
Robert B. Nachbar (Wolfram Solutions)
,NextPermutation
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Sriram V. Pemmaraju, Steven S. Skiena and Wolfram Staff
,NumberOfTableaux
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Ed Pegg Jr and Steven Skiena
,OrderedTupleFromIndex
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Ed Pegg Jr
,OrderedTupleIndex
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Ed Pegg Jr
,OrderlessCombinations
PublisherID
Jon McLoone
DisplayName
Jon McLoone
PublisherSlug
JonMcLoone
ContributedBy
Jon McLoone
,PartialOrderGraphQ
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Wolfram Staff (original content by Sriram V. Pemmaraju and Steven S. Skiena)
,PartitionCrank
PublisherID
George Beck
DisplayName
George Beck
PublisherSlug
GeorgeBeck
ContributedBy
George Beck
,PartitionFromFrobeniusSymbol
PublisherID
George Beck
DisplayName
George Beck
PublisherSlug
GeorgeBeck
ContributedBy
George Beck
,PartitionRank
PublisherID
George Beck
DisplayName
George Beck
PublisherSlug
GeorgeBeck
ContributedBy
George Beck
,PermutationAscents
PublisherID
George Beck
DisplayName
George Beck
PublisherSlug
GeorgeBeck
ContributedBy
Wolfram Staff
,PermutationCountByInversions
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Wolfram Staff (original content by Sriram V. Pemmaraju and Steven S. Skiena)
,PermutationFromIndex
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Ed Pegg Jr
,PermutationGraph
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Wolfram Staff (original content by Sriram V. Pemmaraju and Steven S. Skiena)
,PermutationIndex
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Ed Pegg Jr
,PermutationMajorIndex
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Wolfram Staff (original content by Sriram V. Pemmaraju and Steven S. Skiena)
,PermutationToTableaux
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Ed Pegg Jr and Steven Skiena
,PosetQ
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Ed Pegg Jr
,PosetToTableau
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Ed Pegg Jr
,Primorial
PublisherID
SHuisman
DisplayName
SHuisman
ContributedBy
Sander Huisman
,RandomYoungTableau
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Wolfram Staff
,ReflexiveGraphQ
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Wolfram Staff (original content by Sriram V. Pemmaraju and Steven S. Skiena)
,SelectPermutations
PublisherID
SHuisman
DisplayName
SHuisman
ContributedBy
Sander Huisman
,SelectSubsets
PublisherID
SHuisman
DisplayName
SHuisman
ContributedBy
Sander Huisman
,SelectTuples
PublisherID
SHuisman
DisplayName
SHuisman
ContributedBy
Sander Huisman
,StandardYoungTableaux
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Jan Mangaldan
,SubsetFromIndex
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Ed Pegg Jr
,SubsetIndex
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Ed Pegg Jr
,TableauQ
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Ed Pegg Jr and Steven Skiena
,TableauToPoset
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Ed Pegg Jr
,TableauxToPermutation
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Ed Pegg Jr and Steven Skiena
,ToInversionVector
PublisherID
George Beck
DisplayName
George Beck
PublisherSlug
GeorgeBeck
ContributedBy
Wolfram Staff
,TransitiveGraphQ
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Wolfram Staff (original content by Sriram V. Pemmaraju and Steven S. Skiena)
,TransposeTableau
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Ed Pegg Jr and Steven Skiena
,TupleFromIndex
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Ed Pegg Jr
,TupleIndex
PublisherID
Wolfram
DisplayName
Wolfram Research
ContributedBy
Ed Pegg Jr
,ZeckendorfRepresentation
PublisherID
George Beck
DisplayName
George Beck
PublisherSlug
GeorgeBeck
ContributedBy
Wolfram Staff

Here’s some more information.
I will demonstrate how to use this
How many did I create?
Here’s some more information.
If you accumulate some of the duplicate entries it might be a little different.

Solving Project Euler Problems

Here's a neat application of this function. We can use this to solve Project Euler Problem 24 Lexicographic Permutations. What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9?
Now we need to subtract 1. 10 will become 9 and 1 will become 0.
Now we can use FromDigits.
And that's the answer!
Find the sum of even-valued Fibonacci numbers less than 4 million.
Compute the inverse Fibonacci of 4 million.
Now we can solve Project Euler Problem 2 Even Fibonacci Numbers.
That's the answer.
This isn’t the best way to do this. The best way is probably a closed form solution of the analytic inverse of the sum of even-valued Fibonacci numbers less than a number.
Let's work through the examples from the Wolfram Challenge Next Permutation.
Here are more examples.
For some reason, although I have a function that can compute the next permutation, I have not solved this Wolfram Challenge.
I am afraid this post is going to be removed swiftly because I mentioned how to solve a Wolfram Challenge....
A triangular table of Gauss factorials up to 7::
Make a grid with a frame:
Phitorial of 10:
Compute the answer mod 1000000007:
This is how I solved Project Euler Problem 26 Reciprocal Cycles.
Make a list for the first 1000 numbers.