找回密码
 欢迎注册
楼主: 王守恩

[原创] 数字串的通项公式

 火... [复制链接]
 楼主| 发表于 2023-12-8 17:37:35 | 显示全部楼层
northwolves 发表于 2023-12-4 20:01
{8, 1, 7, 8, 1, 7, 8, 1, 7, 8, 1, 7, 8, 1, 7, 8, 1, 7, 8, 1, 7, 8, 1, 7, 8, 1, 7, 8, 1, 7}

下面这串数可以出来,再下面这串数应该怎样出来?
                                        {{1}},
                                      {{2, 1}},
                                    {{2, 3, 2}},
                                  {{3, 4, 4, 2}},
                                {{3, 6, 7, 6, 3}},
                            {{4, 8, 12, 12, 7, 3}},
                       {{4, 11, 18, 22, 17, 10, 3}},
                     {{5, 13, 27, 37, 36, 25, 12, 4}},
                  {{5, 17, 37, 59, 67, 56, 34, 15, 4}},
             {{6, 20, 50, 89, 117, 115, 85, 46, 17, 4}},
        {{6, 24, 66, 130, 193, 218, 187, 122, 59, 21, 5}},
     {{7, 28, 84, 183, 303, 386, 381, 291, 171, 75, 24, 5}},
{{7, 33, 106, 252, 459, 649, 723, 635, 437, 233, 94, 28, 6}}

  1. Table[Abs[n!/(k! (n - k)!)*Round[(n - k)!/E] - Round[n!/k!*1/E]], {n, 3, 15}, {k, 2, n - 1}] // MatrixForm
复制代码

                    {{0}},0=2+1-3,
                  {{1, 1}},1=2+3-4,1=3+2-4,
                {{1, 1, 0}},1=3+4-6,1=4+4-7,0=4+2-6,
              {{1, 1, 1, 2}},1=3+6-8,1=6+7-12,1=7+6-12,2=6+3-7,
            {{1, 2, 2, 2, 0}},1=4+8-11,2=8+12-18,2=12+12-22,2=12+7-17,0=7+3-10,
          {{2, 2, 3, 3, 2, 1}},
        {{1, 3, 5, 6, 5, 3, 1}},
      {{2, 4, 7, 9, 8, 5, 3, 2}},
  {{2, 4, 9, 13, 14, 13, 9, 4, 0}},

点评

我不会用”链接“  发表于 2023-12-8 20:39
nyy
吐死了老同志,你不能给我一个450楼的链接吗?  发表于 2023-12-8 20:05
nyy
不懂你在450楼的留言  发表于 2023-12-8 17:56
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2023-12-8 18:10:41 | 显示全部楼层
一个很丑的公式:
$y(n,k)=(-1)^{k+n} \left(\frac{(n+1)! \text{Round}\left[\frac{(n-k)!}{e}\right]}{(k+1)! (n-k)!}+\frac{(n+2)! \text{Round}\left[\frac{(-k+n+1)!}{e}\right]}{(k+1)! (-k+n+1)!}+\text{Round}\left[\frac{(n+1)!}{e k!}\right]-\text{Round}\left[\frac{(n+1)!}{e (k+1)!}\right]-\text{Round}\left[\frac{(n+2)!}{e (k+1)!}\right]-\frac{(n+1)! \text{Round}\left[\frac{(-k+n+1)!}{e}\right]}{k! (-k+n+1)!}\right)$

  1. y[n_,k_]:=(-1)^(k+n) ( -Round[(1+n)!/(E (1+k)!)]+Round[(1+n)!/(E k!)]-Round[(2+n)!/(E (1+k)!)]+((1+n)! Round[(-k+n)!/E])/((1+k)! (-k+n)!)-((1+n)! Round[(1-k+n)!/E])/(k! (1-k+n)!)+((2+n)! Round[(1-k+n)!/E])/((1+k)! (1-k+n)!))
复制代码


{0}
{1,1}
{1,1,0}
{1,1,1,2}
{1,2,2,2,0}
{2,2,3,3,2,1}
{1,3,5,6,5,3,1}
{2,4,7,9,8,5,3,2}
{2,4,9,13,14,13,9,4,0}
{2,6,13,20,25,24,18,10,5,2}
{2,6,15,27,40,44,37,25,13,5,1}
{3,8,20,39,60,73,72,57,34,16,6,2}
{2,9,25,53,89,120,131,115,82,46,20,7,2}

毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2023-12-9 11:11:14 | 显示全部楼层
northwolves 发表于 2023-12-8 18:10
一个很丑的公式:
$y(n,k)=(-1)^{k+n} \left(\frac{(n+1)! \text{Round}\left[\frac{(n-k)!}{e}\right]}{(k ...

这个程应该怎样编?EulerGamma=0.57721566...

Abs[EulerGamma-1/2]<(1/10)^1    (2是最小的)
Abs[EulerGamma-4/7]<(1/10)^2     (7是最小的)
Abs[EulerGamma-15/26]<(1/10)^3   (26是最小的)
Abs[EulerGamma-71/123]<(1/10)^4    (123是最小的)
Abs[EulerGamma-157/272]<(1/10)^5
Abs[EulerGamma-228/395]<(1/10)^6
Abs[EulerGamma-2579/4468]<(1/10)^7
Abs[EulerGamma-3035/5258]<(1/10)^8
Abs[EulerGamma-15403/26685]<(1/10)^9
Abs[EulerGamma-33841/58628]<(1/10)^10

得到一串数(OEIS没有):  1,4,15,71,157,228,2579,3035,......
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2023-12-9 17:04:03 | 显示全部楼层
王守恩 发表于 2023-12-9 11:11
这个程应该怎样编?EulerGamma=0.57721566...

Abs[EulerGamma-1/2]
  1. f[n_]:=Do[If[Abs[EulerGamma-t/Round[t/EulerGamma]]<1/10^n,Return[t]],{t,f[n-1],\[Infinity]}];Table[f[n],{n,12}]
复制代码


{1,4,15,71,157,228,2579,3035,15403,33841,255325,612173}
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2023-12-10 07:48:03 | 显示全部楼层
northwolves 发表于 2023-12-9 17:04
{1,4,15,71,157,228,2579,3035,15403,33841,255325,612173}

不太会用(不太好用), 更贪心一点: 这个分数能出来吗?谢谢!
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2023-12-10 08:44:13 | 显示全部楼层
王守恩 发表于 2023-12-10 07:48
不太会用(不太好用), 更贪心一点: 这个分数能出来吗?谢谢!
  1. f[n_]:=Do[If[Abs[EulerGamma-t/Round[t/EulerGamma]]<1/10^n,Return[t/Round[t/EulerGamma]]],{t,1,\[Infinity]}];Table[f[n],{n,10}]
复制代码


{1/2,4/7,15/26,71/123,157/272,228/395,2579/4468,3035/5258,15403/26685,33841/58628}

  1. Convergents[EulerGamma,20]
复制代码

{0,1,1/2,3/5,4/7,11/19,15/26,71/123,228/395,3035/5258,15403/26685,18438/31943,33841/58628,289166/500967,323007/559595,935180/1620157,4063727/7040223,4998907/8660380,9062634/15700603,367504267/636684500}

评分

参与人数 1威望 +9 金币 +9 贡献 +9 经验 +9 鲜花 +9 收起 理由
王守恩 + 9 + 9 + 9 + 9 + 9 膜拜!

查看全部评分

毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2023-12-10 12:42:38 | 显示全部楼层
northwolves 发表于 2023-12-10 08:44
{1/2,4/7,15/26,71/123,157/272,228/395,2579/4468,3035/5258,15403/26685,33841/58628}

太好了!!!这串数实用性强, 比渐近分数分布均匀多了。
搁在心里好几年了, 一直没找到满意的公式,  这样也可以吗?谢谢!
  1. Table[Do[If[Abs[(Pi - 3) - t/Round[t/(Pi - 3)]] < 10^-n, Return[t/Round[t/(Pi - 3)]]], {t, 1, 10^n}], {n, 10}]
复制代码

{1/7, 1/7, 9/64, 15/106, 16/113, 16/113, 3423/24175, 4543/32085, 4687/33102, 14093/99532}
上面的算法有点慢,下面的算法可否借鉴?
  1. $MaxExtraPrecision = 1000;
  2. For[k = 1, k <= 10, k = k + 1, a = \[Pi] - (0.1`1000)^k;
  3. c1 = ContinuedFraction[a, 10]; b = \[Pi] + (0.1`1000)^k;
  4. c2 = ContinuedFraction[b, 10];
  5. j = 1; While[c1[[j]] == c2[[j]], j = j + 1];
  6. If[c1[[j]] < c2[[j]], d = Take[c1, j]; d[[j]] = c1[[j]] + 1,
  7.   d = Take[c2, j]; d[[j]] = c2[[j]] + 1];
  8. ans = FromContinuedFraction[d] - 3;
  9. Print[k, " ", ans, " ", N[\[Pi] - 3 - ans, 20]]]
复制代码

评分

参与人数 1威望 +8 金币 +8 贡献 +8 经验 +8 鲜花 +8 收起 理由
northwolves + 8 + 8 + 8 + 8 + 8 赞一个!

查看全部评分

毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2023-12-12 13:11:20 | 显示全部楼层
把全体正整数分成若干不漏不重(不循环)数字串,  譬如:  A+B=全体正整数
A(n)=2, 5, 7, 10, 13, 15, 18, 20, 23, 26, 28, 31, 34, 36, 39, 41, 44, 47, 49, 52, 54, 57, 60, 62, 65, 68,70,
73, 75, 78, 81, 83, 86, 89, 91, 94, 96, 99, 102, 104, 107, 109, 112, 115, 117,120,123,125,128,130,133,
136, 138, 141, 143, 146, 149, 151, 154, 157, 159, 162, 164, 167, 170, 172, 175,178,180,183,185,188,
191, 193, 196, 198, 201, 204, 206, 209, 212, 214, 217, 219, 222, 225, 227, 230, 233, 235, 238, 240,...
\(A(n)=\lfloor\frac{n (3 + \sqrt{5})}{2}\rfloor\)     OEIS--A090909--2023年9月12日
B(n)=1, 3, 4, 6, 8, 9, 11, 12, 14, 16, 17, 19, 21, 22, 24, 25, 27, 29, 30, 32, 33, 35, 37, 38, 40, 42, 43, 45,
46, 48, 50, 51, 53, 55, 56, 58, 59, 61, 63, 64, 66, 67, 69, 71, 72, 74, 76, 77, 79, 80, 82, 84, 85,87,88,90,
92, 93, 95, 97, 98, 100, 101, 103, 105, 106, 108, 110, 111, 113, 114, 116, 118, 119, 121, 122,124,126,
127, 129, 131, \132, 134, 135, 137, 139, 140, 142, 144, 145, 147, 148, 150, 152, 153, 155, 156, ......
\(B(n)=\lfloor\frac{n (1 + \sqrt{5})}{2}\rfloor\)     
譬如:  A+B=全体正整数,   已知A(n)=见下面,   B(n)=?
{A(n)=1, 3, 5, 7, 9, 10, 12, 14, 16, 18, 19, 21, 23, 25, 27, 28, 30, 32, 34, 36, 37, 39, 41, 43, 45,47,48,50,
52, 54, 56, 57, 59, 61, 63, 65, 66, 68, 70, 72, 74, 75, 77, 79, 81, 83, 85, 86, 88, 90, 92, 94,95,97,99,101,
103, 104, 106, 108, 110, 112, 113, 115, 117, 119, 121, 123, 124, 126, 128, 130, 132, 133,135,137,139,
141, 142, 144, 146, 148, 150, 151, 153, 155, 157, 159, 161, 162, 164, 166, 168, 170, 171, 173, 175, ...
\(A(n)=\lfloor\frac{n ( 5+ \sqrt{5})}{4}\rfloor\)     OEIS--108598--2023年10月20日

点评

nyy
老同志你玩的很开心,不过这个问题有什么好玩的呢?  发表于 2023-12-12 14:48
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2023-12-12 16:28:53 | 显示全部楼层
王守恩 发表于 2023-12-12 13:11
把全体正整数分成若干不漏不重(不循环)数字串,  譬如:  A+B=全体正整数
A(n)=2, 5, 7, 10, 13, 15, 18, 20, ...
  1. n=111;a=Floor[(5+Sqrt[5])/4*Range@n];
  2. b=Floor[Sqrt[5]*Range@(n/(Sqrt[5]-1))];
  3. {a,b,Union[a,b]==Range@200}
复制代码


{{1,3,5,7,9,10,12,14,16,18,19,21,23,25,27,28,30,32,34,36,37,39,41,43,45,47,48,50,52,54,56,57,59,61,63,65,66,68,70,72,74,75,77,79,81,83,85,86,88,90,92,94,95,97,99,101,103,104,106,108,110,112,113,115,117,119,121,123,124,126,128,130,132,133,135,137,139,141,142,144,146,148,150,151,153,155,157,159,161,162,164,166,168,170,171,173,175,177,179,180,182,184,186,188,189,191,193,195,197,198,200},{2,4,6,8,11,13,15,17,20,22,24,26,29,31,33,35,38,40,42,44,46,49,51,53,55,58,60,62,64,67,69,71,73,76,78,80,82,84,87,89,91,93,96,98,100,102,105,107,109,111,114,116,118,120,122,125,127,129,131,134,136,138,140,143,145,147,149,152,154,156,158,160,163,165,167,169,172,174,176,178,181,183,185,187,190,192,194,196,199},True}
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2023-12-12 16:34:38 | 显示全部楼层
可以搜索一下贝亚蒂定理。
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

小黑屋|手机版|数学研发网 ( 苏ICP备07505100号 )

GMT+8, 2024-12-28 19:25 , Processed in 0.026315 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表