dlpg070
发表于 2020-3-6 16:03:14
王守恩 发表于 2020-3-6 10:31
A(n)的头部可以是这样:\((10^{\lceil\log_{10}n\rceil}+1)*n-1\)
后面您是怎么把她们粘在一起的,我 ...
你的公式表示什么,不理解.
我的计算结果:{1, 3, 5, 7, 9, 11, 13, 15, 17, 109}对吗?
你的预期结果是什么?
dlpg070
发表于 2020-3-7 20:36:53
dlpg070 发表于 2020-3-6 16:03
你的公式表示什么,不理解.
我的计算结果:{1, 3, 5, 7, 9, 11, 13, 15, 17, 109}对吗?
你的预期结果是什 ...
利用你的前部的公式和递推公式
可以得到你要求的结果:
aw=1;
aw:=aw=((10^(Ceiling])+1)*n-1)*10^IntegerLength]+aw;
tw=Table,{n,1,13}]
输出:
{1,
211,
32211,
4332211,
544332211,
65544332211,
7665544332211,
877665544332211,
98877665544332211,
10998877665544332211,
111010998877665544332211,
1211111010998877665544332211,
13121211111010998877665544332211}
dlpg070
发表于 2020-3-8 08:42:54
dlpg070 发表于 2020-3-7 20:36
利用你的前部的公式和递推公式
可以得到你要求的结果:
用A最简单,下面是Mathematica代码,验证无误
c++ ,和 Mathematica 数组开始下标不同,公式略有差异
A := A = Sign*(n - Floor);
A := A = Sign*(n - Floor);
tA = Table, {n, 1, 13}, {k, 1, n*2 - 1}];
Column
------
输出:
{1}
{2,1,1}
{3,2,2,1,1}
{4,3,3,2,2,1,1}
{5,4,4,3,3,2,2,1,1}
{6,5,5,4,4,3,3,2,2,1,1}
{7,6,6,5,5,4,4,3,3,2,2,1,1}
{8,7,7,6,6,5,5,4,4,3,3,2,2,1,1}
{9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1}
{10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1}
{11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1}
{12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1}
{13,12,12,11,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1}
王守恩
发表于 2020-3-9 07:37:31
本帖最后由 王守恩 于 2020-3-9 07:54 编辑
dlpg070 发表于 2020-3-8 08:42
用A最简单,下面是Mathematica代码,验证无误
c++ ,和 Mathematica 数组开始下标不同,公式略有 ...
憋了好几天,这个什么“东东”不会用。
A(1)=1
A(2)=1
A(3)=2
A(4)=2+1-1=2
A(5)=2+2-1=3
A(6)=3+2-2=3
A(7)=3+3-2=4
A(8)=4+3-3=4
A(9)=4+4-3=5
........
A(n)=A(n-1)+A(n-2)-A(n-3)
后面您是怎么把她们粘在一起的?
王守恩
发表于 2020-3-9 08:44:34
王守恩 发表于 2020-3-9 07:37
憋了好几天,这个什么“东东”不会用。
A(1)=1
A(2)=1
都可以用吗?
13, 2413, 352413, 46352413, 5746352413, .......
1, 11, 112, 1123, 11235, 112358, 11235813, ......
dlpg070
发表于 2020-3-9 18:17:08
有了A,没必要使用你的数字法
但考虑到你的爱好,憋了好几天,这个什么“东东”不会用
现在用A编码如下
A := A = Sign*(n - Floor);
awA:= awA=Module[{sum=0,ilen=0},
Do])+A,
{k,1,2*n-1}];
sum
];
twa=Table,{n,1,13}];
Column
输出: 与22#相同
1
211
32211
4332211
544332211
65544332211
7665544332211
877665544332211
98877665544332211
10998877665544332211
111010998877665544332211
1211111010998877665544332211
13121211111010998877665544332211
dlpg070
发表于 2020-3-10 09:19:40
本帖最后由 dlpg070 于 2020-3-10 15:00 编辑
1#的我信手按回文展开得到的数列
northwolves 在10# ,11# 给出了通项公式
23# 给出了 A 公式
下面给出我认为有趣的原因,希望专家指点迷津:
1#数列在OEIS中查不到
但是如果在OEIS中查找
给定n的数列 则有许多
例如 n=4: 4,3,3,2,2,1,1
49个结果
对于任意的n(<10),都可以找到,大大意外
它们有什么关系?
------------------
我们看2个典型的数列:
例1:A194543 Triangle T (n, k), n >= 0, 0 <= k <= n,
read by rows :
T (n, k) is the number of partitions of n
into parts p_i such that |p_i - p_j | >= k for i != j.
代码:
Clear["Global`*"]
b:=b=If[n<0,0,If[n==0,1,
Sum,{j,k,n-i}]]];
T:=If+Sum,{i,1,n}];
t=Table,{k,0,n}],{n,0,30}];
(*//Flatten *)
(*Jean-Fran?ois Alcover,Jan 19 2015,after Alois P.Heinz*)
Column
结果
{1}
{1,1}
{2,1,1}
{[3,2,1,1}
{5,2,2,1,1}
{7,3,2,2,1,1}
{11,4,3,2,2,1,1}
{15,5,3,3,2,2,1,1}
{22,6,4,3,3,2,2,1,1}
{30,8,5,4,3,3,2,2,1,1}
{42,10,6,4,4,3,3,2,2,1,1}
{56,12,7,5,4,4,3,3,2,2,1,1}
{77,15,9,6,5,4,4,3,3,2,2,1,1}
{101,18,10,7,5,5,4,4,3,3,2,2,1,1}
{135,22,12,8,6,5,5,4,4,3,3,2,2,1,1}
{176,27,14,10,7,6,5,5,4,4,3,3,2,2,1,1}
{231,32,17,11,8,6,6,5,5,4,4,3,3,2,2,1,1}
{297,38,19,13,9,7,6,6,5,5,4,4,3,3,2,2,1,1}
{385,46,23,15,11,8,7,6,6,5,5,4,4,3,3,2,2,1,1}
{490,54,26,17,12,9,7,7,6,6,5,5,4,4,3,3,2,2,1,1}
{627,64,31,19,14,10,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1}
{792,76,35,22,16,12,9,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1}
{1002,89,41,25,18,13,10,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1}
{1255,104,46,28,20,15,11,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1}
{1575,122,54,32,23,17,13,10,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1}
{1958,142,61,36,25,19,14,11,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1}
{2436,165,70,41,28,21,16,12,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1}
{3010,192,79,46,31,24,18,14,11,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1}
{3718,222,91,52,35,26,20,15,12,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1}
{4565,256,102,58,38,29,22,17,13,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1}
{5604,296,117,66,43,32,25,19,15,12,11,10,10,9,9,8,8,7,7,6,6,5,5,4,4,3,3,2,2,1,1}
包含1#数列的各个子数列,谁能解其中奥妙?
如 2,1,1
3,2,2,1,1
---
10,9,9,8,8,---,2,2,1,1
---
例1:A063995 Irregular triangle read by rows :
T (n, k), n >= 1, -(n - 1) <= k <= n - 1, =
number of partitions of n with rank k
代码:
t=Table-Length[#]&/@IntegerPartitions),#]&/@Range[-k+1,k-1],{k,16}];
Column
Column
结果:
{1}
{1,0,1}
{1,0,1,0,1}
{1,0,1,1,1,0,1}
{1,0,1,1,1,1,1,0,1}
{1,0,1,1,2,1,2,1,1,0,1}
{1,0,1,1,2,1,3,1,2,1,1,0,1}
{1,0,1,1,2,2,3,2,3,2,2,1,1,0,1}
{1,0,1,1,2,2,3,3,4,3,3,2,2,1,1,0,1}
{1,0,1,1,2,2,4,3,5,4,5,3,4,2,2,1,1,0,1}
{1,0,1,1,2,2,4,3,6,5,6,5,6,3,4,2,2,1,1,0,1}
{1,0,1,1,2,2,4,4,6,6,8,7,8,6,6,4,4,2,2,1,1,0,1}
{1,0,1,1,2,2,4,4,6,7,9,8,11,8,9,7,6,4,4,2,2,1,1,0,1}
{1,0,1,1,2,2,4,4,7,7,10,10,13,11,13,10,10,7,7,4,4,2,2,1,1,0,1}
{1,0,1,1,2,2,4,4,7,7,11,11,15,14,16,14,15,11,11,7,7,4,4,2,2,1,1,0,1}
{1,0,1,1,2,2,4,4,7,8,11,12,17,16,20,19,20,16,17,12,11,8,7,4,4,2,2,1,1,0,1}
----------
The partition 5 = 4+1 has largest summand 4 and 2 summands, hence has rank 4-2 = 2.
Triangle begins:
[ 1] 1,
[ 2] 1, 0, 1,
[ 3] 1, 0, 1, 0, 1,
[ 4] 1, 0, 1, 1, 1, 0, 1,
[ 5] 1, 0, 1, 1, 1, 1, 1, 0, 1,
[ 6] 1, 0, 1, 1, 2, 1, 2, 1, 1, 0, 1,
[ 7] 1, 0, 1, 1, 2, 1, 3, 1, 2, 1, 1, 0, 1,
[ 8] 1, 0, 1, 1, 2, 2, 3, 2, 3, 2, 2, 1, 1, 0, 1,
[ 9] 1, 0, 1, 1, 2, 2, 3, 3, 4, 3, 3, 2, 2, 1, 1, 0, 1,
1, 0, 1, 1, 2, 2, 4, 3, 5, 4, 5, 3, 4, 2, 2, 1, 1, 0, 1,
1, 0, 1, 1, 2, ...
这个数列输出对称,含有许多 4,3,3,2,2,1,1等
左侧是反向排列1,1,2,2,3,3,4 等
没想到此数列最新修改 Jan 23 2020
没想到 11 22 33 44 或44 33 22 11 有这么奇妙!
王守恩
发表于 2020-3-10 18:29:59
aimisiyou 发表于 2020-2-25 22:52
没看懂啥意思。
题目看懂了,可以有吗?
A(01)=1
A(02)=112
A(03)=11223
A(04)=1122334
A(05)=112233445
A(06)=11223344556
A(07)=1122334455667
A(08)=112233445566778
A(09)=11223344556677889
A(10)=11223344556677889910
A(11)=112233445566778899101011
A(12)=1122334455667788991010111112
dlpg070
发表于 2020-3-11 07:33:54
本帖最后由 dlpg070 于 2020-3-11 07:35 编辑
王守恩 发表于 2020-3-10 18:29
题目看懂了,可以有吗?
A(01)=1
A(02)=112
当然可以有
参见
https://oeis.org/A004526 Nonnegative integers repeated, floor(n/2).
https://oeis.org/A008619 Positive integers repeated.
王守恩
发表于 2020-3-17 14:19:16
dlpg070 发表于 2020-3-11 07:33
当然可以有
参见
https://oeis.org/A004526 Nonnegative integers repeated, floor(n/2).
跟主帖不太一样,可以有通项公式吗?
A(01)=1
A(02)=112
A(03)=11223
A(04)=1122334
A(05)=112233445
A(06)=11223344556
A(07)=1122334455667
A(08)=112233445566778
A(09)=11223344556677889
A(10)=11223344556677889910
A(11)=112233445566778899101011
A(12)=1122334455667788991010111112