Showing posts with label coefficient. Show all posts
Showing posts with label coefficient. Show all posts

Wednesday, 9 July 2025

Partitions and Generating Functions

I asked Gemini to explain the statement:

“It’s long been known that you can associate
a polynomial equation to any partition.”

Here's what it came up with.

The statement refers to the relationship between an integer partition and a generating function, which is a way of encoding an infinite sequence of numbers as the coefficients of a formal power series. In this context, the "polynomial equation" is more accurately a generating function, which can be represented as a polynomial-like expression.


A partition of a positive integer \(n\) is a way of writing \(n\) as a sum of positive integers. The order of the addends (the parts of the partition) does not matter. For example, the partitions of the number 4 are:

  • 4

  • 3 + 1

  • 2 + 2

  • 2 + 1 + 1

  • 1 + 1 + 1 + 1

The statement means that for any given integer, we can construct a polynomial-like expression (a generating function) that "encodes" all of its possible partitions.

How the Association Works

The connection is established through the concept of generating functions. The generating function for the number of partitions of an integer \(n\), denoted as \( p(n) \), can be expressed as an infinite product:$$P(x) = \sum_{n=0}^{\infty} p(n)x^n = \prod_{k=1}^{\infty} \frac{1}{1-x^k}$$Let's break down this formula:

  • \( p(n) \) This represents the number of partitions for an integer \(n\)

  • \( \displaystyle\sum_{n=0}^{\infty} p(n)x^n \) This is the power series where the coefficient of \(x^n\) is the number of partitions of \(n\).

  • \(\displaystyle\prod_{k=1}^{\infty} \dfrac{1}{1-x^k}\) This is the infinite product that generates these coefficients.


Each term in the product \( \dfrac{1}{1-x^k} \) can be expanded as a geometric series:

  • \(\dfrac{1}{1-x} = 1 + x + x^2 + x^3 + \dots \) This represents using the number 1 as a part in the partition

  • \(\dfrac{1}{1-x^2} = 1 + x^2 + x^4 + x^6 + \dots\) This represents using the number 2 as a part

  • \( \dfrac{1}{1-x^3} = 1 + x^3 + x^6 + x^9 + \dots \) This represents using the number 3 as a part

  • And so on for all integers \(k\).

When you multiply these series together, the coefficient of \(x^n\) in the resulting series will be the total number of ways to form \(n\) by adding these parts.

Examples

Let's find the partitions for the number 3. The partitions are:

  • 3

  • 2 + 1

  • 1 + 1 + 1

There are 3 partitions of 3.


Now, let's see how the generating function gives us this result. We look at the expansion of the product:$$(1 + x + x^2 + x^3 + \dots)(1 + x^2 + x^4 + \dots)(1 + x^3 + x^6 + \dots) \dots$$To get the term \(x^3\), we can combine terms from these expansions in the following ways:

  • From the first factor, take \(x^3\). This corresponds to the partition 1 + 1 + 1.

  • From the first factor, take \(x^1\), and from the second factor, take \(x^2\). This corresponds to the partition 1 + 2.

  • From the third factor, take \(x^3\). This corresponds to the partition 3.


The coefficient of \(x^3\) is therefore 3, which matches the number of partitions.


Here is another example for the partitions of 4, which we know is 5.


To find the coefficient of \(x^4\), we would consider combinations like:

  • \(x^4\) from the first factor: 1 + 1 + 1 + 1

  • \(x^2\) from the first factor and \(x^2\) from the second: 1 + 1 + 2

  • \(x^1\) from the first factor and \(x^3\) from the third: 1 + 3

  • \(x^4\) from the second factor: 2 + 2

  • \(x^4\) from the fourth factor: 4


The total number of ways to get \(x^4\) is 5, so the coefficient is 5.


In essence, the "polynomial" or generating function provides a systematic way to count the number of partitions for any integer by looking at the coefficients of the series expansion.

Thursday, 28 November 2024

A New Take On The Sum Of Digits

Clearly only \(0\) and \(1\) satisfy the equation \(3n=3^n\) but what about the following:$$SOD(3n)=SOD(3^n)$$where SOD stands for the sum of a number's digits. The values of \(n\) that do satisfy are members of OEIS A260906:


A260906: numbers \(n\) such that \(3n\) and \(n^3\) have the same digit sum.

Here are the members of this sequence up to one million:

