I am trying to understand sequence A239738 from OEIS in more detail. Basically it states: Normal distributions from the primes. The contracted sequence of integers generated from the frequencies of the summation of elements of the subsets of the Cartesian product of the natural numbers of ascending prime cardinality. That is, given a number of sets of the natural numbers of ascending modulo P(n+1), the probabilities of generating a given number from the selection of one element from each set forms the given sequence.
In other words, by sets of natural numbers of ascending prime cardinality, it is meant $[N_1] = [1,2]$, $[N_2] = [1,2,3]$, $[N_3] = [1,2,3,4,5]$, $[N_4] = [1,2,3,4,5,6,7]$ ,..., $[N_w] = [1,2,3,...,p_w]$, $p \in {P}$ with Cartesian products $[N_1] \cdot [N_2] = [1,2] \cdot [1,2,3] = [(1,1),(1,2),(1,3),(2,1),(2,2),(2,3))]$, etc.
and the sum of the elements of the product's subsets denoted
$\sum {[[N_1] \cdot [N_2]]} = [(2),(3),(4),(3),(4),(5)]$
whose elements have the frequencies [1,2,2,1] (with respect to magnitude). It is these frequencies that form the sequence, the symmetry allows for the omission of repeated terms, and hence the following contraction halves the data without loss of information:
$[1,1] \to [1]$
$[1,2,2,1] \to [1,2]$
$[1,3,5,6,6,5,3,1] \to [1,3,5,6]$
So the sequence starts $1, 1, 2, 1, 3, 5, 6, 1, 4, 9, 15, 21, 26, 29, 1,...$ and I'm looking for the generation function to calculate more terms of the sequence and do some research. Unfortunately, there is not any formula in formula section. Any ideas to improve the formula section in OEIS?
One more thing, I thought about $\prod_{i}\frac {1-x^{d_i}} {1-x}$, where $d_i$ - Partition numbers $P_n$, number of additive breakdowns of n: $1, 1, 2, 3, 5, 7, 11, 15, 22, 30, 42, ...$ - to get the sequence. For eg. at wolframalpha.com $CoefficientList[(1-x^1)(1-x^1)(1-x^2)(1-x^3)(1-x^5)(1-x^7)(1-x^{11})/(1-x)^7]$ gives the 5th row of the sequence I come across.
However, I am not sure if it is right way or not.
PS. Will other $d_i$ like primes ${2,3,5,7,11,13,17,19,23,29,...}$ suit the sequence? If it's fine, the the max terms should be $1,2,6,29,204,2036,26039,402623,7545900,176297253,...$
I proposed adding the following Mathematica code to OEIS entry A239738.
row[r_]:=Drop[#,-Length[#]/2]&[Transpose[Tally[Total[Tuples[Table[Range[1,Prime[k]],{k,1,r}]],{2}]]][[2]]] (* generates row r of the table *)
Grid@Table[row[r],{r,1,7}] (* generates the table *)
Flatten@Table[row[r],{r,1,7}] (* generates the sequence *)
The second above generates the following grid.
$$\begin{array}{cccccccccccccccccccccccccc} 1 & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} \\ 1 & 2 & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} \\ 1 & 3 & 5 & 6 & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} \\ 1 & 4 & 9 & 15 & 21 & 26 & 29 & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} \\ 1 & 5 & 14 & 29 & 50 & 76 & 105 & 134 & 160 & 181 & 196 & 204 & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} \\ 1 & 6 & 20 & 49 & 99 & 175 & 280 & 414 & 574 & 755 & 951 & 1155 & 1359 & 1554 & 1730 & 1876 & 1981 & 2036 & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} & \text{} \\ 1 & 7 & 27 & 76 & 175 & 350 & 630 & 1044 & 1618 & 2373 & 3324 & 4479 & 5838 & 7392 & 9122 & 10998 & 12979 & 15014 & 17044 & 19005 & 20832 & 22463 & 23842 & 24921 & 25662 & 26039 \\ \end{array}$$
The third above generates the following list.
$$\{1,1,2,1,3,5,6,1,4,9,15,21,26,29,1,5,14,29,50,76,105,134,160,181,196,204,1,6,20,49,99,175,280,414,574,755,951,1155,1359,1554,1730,1876,1981,2036,1,7,27,76,175,350,630,1044,1618,2373,3324,4479,5838,7392,9122,10998,12979,15014,17044,19005,20832,22463,23842,24921,25662,26039\}$$
The function call row[8] generates the following eighth row of the table.
$${1, 8, 35, 111, 286, 636, 1266, 2310, 3928, 6301, 9625, 14104, 19942, \ 27334, 36456, 47454, 60433, 75447, 92491, 111495, 132320, 154756, \ 178522, 203268, 228580, 253989, 278984, 303028, 325576, 346094, \ 364078, 379072, 390685, 398607, 402623}$$
The function call row[9] causes a SystemException["MemoryAllocationFailure"] on my Raspberry Pi 400 which only has 4Gb of memory, but I suspect a few more rows can be generated on a PC which typically has much more memory, and the row[r] function defined above can perhaps be studied and optimized to generate even more rows of the table.
I've verified the conjectured Mathematica code
row[r_]:=Drop[#,-Length[#]/2]&[CoefficientList[1/(1-x)^r Product[(1-x^Prime[i]),{i,1,r}],x]]
against my reference Mathematica code above for $1\le r\le 8$.
I also verified the conjectured Mathematica code above is consistent with the row length
$$l(r)=\frac{1}{2} \left(\sum\limits_{i=1}^r p_i-r+1\right)\tag{1}$$
and row sum
$$\sum\limits_{u=1}^{l(r)} row[r][[u]]=\frac{1}{2} \prod\limits_{i=1}^r p_i\tag{2}$$
specified in the comment section of OEIS entry A239738 where $p_i$ is the $i^{th}$ prime for $1\le r\le 50$. The formula for $l(r)$ seems to be consistent with OEIS entry A005521.
The conjectured Mathematica code above is based on the coefficients of the generating function
$$\frac{1}{(1-x)^r}\prod\limits_{i=1}^r \left(1-x^{p_i}\right)\tag{3}$$
where $p_i$ is the $i^{th}$ prime.
Another generating function which has been proposed for OEIS entry A239738 is
$$\prod\limits_{i=1}^r \frac{1}{x}\sum\limits_{j=1}^{p_i} x^j\tag{4}$$
which seems to simplify to
$$\prod\limits_{i=1}^r \frac{x^{p_i}-1}{x-1}\tag{5}$$
and which seems to be equivalent to the generating function defined in formula (3) above. I've verified the generating functions defined in formulas (3), (4), and (5) above are equivalent for $1\le r\le 50$.
These numerous verifications mentioned above are encouraging with respect to the correctness of the conjectured Mathematica code above which is based on the coefficients of the generating function defined in formula (3) above.
If the conjectured Mathematica code above continues to hold for $r>8$, then it is capable of generating many more rows of OEIS entry A239738 where a few more conjectured rows are listed below. Also, see here for a proposed b-file with the first 20 rows of OEIS entry A239738.
$\begin{array}{cc} \text{r} & \text{Row r} \\ 1 & \{1\} \\ 2 & \{1,2\} \\ 3 & \{1,3,5,6\} \\ 4 & \{1,4,9,15,21,26,29\} \\ 5 & \{1,5,14,29,50,76,105,134,160,181,196,204\} \\ 6 & \{1,6,20,49,99,175,280,414,574,755,951,1155,1359,1554,1730,1876,1981,2036\} \\ 7 & \{1,7,27,76,175,350,630,1044,1618,2373,3324,4479,5838,7392,9122,10998,12979,15014,17044,19005,20832,22463,23842,24921,25662,26039\} \\ 8 & \{1,8,35,111,286,636,1266,2310,3928,6301,9625,14104,19942,27334,36456,47454,60433,75447,92491,111495,132320,154756,178522,203268,228580,253989,278984,303028,325576,346094,364078,379072,390685,398607,402623\} \\ 9 & \{1,9,44,155,441,1077,2343,4653,8581,14882,24507,38611,58553,85887,122343,169797,230230,305677,398168,509663,641983,796739,975261,1178528,1407100,1661054,1939927,2242669,2567609,2912437,3274205,3649349,4033733,4422715,4811234,5193915,5565188,5919417,6251035,6554680,6825327,7058412,7249945,7396609,7495842,7545900\} \\ 10 & \{1,10,54,209,650,1727,4070,8723,17304,32186,56693,95304,153857,239744,362087,531884,762114,1067791,1465959,1975622,2617605,3414344,4389605,5568133,6975233,8636287,10576214,12818883,15386492,18298928,21573124,25222429,29256007,33678281,38488438,43680010,49240545,55151381,61387534,67917707,74704423,81704282,88868340,96142606,103468651,110784321,118024544,125122218,132009164,138617126,144878799,150728865,156105017,160948952,165207315,168832576,171783822,174027447,175537725,176297253\} \\ 11 & \{1,11,65,274,924,2651,6721,15444,32748,64934,121627,216931,370788,610532,972619,1504503,2266617,3334408,4800367,6775989,9393594,12807938,17197543,22765676,29740909,38377196,48953410,61772293,77158785,95457713,117030837,142253265,171509262,205187489,243675718,287355078,336593896,391741207,453120018,521020421,595692658,677340247,766113283,862102032,965330939,1075753173,1193245833,1317605937,1448547310,1585698477,1728601654,1876712914,2029403587,2185962934,2345602116,2507459459,2670606994,2834058227,2996777069,3157687830,3315686155,3469650756,3618455774,3760983589,3896137884,4022856761,4140125703,4246990175,4342567659,4426058924,4496758343,4554063084,4597481020,4626637224,4641278939\} \\ 12 & \{1,12,77,351,1275,3926,10647,26091,58839,123773,245400,462331,833119,1443651,2416270,3920773,6187390,9521798,14322165,21098154,30491748,43299686,60497229,83262905,113003814,151381010,200334420,262106713,339265498,434723211,551754048,694007313,865516575,1070704064,1314379782,1601734860,1938328756,2330069962,2783189969,3304210325,3899902709,4577242032,5343352664,6205447975,7170763470,8246483895,9439664794,10757149104,12205479483,13790807172,15518798294,17394538589,19422437673,21606133990,23948401698,26451060790,29114891795,31939556428,34923525559,38064015846,41356936325,44796846172,48376924750,52088954929,55923320520,59869018496,63913686486,68043645824,72243960218,76498509880,80790080734,85100468100,89410594042,93700637370,97950175102,102138334023,106243950826,110245739188,114122462025,117853107085,121417063977,124794300697,127965537699,130912417569,133617668393,136065258967,138240544079,140130398199,141723336041,143009618609,143981343505,144632518458,144959117226\} \\ \end{array}$