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

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

 火... [复制链接]
 楼主| 发表于 2023-7-4 14:14:06 | 显示全部楼层
  1, 5, 10, 14, 19, 23, 28, 32, 37, 41, 46, 50, 55, 59, 64, 68, 73,77, 82, 86, 91, 95, 100, 104, 109, 113,
  1, 0, 5, 0, 10, 0, 14, 0, 19, 0, 23, 0, 28, 0, 32, 0, 37, 0, 41, 0, 46, 0, 50, 0, 55, 0, 59, 0, 64, 0, 68, 0, 73,
  1, 0, 0, 5, 0, 0, 10, 0, 0, 14, 0, 0, 19, 0, 0, 23, 0, 0, 28, 0, 0, 32, 0, 0, 37, 0, 0, 41, 0,  0, 46, 0, 0, 50, 0, 0,                 
  1, 0, 0, 0, 5, 0, 0, 0, 10, 0, 0, 0, 14, 0, 0, 0, 19, 0, 0, 0, 23, 0, 0, 0, 28, 0, 0, 0, 32, 0, 0, 0, 37, 0, 0, 0, 41, 0,
   
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2023-7-4 14:32:40 | 显示全部楼层
王守恩 发表于 2023-7-3 19:34
边长为n(正整数)的正方形ABCD内动点P,三角形ABP三边长为整数,问动点P可能有几个?

得到一串数: 1,3,8, ...