3, 6, 30, 60, 63, 126, 171, 252, 300, 324, 543, 585, 600, 630, 1260, 1281, 1710, 2520, 2925, 3000, 3240, 5430, 5850, 5946, 6000, 6300, 12600, 12606, 12633, 12810, 14631, 16263, 17100, 21618, 22308, 22971, 24663, 25200, 27633, 28845, 28887, 28965, 29241, 29250, 29625, 29628, 30000, 31752, 32400, 49533, 52308, 54300, 58500, 59460, 60000, 63000, 82962, 89325, 126000, 126060, 126294, 126330, 128100, 132633, 146310, 162630, 171000, 216180, 216558, 223080, 223086, 225333, 229653, 229710, 231633, 233325, 246630, 252000, 258333, 276330, 282333, 283233, 285333, 288450, 288870, 289650, 289656, 292410, 292500, 296250, 296280, 300000, 315333, 317520, 319266, 323328, 324000, 466623, 466653, 493284, 495330, 522333, 523080, 531333, 543000, 546291, 558333, 559665, 585000, 585333, 585972, 594600, 594666, 597333, 600000, 625008, 630000, 636618, 663156, 665325, 666558, 798981, 829620, 888333, 893250

Let's take the last member of the above numbers, 893250:$$ \begin{align} 3 \times 893250 &=2679750 \rightarrow 36 \\ 893250^3 &= 712720211203125000 \rightarrow 36 \end{align}$$One could ask the question as to what values of \(k\) in$$ \text{SOD}(k n) = \text{ SOD}(n^k) $$yield numbers \(n\) that satisfy in the range up to one million? For \(k=2\), there are many and they comprise OEIS A049343:


A049343: numbers \(n\) such that \(2n\) and \(n^2\) have same digit sum.

The initial members are:

0, 2, 9, 11, 18, 20, 29, 38, 45, 47, 90, 99, 101, 110, 119, 144, 146, 180, 182, 189, 198, 200, 245, 290, 299, 335, 344, 351, 362, 369, 380, 398, 450, 452, 459, 461, 468, 470, 479, 488, 495, 497, 639, 729, 794, 839, 848, 900, 929, 954, 990, 999

For example:$$ \begin{align} 2 \times 999 &= 1998 \rightarrow 27\\ 999^2 &=998001 \rightarrow 27 \end{align} $$However for \(k=4\) there are only two values that satisfy (21249 and 212490):$$ \begin{align} 4 \times 21249 &= 84996 \rightarrow 36 \\21249^4 &= 203870311303040001 \rightarrow 36 \\ 4 \times 212490 &= 849960 \rightarrow 36 \\ 212490^4 &= 2038703113030400010000 \rightarrow 36 \end{align} $$In the range up to one million (and probably beyond), no higher values of k satisfy. Oddly for \(k=1/2\), there are 31 values that satisfy in the range up to one million:

4, 324, 400, 1444, 8100, 8464, 26244, 32400, 39204, 40000, 82944, 84100, 142884, 144400, 158404, 202500, 204304, 219024, 220900, 238144, 334084, 422500, 544644, 602176, 627264, 630436, 810000, 842724, 846400, 980100, 984064

For example:$$ \begin{align} \frac{1}{2} \times 984064 &= 492032 \rightarrow 20\\ 984064^{1/2} &= 992 \rightarrow 20 \end{align} $$For \(k=1/3\), there are only three values that satisfy in the range up one million (729, 729000 and 970299). For example:$$ \begin{align} \frac{1}{3} \times 970299 &= 323433 \rightarrow 18\\ 970299^{1/3} &= 99 \rightarrow 18 \end{align} $$So there are fractional values of \(k\), namely 1/2 and 1/3, that satisfy the following as well as the integer values of 1 (trivial), 2, 3 and 4:$$ \text{SOD}(kn) = \text{ SOD}(n^k) $$There are probably other fractional values as well that satisfy but that will do for now.

Wednesday, 21 December 2022

Linear Prime Chains

On Thursday, June 10th of 2019, I posted about Generalised Cunningham Chains while linking to earlier posts that discussed the topic of Cunningham chains. Today I was reminded of these chains because the number associated with my diurnal age has the following property:


 A124017

Numbers \(n\) for which \(2n-1\), \(4n-1\), \(8n-1\), \(16n-1\) and \(32n-1\) are primes.



The initial members of the sequence are:

45, 90, 26820, 26925, 30705, 31710, 33375, 63420, 63570, 71805, 83865, 93075, 103185, 127140, 134025, 148050, 170460, 202635, 211035, 223305, 269505, 297225, 303660, 329175, 335625, 362505, 387975, 405270, 405405, 406425, 409755, 463335

In the case of 26925, the sequence of primes generated is 53849, 107699, 215399, 430799 and 861599. At first I thought the sequence was a Cunningham chain of the second kind with a length of 5. This type of chain has the property that  \(p_{i+1} = 2p_{i} − 1\) for all \(1 \leq i \leq 5 \) but, as can be seen, it is the new number that is doubled and not the original one. In other words, a Cunningham chain of the second kind with a length of 6 and a starting prime of \(p\) would give a sequence of \(p, 2p-1, 4p-3, 8p-7, 16p-15, 32p-31\). Not the same sequence at all.

I was interested in pushing the number of primes further and test for \(64n-1\). Up to one million this yields the following sequence of numbers with their prime chains attached:

