dlpg070
发表于 2019-5-23 17:23:10
dlpg070 发表于 2019-5-19 11:23
转贴一段代码
为一起解除你的疑惑,
试着分析一下第二句代码的运行过程,供你理解代码时参考
nn=8
2^i +2^j+2^k{i, 2, nn}, {j, 1, i - 1}, {k, 0, j - 1}
a1 = 7, 2^2 +2^1 +2^0 (i=2,j=1,k=0)
a2 = 11, 2^3 +2^1 +2^0 (i=3,j=1,k=0)
a3 = 13, 2^3 +2^2 +2^0 (i=3,j=2,k=0)
a4 = 14, 2^3 +2^2 +2^1 (i=3,j=2,k=1)
a5 = 19, 2^4 +2^1 +2^0 (i=4,j=1,k=0)
a6 = 21, 2^4 +2^2 +2^0 (i=4,j=2,k=0)
a7 = 22, 2^4 +2^2 +2^1 (i=4,j=2,k=1)
a8 = 25, 2^4 +2^3 +2^0 (i=4,j=3,k=0)
a9 = 26, 2^4 +2^3 +2^1 (i=4,j=3,k=1)
a10= 28, 2^4 +2^3 +2^2 (i=4,j=3,k=2)
---
依此循环直到指定的i最大值nn
dlpg070
发表于 2019-5-24 22:09:32
本帖最后由 dlpg070 于 2019-5-24 22:16 编辑
dlpg070 发表于 2019-5-23 17:23
为一起解除你的疑惑,
试着分析一下第二句代码的运行过程,供你理解代码时参考
nn=8
关于a(n)的算式:
多数数列没有解析式,,显函数
此数列a(n)没有解析式,显函数
但 A014311给出2个a(n)的关系式,隐函数
1 a(n)的关系式,隐函数: A000120(a(n)) = 3.
2 a(n)的递推关系式:a(n+1) = A057168(a(n)). - M. F. Hasler, Aug 27 2014
下面给出利用A000120求A014311的例子: A000120=3 对应 A014311
A000120 = {0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1,2, 2, 3, 2,3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 1, 2, 2]
A000120序号n= {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34]
A014311 = { 7, 11, 13, 14, 19, 21, 22, 25, 26, 28, ]
A014311序号n= { 1, 2, 3,4, 5, 6,7, 8,9, 10, ]
下面代码可以求任意第n项的数值 a(n)
(* 求 an*)
Clear["Global`*"]
f := f = Count, 1];
id = 0;
idmax = 10;
idmax = Input["求第n项的an,输入项数n"];
x = 1;
out = 0;
While[id < idmax,
If == 3, id = id + 1; out = x];
x += 1
]
Print["n=", idmax, " an=", out]
下面代码可以求数列的前n项 a(n)
(* 求 前n项 *)
Clear["Global`*"]
f := f = Count, 1];
an = {};
id = 0;
idmax = 10;
idmax = Input["求前n项,输入项数n:"];
x = 1;
out = 0;
While[id < idmax,
If == 3, id = id + 1; out = x; AppendTo];
x += 1
]
Print["n=", idmax, " an=", out, "\n清单:"]
an
王守恩
发表于 2019-9-19 06:59:45
本帖最后由 王守恩 于 2019-9-19 14:03 编辑
dlpg070 发表于 2019-5-24 22:09
关于a(n)的算式:
多数数列没有解析式,,显函数
此数列a(n)没有解析式,显函数
甲乙分别从 1~(n+1) 与 1~n 中取 3 个不同的整数,a(n) 为甲数之和大于乙数之和的取法种数。
3, 27, 126, 423, 1151, 2705, 5704, 11063, 20074, 34499, 56671, 89606, 137125, 203986,
296025, 420309, 585297, 801012, 1079223, 1433637, 1880100, 2436810, 3124538, 3966860,
4990399, 6225077, 7704376, 9465611, 11550211, 14004011, 16877554, 20226403, 24111462,
28599309, 33762537, 39680106, 46437705, 54128124, 62851635, 72716385, 83838797, 96343982,
110366161, 126049097, 143546536, 163022660, 184652548, 208622648,.............
\(\D a(n)=\sum_{k=6}^{3n }\bigg(\sum_{i=\lceil\frac{k+3}{3}\rceil}^{\min(n+1,k-3)}\sum_{j=\lceil\frac{k-i+1}{2}\rceil}^{\min(i-1,k-i-1)}1\bigg)
\sum_{k=6}^{k-1}\bigg(\sum_{i=\lceil\frac{k+3}{3}\rceil}^{\min(n,k-3)}\sum_{j=\lceil\frac{k-i+1}{2}\rceil}^{\min(i-1,k-i-1)}1\bigg)\)
王守恩
发表于 2019-9-19 11:34:44
本帖最后由 王守恩 于 2019-9-19 12:23 编辑
dlpg070 发表于 2019-5-24 22:09
关于a(n)的算式:
多数数列没有解析式,,显函数
此数列a(n)没有解析式,显函数
用\(\D f_{k}(n)\ \)表示\(\ \D x_{1}+2x_{2}+3x_{3}+\cdots\cdots+kx_{k}=n\ \)的非负整数解的个数。
\(\D f_{1}(n)=\coefficientlist\big[\series\big[\prod_{i=1}^1\ \frac{1}{1-x^i},\ (x,\0,\n)\big],\ x\big]\)
\(\D f_{1}(n)=1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1\)
\(\D f_{2}(n)=\coefficientlist\big[\series\big[\prod_{i=1}^2\ \frac{1}{1-x^i},\ (x,\0,\n)\big],\ x\big]\)
\(\D f_{2}(n)=1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15\)
\(\D f_{3}(n)=\coefficientlist\big[\series\big[\prod_{i=1}^3\ \frac{1}{1-x^i},\ (x,\0,\n)\big],\ x\big]\)
\(\D f_{3}(n)=1, 1, 2, 3, 4, 5, 7, 8, 10, 12, 14, 16, 19, 21, 24, 27, 30, 33, 37, 40, 44, 48, 52, 56, 61, 65, 70\)
\(\D f_{4}(n)=\coefficientlist\big[\series\big[\prod_{i=1}^4\ \frac{1}{1-x^i},\ (x,\0,\n)\big],\ x\big]\)
\(\D f_{4}(n)=1, 1, 2, 3, 5, 6, 9, 11, 15, 18, 23, 27, 34, 39, 47, 54, 64, 72, 84, 94, 108, 120, 136, 150, 169\)
\(\D f_{5}(n)=\coefficientlist\big[\series\big[\prod_{i=1}^5\ \frac{1}{1-x^i},\ (x,\0,\n)\big],\ x\big]\)
\(\D f_{5}(n)=1, 1, 2, 3, 5, 7, 10, 13, 18, 23, 30, 37, 47, 57, 70, 84, 101, 119, 141, 164, 192, 221, 255, 291\)
\(\D f_{6}(n)=\coefficientlist\big[\series\big[\prod_{i=1}^6\ \frac{1}{1-x^i},\ (x,\0,\n)\big],\ x\big]\)
\(\D f_{6}(n)=1, 1, 2, 3, 5, 7, 11, 14, 20, 26, 35, 44, 58, 71, 90, 110, 136, 163, 199, 235, 282, 331, 391, 454\)
\(\D f_{7}(n)=\coefficientlist\big[\series\big[\prod_{i=1}^7\ \frac{1}{1-x^i},\ (x,\0,\n)\big],\ x\big]\)
\(\D f_{7}(n)=1, 1, 2, 3, 5, 7, 11, 15, 21, 28, 38, 49, 65, 82, 105, 131, 164, 201, 248, 300, 364, 436, 522, 618\)
\(\D f_{8}(n)=\coefficientlist\big[\series\big[\prod_{i=1}^8\ \frac{1}{1-x^i},\ (x,\0,\n)\big],\ x\big]\)
\(\D f_{8}(n)=1, 1, 2, 3, 5, 7, 11, 15, 22, 29, 40, 52, 70, 89, 116, 146, 186, 230, 288, 352, 434, 525, 638, 764\)
\(\D f_{9}(n)=\coefficientlist\big[\series\big[\prod_{i=1}^9\ \frac{1}{1-x^i},\ (x,\0,\n)\big],\ x\big]\)
\(\D f_{9}(n)=1, 1, 2, 3, 5, 7, 11, 15, 22, 30, 41, 54, 73, 94, 123, 157, 201, 252, 318, 393, 488, 598, 732, 887\)
dlpg070
发表于 2019-9-21 12:26:32
本帖最后由 dlpg070 于 2019-9-21 12:27 编辑
王守恩 发表于 2019-9-19 06:59
甲乙分别从 1~(n+1) 与 1~n 中取 3 个不同的整数,a(n) 为甲数之和大于乙数之和的取法种数。
3, 27 ...
请复查公式是否有手误,我无法验算
a(5)= 126?实际排一下
王守恩
发表于 2019-9-21 14:19:09
dlpg070 发表于 2019-9-21 12:26
请复查公式是否有手误,我无法验算
a(5)= 126?实际排一下
数列:1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,.........
\(通项公式:\D\bigg\lfloor\frac{e/2}{ e - (1 + 1/n)^n}\bigg\rfloor\)
dlpg070
发表于 2019-9-21 15:45:40
王守恩 发表于 2019-9-19 11:34
用\(\D f_{k}(n)\ \)表示\(\ \D x_{1}+2x_{2}+3x_{3}+\cdots\cdots+kx_{k}=n\ \)的非负整数解的个数。
...
114#的9个数列OEIS都有,整理如下(前引导0可能不同)
f1(n)= A000012 The simplest sequence of positive numbers: the all 1's sequence.
f2(n)= A004526 Nonnegative integers repeated, floor(n/2).
f3(n)= A001399 a(n) = number of partitions of n into at most 3 parts; also partitions of n+3 in which the greatest part is 3; also number of unlabeled multigraphs with 3 nodes and n edges.
f4(n)= A026810 Number of partitions of n in which the greatest part is 4.
f5(n)= A001401 Number of partitions of n into at most 5 parts.
f6(n)= A026812 Number of partitions of n in which the greatest part is 6.
f7(n)= A026813 Number of partitions of n in which the greatest part is 7.
A008636 Number of partitions of n into at most 7 parts.
f8(n)= A026814 Number of partitions of n in which the greatest part is 8.
f9(n)= A026815 Number of partitions of n in which the greatest part is 9.
dlpg070
发表于 2019-9-21 15:49:29
本帖最后由 dlpg070 于 2019-9-21 15:50 编辑
王守恩 发表于 2019-9-21 14:19
数列:1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, ...
116# 这是哪来的数列?说明什么?
王守恩
发表于 2019-9-22 15:28:24
本帖最后由 王守恩 于 2019-9-22 18:42 编辑
dlpg070 发表于 2019-9-21 12:26
请复查公式是否有手误,我无法验算
a(5)= 126?实际排一下
\D a(n)=\sum_{k=6}^{3n }\bigg(\sum_{i=\lceil\frac{k+3}{3}\rceil}^{\min(n+1,k-3)}\sum_{j=\lceil\frac{k-i+1}{2}\rceil}^{\min(i-1,k-i-1)}1\bigg)
\sum_{k=6}^{k-1}\bigg(\sum_{i=\lceil\frac{k+3}{3}\rceil}^{\min(n,k-3)}\sum_{j=\lceil\frac{k-i+1}{2}\rceil}^{\min(i-1,k-i-1)}1\bigg)
a(n)=\sum_{k=6}^{3n }(\sum_{i=\lceil\frac{k+3}{3}\rceil}^{\min(n+1,k-3)}\sum_{j=\lceil\frac{k-i+1}{2}\rceil}^{\min(i-1,k-i-1)}1)
\sum_{k=6}^{k-1}(\sum_{i=\lceil\frac{k+3}{3}\rceil}^{\min(n,k-3)}\sum_{j=\lceil\frac{k-i+1}{2}\rceil}^{\min(i-1,k-i-1)}1)
Table[\!\(\*UnderoverscriptBox[\(\\), \(k = 6\), \(3n\)]
\(\((\*UnderoverscriptBox[\(\\), \(i = Ceiling[\*FractionBox[\(k + 3\), \(3\)]]\), \(Min\)]
\(\*UnderoverscriptBox[\(\\), \(j = Ceiling[\*FractionBox[\(k - i + 1\), \(2\)]]\), \(Min\)]1\))\)
\(\*UnderoverscriptBox[\(\\), \(k = 6\), \(k - 1\)]
\((\*UnderoverscriptBox[\(\\), \(i = Ceiling[\*FractionBox[\(k + 3\), \(3\)]]\), \(Min\)]
\(\*UnderoverscriptBox[\(\\), \(j = Ceiling[\*FractionBox[\(k - i + 1\), \(2\)]]\), \(Min\)]1\))\)\)\)\), {n, 3, 50}]
dlpg070
发表于 2019-9-23 10:13:19
本帖最后由 dlpg070 于 2019-9-23 10:16 编辑
王守恩 发表于 2019-9-19 06:59
甲乙分别从 1~(n+1) 与 1~n 中取 3 个不同的整数,a(n) 为甲数之和大于乙数之和的取法种数。
3, 27 ...
116# 的数列和公式很新颖,OEIS没有录入
我看不懂,提出2个疑点,认为是你的手误
经过几天讨论,问题没有解决,
再深入谈一下
疑点1 a(x)是否正确? 你只要给出你的公式原始10项结果就清楚了 a(1)--- a(10) ,是 3,27,126,---吗
疑点2 按题意,数列是 3,27,126,---吗,希望不按公式,按题意具体排一下,特别是 第3项是126吗
这是你的强项, 你没有回应
现在给出我的初步分析计算结果:
a(1)=0
a(2)=1
a(3)=3
a(4)=27
a(5)=127(不是 126, 似乎以后数列都不对了,不只是手误而已)
---
但愿我错了,请认真算一算
必要时我可以给出 127项的清单,请你审查