Joseph Likar, <a href="/A345165/b345165_1.txt">Table of n, a(n) for n = 0..1000</a>
Joseph Likar, <a href="/A345165/b345165_1.txt">Table of n, a(n) for n = 0..1000</a>
reviewed
approved
proposed
reviewed
editing
proposed
From Joseph Likar, Aug 21 2023: (Start)
This sequence can be generated by the following pseudo code:
outputMap[2 to n] = n
for usedNumbers = 2 to n
for medianSize = ceil(usedNumbers / 2) + 1 to usedNumbers - 1
for medianValue = 1 to floor((n - usedNumbers + medianSize) / medianSize)
for numbersAboveMedian = 0 to usedNumbers - medianSize
calculateState(usedNumbers, medianSize, medianValue, numbersAboveMedian)
next numbersAboveMedian
next medianValue
next medianSize
if (usedNumbers mod 2 == 1)
for medianValue = 2 to Math.floor((n - usedNumbers + ceil(usedNumbers / 2))/ceil(usedNumbers / 2))
for numbersAboveMedian = 1 to usedNumbers - ceil(usedNumbers / 2) - 1
calculateState(usedNumbers, ceil(usedNumbers / 2), medianValue, numbersAboveMedian)
next numbersAboveMedian
next medianValue
endif
next usedNumbers
function calculateState(usedNumbers, medianSize, medianValue, numbersAboveMedian)
numbersBelowMedian = usedNumbers - medianSize - numbersAboveMedian)
bottomQTerms = gaussianBinomial(numbersBelowMedian + (medianValue - 1) - 1, numbersBelowMedian)
topQTerms = gaussianBinomial(n - 1 - 2 * numbersAboveMedian, numbersAboveMedian)
for bottomOffset = 0 to length(bottomQTerms) - 1
for topOffset = 0 to length(topQTerms) - 1
partitionSum = bottomOffset + topOffset + numbersBelowMedian + (medianSize * medianValue) + (numbersAboveMedian * (medianValue + 1));
if (partitionSum <= n)
outputMap[partitionSum] += bottomQTerms[bottomOffset] * topQTerms[topOffset]
next topOffset
next bottomOffset
end
where gaussianBinomial(m, n) takes the Gaussian Binomial (m choose n)_q and returns a zero-indexed array where each value in the array is the coefficient of q^index in the Gaussian binomial expansion. (End)
Joseph Likar, <a href="/A345165/a345165.java.txt">Java Implementation</a> using QBinomials
proposed
editing
editing
proposed
0, 0, 1, 1, 2, 2, 5, 5, 8, 11, 17, 20, 29, 37, 51, 65, 85, 106, 141, 175, 223, 277, 351, 432, 540, 663, 820, 999, 1226, 1489, 1817, 2192, 2654, 3191, 3847, 4603, 5517, 6578, 7853, 9327, 11084, 13120, 15533, 18328, 21621, 25430, 29905, 35071, 41111, 48080, 56206, 65554, 76420, 88918, 103394, 120015, 139214, 161222, 186593, 215632, 249006, 287165, 330938, 380888, 438075, 503255, 577713, 662459
From Joseph Likar, Aug 21 2023: (Start)
where gaussianBinomial(m, n) takes the Gaussian Binomial (m choose n)_q and returns a zero-indexed array where each value in the array is the coefficient of q^index in the Gaussian binomial expansion. (End)
Terms a(26)-a(1000) onwards by Joseph Likar, Aug 21 2023
proposed
editing
editing
proposed
0, 0, 1, 1, 2, 2, 5, 5, 8, 11, 17, 20, 29, 37, 51, 65, 85, 106, 141, 175, 223, 277, 351, 432, 540, 663, 820, 999, 1226, 1489, 1817, 2192, 2654, 3191, 3847, 4603, 5517, 6578, 7853, 9327, 11084, 13120, 15533, 18328, 21621, 25430, 29905, 35071, 41111, 48080, 56206, 65554, 76420, 88918, 103394, 120015, 139214, 161222, 186593, 215632, 249006, 287165, 330938, 380888, 438075, 503255, 577713, 662459
This sequence can be generated by the following pseudo code:
outputMap[2 to n] = n
for usedNumbers = 2 to n
for medianSize = ceil(usedNumbers / 2) + 1 to usedNumbers - 1
for medianValue = 1 to floor((n - usedNumbers + medianSize) / medianSize)
for numbersAboveMedian = 0 to usedNumbers - medianSize
calculateState(usedNumbers, medianSize, medianValue, numbersAboveMedian)
next numbersAboveMedian
next medianValue
next medianSize
if (usedNumbers mod 2 == 1)
for medianValue = 2 to Math.floor((n - usedNumbers + ceil(usedNumbers / 2))/ceil(usedNumbers / 2))
for numbersAboveMedian = 1 to usedNumbers - ceil(usedNumbers / 2) - 1
calculateState(usedNumbers, ceil(usedNumbers / 2), medianValue, numbersAboveMedian)
next numbersAboveMedian
next medianValue
endif
next usedNumbers
function calculateState(usedNumbers, medianSize, medianValue, numbersAboveMedian)
numbersBelowMedian = usedNumbers - medianSize - numbersAboveMedian)
bottomQTerms = gaussianBinomial(numbersBelowMedian + (medianValue - 1) - 1, numbersBelowMedian)
topQTerms = gaussianBinomial(n - 1 - 2 * numbersAboveMedian, numbersAboveMedian)
for bottomOffset = 0 to length(bottomQTerms) - 1
for topOffset = 0 to length(topQTerms) - 1
partitionSum = bottomOffset + topOffset + numbersBelowMedian + (medianSize * medianValue) + (numbersAboveMedian * (medianValue + 1));
if (partitionSum <= n)
outputMap[partitionSum] += bottomQTerms[bottomOffset] * topQTerms[topOffset]
next topOffset
next bottomOffset
end
where gaussianBinomial(m, n) takes the Gaussian Binomial (m choose n)_q and returns a zero-indexed array where each value in the array is the coefficient of q^index in the Gaussian binomial expansion.
Joseph Likar, <a href="/A345165/b345165_1.txt">Table of n, a(n) for n = 0..1000</a>
nonn,more
nonn
Terms a(26)-a(1000) by Joseph Likar, Aug 21 2023
approved
editing