45 --> 89 179 359 719 1439 2879 
31710 --> 63419 126839 253679 507359 1014719 2029439 
63570 --> 127139 254279 508559 1017119 2034239 4068479 
202635 --> 405269 810539 1621079 3242159 6484319 12968639 
405405 --> 810809 1621619 3243239 6486479 12972959 25945919 
534600 --> 1069199 2138399 4276799 8553599 17107199 34214399 
561330 --> 1122659 2245319 4490639 8981279 17962559 35925119 
589305 --> 1178609 2357219 4714439 9428879 18857759 37715519 
666945 --> 1333889 2667779 5335559 10671119 21342239 42684479 
799350 --> 1598699 3197399 6394799 12789599 25579199 51158399 
903045 --> 1806089 3612179 7224359 14448719 28897439 57794879 
979125 --> 1958249 3916499 7832999 15665999 31331999 62663999 

How many numbers up to one million will generate primes up to \(128n-1\)? Well as it turns out, only one number. Beyond \(128n-1\), there are no chains in the range up to one million.

561330 --> 1122659 2245319 4490639 8981279 17962559 35925119 71850239 

Just as with generalised Cunningham chains, we can also generalise this particular prime chain sequence by changing the value of the subtrahend. Let's change it to 3 and look for prime chains starting with \(2n-3\) and ending with \(128n-3\). Here's the result and there are seven numbers instead of just one in the range up to one million:

3025 --> 6047 12097 24197 48397 96797 193597 387197 
238865 --> 477727 955457 1910917 3821837 7643677 15287357 30574717 
253880 --> 507757 1015517 2031037 4062077 8124157 16248317 32496637 
477730 --> 955457 1910917 3821837 7643677 15287357 30574717 61149437 
507760 --> 1015517 2031037 4062077 8124157 16248317 32496637 64993277 
680185 --> 1360367 2720737 5441477 10882957 21765917 43531837 87063677 
883180 --> 1766357 3532717 7065437 14130877 28261757 56523517 113047037 

We even get 2 numbers that generate a chain that goes up to \(256n-3\). They are:

238865 --> 477727 955457 1910917 3821837 7643677 15287357 30574717 61149437 
253880 --> 507757 1015517 2031037 4062077 8124157 16248317 32496637 64993277  

There are no numbers in the range that generate primes up to \(512n-1\). Let's try a subtrahend of 5 and see what numbers generate primes in the range from \(2n-5\) up to \(128n-5\). The results are:

 273 --> 541 1087 2179 4363 8731 17467 34939 
 933 --> 1861 3727 7459 14923 29851 59707 119419 
 54558 --> 109111 218227 436459 872923 1745851 3491707 6983419 
 59553 --> 119101 238207 476419 952843 1905691 3811387 7622779 
 65811 --> 131617 263239 526483 1052971 2105947 4211899 8423803 
447678 --> 895351 1790707 3581419 7162843 14325691 28651387 57302779 
887226 --> 1774447 3548899 7097803 14195611 28391227 56782459 113564923 

There are no numbers up to one million that generate primes up to \(256n-5\). What about a subtrahend of 7 and a range from \(2n-7\) to \(128n-7\)? The results are:

27360 --> 54713 109433 218873 437753 875513 1751033 3502073 
517875 --> 1035743 2071493 4142993 8285993 16571993 33143993 66287993 
524805 --> 1049603 2099213 4198433 8396873 16793753 33587513 67175033 
549915 --> 1099823 2199653 4399313 8798633 17597273 35194553 70389113 
749580 --> 1499153 2998313 5996633 11993273 23986553 47973113 95946233 

There are no numbers that generate chains up to \(256n-7\). I think that's enough for the subtrahends but what about the coefficients? We could generalise further by looking at even coefficients larger than 2. If we choose odd coefficients, then every odd number will produce an even number when an odd subtrahend is subtracted. Let's try \(4n-11\) in the range up to \(256n-11\). The results are:

187123 --> 748481 2993957 11975861 47903477 191613941 766455797 3065823221 12263292917 
363375 --> 1453489 5813989 23255989 93023989 372095989 1488383989 5953535989 23814143989 
426040 --> 1704149 6816629 27266549 109066229 436264949 1745059829 6980239349 27920957429 
723330 --> 2893309 11573269 46293109 185172469 740689909 2962759669 11851038709 47404154869 

The reason that 187123 is marked in red is that it is the only starting number that is prime. This of course is rather interesting. All the other long chains are generated by composite numbers. Here is a permalink that allows for experimentation with prime chains generated by a number \(n\) using the linear mapping of \(a \cdot n-b\) where \(a\) and \(b\) are integers.

For a post that has relevance to the content of this post, visit Prime Producing Linear Polynomials. After all, what I've been investigating in this post is simply a variety of prime producing linear polynomials of the general from \(y=ax+b\) where \(a,b\) and \(x\) are restricted to integer values.