[go: up one dir, main page]

login
Revision History for A345165 (Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing entries 1-10 | older changes
Number of integer partitions of n without an alternating permutation.
(history; published version)
#22 by OEIS Server at Wed Sep 06 13:24:17 EDT 2023
LINKS

Joseph Likar, <a href="/A345165/b345165_1.txt">Table of n, a(n) for n = 0..1000</a>

#21 by Andrew Howroyd at Wed Sep 06 13:24:17 EDT 2023
STATUS

reviewed

approved

Discussion
Wed Sep 06
13:24
OEIS Server: Installed first b-file as b345165.txt.
#20 by Michel Marcus at Wed Sep 06 13:02:57 EDT 2023
STATUS

proposed

reviewed

#19 by Joseph Likar at Wed Sep 06 12:52:31 EDT 2023
STATUS

editing

proposed

#18 by Joseph Likar at Wed Sep 06 12:52:25 EDT 2023
COMMENTS

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)

LINKS

Joseph Likar, <a href="/A345165/a345165.java.txt">Java Implementation</a> using QBinomials

STATUS

proposed

editing

#17 by Michel Marcus at Mon Aug 21 11:43:15 EDT 2023
STATUS

editing

proposed

Discussion
Tue Aug 29
14:10
Joseph Likar: Any word on whether to include it or not?
Wed Sep 06
01:36
Joerg Arndt: rather upload as file; but then: pseudo code is almost always wrong (at least mine is).  The (real) code you are using would be much better!
#16 by Michel Marcus at Mon Aug 21 11:41:25 EDT 2023
DATA

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

COMMENTS

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)

EXTENSIONS

Terms a(26)-a(1000) onwards by Joseph Likar, Aug 21 2023

STATUS

proposed

editing

Discussion
Mon Aug 21
11:42
Michel Marcus: Usual size for data, so fixed extension
11:43
Michel Marcus: If pseudocode to be kept here, it must be signed; an alternative would be to upload a text file; let's see what others say
#15 by Joseph Likar at Mon Aug 21 11:09:08 EDT 2023
STATUS

editing

proposed

#14 by Joseph Likar at Mon Aug 21 10:54:21 EDT 2023
DATA

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

COMMENTS

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.

#13 by Joseph Likar at Mon Aug 21 10:06:07 EDT 2023
LINKS

Joseph Likar, <a href="/A345165/b345165_1.txt">Table of n, a(n) for n = 0..1000</a>

KEYWORD

nonn,more

nonn

EXTENSIONS

Terms a(26)-a(1000) by Joseph Likar, Aug 21 2023

STATUS

approved

editing

Discussion
Mon Aug 21
10:07
Joseph Likar: I have a formula to generate terms, but it is quite lengthy. Also the program I used generates all the the a(n)'s simultaneously rather than explicitly in the form a(n). Should I try to add it?