a(8)=50
{{1,8},{2,7},{2,8},{3,6},{3,7},{3,8},{4,5},{4,6},{4,7},{4,8},{5,4},{5,5},{5,6},{5,7},{5,8},{5,9},{6,3},{6,4},{6,5},{6,6},{6,7},{6,8},{6,9},{7,2},{7,3},{7,4},{7,5},{7,6},{7,7},{7,8},{7,9},{7,10},{8,1},{8,2},{8,3},{8,4},{8,5},{8,6},{8,7},{8,8},{8,9},{8,10},{8,11},{9,5},{9,6},{9,7},{9,8},{10,7},{10,8},{11,8}}
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2023-7-4 14:34:05 | 显示全部楼层
  1. Table[Length@Select[Tuples[Range@(Sqrt[2]*n),{2}],Total@#>n&&#[[1]]^2-n^2<#[[2]]^2<(#[[1]]^2+n^2)&&(#[[1]]^2-#[[2]]^2)^2+5n^4>2(#[[1]]^2+#[[2]]^2)*n^2&],{n,40}]
复制代码


{1,3,8,12,21,29,40,50,66,82,99,113,138,160,183,207,239,265,294,324,361,399,434,466,511,558,597,639,692,740,789,837,894,953,1004,1062,1125,1185,1254,1314,1385,1447,1523,1591,1664,1742,1821,1897,1976,2058}
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2023-7-4 14:57:42 | 显示全部楼层
王守恩 发表于 2023-7-4 14:14
1, 5, 10, 14, 19, 23, 28, 32, 37, 41, 46, 50, 55, 59, 64, 68, 73,77, 82, 86, 91, 95, 100, 104, 109 ...

  1. Array[CoefficientList[Series[(2x^#+1)^2/((x^#-1)^2(x^#+1)),{x,0,29}],x]&,4]
复制代码


$\{\{1,5,10,14,19,23,28,32,37,41,46,50,55,59,64,68,73,77,82,86,91,95,100,104,109,113,118,122,127,131\},\{1,0,5,0,10,0,14,0,19,0,23,0,28,0,32,0,37,0,41,0,46,0,50,0,55,0,59,0,64\},\{1,0,0,5,0,0,10,0,0,14,0,0,19,0,0,23,0,0,28,0,0,32,0,0,37,0,0,41\},\{1,0,0,0,5,0,0,0,10,0,0,0,14,0,0,0,19,0,0,0,23,0,0,0,28,0,0,0,32\}\}$
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2023-7-4 15:35:03 | 显示全部楼层
northwolves 发表于 2023-7-4 14:57
$\{\{1,5,10,14,19,23,28,32,37,41,46,50,55,59,64,68,73,77,82,86,91,95,100,104,109,113,118,122 ...
  1. Table[CoefficientList[Series[(2 x^n + 1)^2/((x^n + 1) (x^n - 1)^2), {x, 0, 29 n}], x], {n,1, 4}]
复制代码

{{1, 5, 10, 14, 19, 23, 28, 32, 37, 41, 46, 50, 55, 59, 64, 68, 73, 77, 82, 86, 91, 95, 100, 104, 109, 113, 118, 122, 127, 131},
{1, 0, 5, 0, 10, 0, 14, 0, 19, 0, 23, 0, 28, 0, 32, 0, 37, 0, 41, 0, 46, 0, 50, 0, 55, 0, 59, 0, 64, 0, 68, 0, 73, 0, 77, 0, 82, 0, 86, 0, 91, 0, 95, 0, 100, 0, 104, 0, 109, 0, 113, 0, 118, 0, 122, 0, 127, 0, 131},
{1, 0, 0, 5, 0, 0, 10, 0, 0, 14, 0, 0, 19, 0, 0, 23, 0, 0, 28, 0, 0, 32, 0, 0, 37, 0, 0, 41, 0, 0, 46, 0, 0, 50, 0, 0, 55, 0, 0, 59, 0, 0, 64, 0, 0,
68, 0, 0, 73, 0, 0, 77, 0, 0, 82, 0, 0, 86, 0, 0, 91, 0, 0, 95, 0, 0, 100, 0, 0, 104, 0, 0, 109, 0, 0, 113, 0, 0, 118, 0, 0, 122, 0, 0, 127, 0, 0, 131},
{1, 0, 0, 0, 5, 0, 0, 0, 10, 0, 0, 0, 14, 0, 0, 0, 19, 0, 0, 0, 23, 0, 0, 0, 28, 0, 0, 0, 32, 0, 0, 0, 37, 0, 0, 0, 41, 0, 0, 0, 46, 0, 0, 0, 50, 0, 0, 0, 55, 0, 0, 0, 59, 0, 0, 0, 64, 0, 0, 0,
68, 0, 0, 0, 73, 0, 0, 0, 77, 0, 0, 0, 82, 0, 0, 0, 86, 0, 0, 0, 91, 0, 0, 0, 95, 0, 0, 0, 100, 0, 0, 0, 104, 0, 0, 0, 109, 0, 0, 0, 113, 0, 0, 0, 118, 0, 0, 0, 122, 0, 0, 0, 127, 0, 0, 0, 131}}

点评

Table & Array功能一样,Array似乎更简单些  发表于 2023-7-4 15:48
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2023-7-4 18:15:46 | 显示全部楼层
  1. Table[Length@Select[Tuples[Range@(Sqrt[2]*n),{2}],Total@#>n&&#[[1]]^2-n^2<=#[[2]]^2<=(#[[1]]^2+n^2)&&(#[[1]]^2-#[[2]]^2)^2+5n^4>2(#[[1]]^2+#[[2]]^2)*n^2&],{n,100}]
复制代码


{1,3,8,14,21,29,40,52,66,82,99,117,138,160,185,209,239,265,294,326,363,399,434,472,511,558,597,641,692,742,789,839,894,953,1006,1066,1125,1185,1254,1318,1385,1449,1523,1593,1668,1742,1821,1903,1976,2058,2146,2234,2313,2399,2502,2592,2677,2771,2872,2973,3064,3170,3279,3383,3488,3592,3705,3820,3931,4045,4166,4282,4399,4521,4644,4768,4900,5028,5155,5285,5426,5560,5685,5829,5975,6115,6254,6396,6555,6693,6842,6994,7155,7306,7455,7619,7784,7946,8103,8265}

评分

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

查看全部评分

毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2023-7-4 18:16:33 | 显示全部楼层
整数的运算比小数还是要快得多

评分

参与人数 1威望 +3 金币 +3 贡献 +3 经验 +3 鲜花 +3 收起 理由
王守恩 + 3 + 3 + 3 + 3 + 3 40就用了1天。

查看全部评分

毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 2023-7-4 23:03:40 | 显示全部楼层
用 Subsets还能再稍快些:

  1. Table[Floor[Sqrt[5]*n/2]-Ceiling[(n-1)/2]+2Length@Select[Select[Subsets[Range@(Sqrt[2]*n),{2}],Total@#>n&&#[[2]]^2<=#[[1]]^2+n^2&],(#[[1]]^2-#[[2]]^2)^2+5n^4>2(#[[1]]^2+#[[2]]^2)*n^2&],{n,100}]
复制代码

点评

Ceiling[(n-1)/2]=Floor[n/2]  发表于 2023-7-5 10:33
都是有实力之人,我都不知道,在探讨什么问题。  发表于 2023-7-4 23:18
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2023-7-5 09:07:51 | 显示全部楼层
边长为n(正整数)的正三角形ABC内动点P,三角形ABP三边长为整数,问动点P可能有几个?

得到一串数(OEIS好像没有): 1,1,2,4,7,11,16,20,21,27,34,42,51,61,72,78,85,97,110,124,...,
  1. Table[Dimensions@Flatten[Table[NSolve[{m/Sin[a]==n/Sin[b]==k/Sin[a+b],\[Pi]/3≥b>0,\[Pi]/3≥a>0},{a,b}],{m,1,k},{n,1,k}]]/2,{k,1,20}]
复制代码
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 2023-7-5 14:16:13 | 显示全部楼层
上底(AB)为n(正整数)的等腰梯形(底角=60,上底=高)内动点P,三角形ABP三边长为整数,问动点P可能有几个?

得到一串数(OEIS好像没有):1,3,10,16,29,37,48,68,84,110,127,147,182,206,245,273,315,347,380,432,...,
  1. Table[Dimensions@Flatten[Table[NSolve[{m/Sin[a]==n/Sin[b]==k/Sin[a+b],(m*n)/(k*k)≤Sin[\[Pi]/2]/Sin[a+b],2\[Pi]/3≥a>0,2\[Pi]/3≥b>0},{a,b}],{m,1,Sqrt[2]k},{n,1,Sqrt[2]k}]]/2,{k,1,20}]
复制代码

算式没问题,就是太慢了。
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

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

GMT+8, 2024-11-22 21:49 , Processed in 0.027025 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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