找回密码
 欢迎注册
楼主: iseemu2009

[原创] 等分正方形边长形成的交点数和区域数

[复制链接]
 楼主| 发表于 5 天前 | 显示全部楼层

代码发出来看看
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 5 天前 | 显示全部楼层
正方形边长3等分形成的交点数和区域数
正方形边长3等分.png

点评

1[中]+(3[边]+4[水平或垂直]+5[角])×4+26×8=257——分成相同的8块。  发表于 5 天前
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 5 天前 | 显示全部楼层
A331449给到了52项为止,我这里继续计算了几项
53 59861345
54 60326225
55 66755641
56 69570973
57 77778357
58 84328717
59 92613453
60 89439969
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 5 天前 | 显示全部楼层
本帖最后由 iseemu2009 于 2025-4-15 18:23 编辑
mathe 发表于 2025-4-15 16:52
A331449给到了52项为止,我这里继续计算了几项
53 59861345
54 60326225


问题的关键是确定内部某个交点最多可由几条线段相交构成,这个对区域数的形成有绝对影响。对于正n边形,把这n个顶点两两连线,构成众多内部交点,国外大神已经确定无论n为何值,一个交点最多有7条线段相交。

点评

你说正n边形那就不是本题了,那个已经被研究透了  发表于 5 天前
这结论显然错误的。中心是2n条线段相交,对称轴上的交点也显然可以有很多条线段经过。 即使去掉这两种特殊情况,还是可以利用对边平行性质找出很多有充分多线段经过的交点。   发表于 5 天前
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 5 天前 | 显示全部楼层
iseemu2009 发表于 2025-4-15 18:22
问题的关键是确定内部某个交点最多可由几条线段相交构成,这个对区域数的形成有绝对影响。对于正n边形, ...

这个结论是错误的。随便举个例子,比如n=8的时候,过交点为 $(\frac{11}{2},\frac{9}{2})$的直线有8个。分别是下面的直线
{{2,1},{8,7}}
{{2,8},{8,2}}
{{3,1},{8,8}}
{{3,8},{8,1}}
{{4,1},{7,8}}
{{4,8},{7,1}}
{{5,1},{6,8}}
{{5,8},{6,1}}

画的高清矢量图如下:https://nestwhile.com/res/8.pdf。 同颜色的点表示 相交的直线个数相同,直线个数越多,点越大。

8.png

  1. {1,5,<|1->1|>},
  2. {2,37,<|6->1,3->8,1->20|>},
  3. {3,257,<|15->1,6->8,3->32,1->204|>},
  4. {4,817,<|28->1,15->4,10->8,6->20,3->152,1->616|>},
  5. {5,2757,<|45->1,15->4,10->16,6->36,3->252,1->2428|>},
  6. {6,4825,<|66->1,45->4,28->4,21->8,15->16,10->72,6->156,3->572,1->3968|>},
  7. {7,12293,<|91->1,28->4,21->8,15->16,10->52,6->120,3->900,1->11164|>},
  8. {8,19241,<|120->1,45->8,36->8,28->8,21->20,15->40,10->132,6->396,3->1712,1->16884|>},
  9. {9,33549,<|153->1,45->8,36->20,28->8,21->24,15->60,10->140,6->600,3->2536,1->30116|>},
  10. {10,49577,<|190->1,91->4,55->8,45->8,36->20,28->52,21->56,15->84,10->312,6->948,3->4056,1->43988|>},
  11. {11,87685,<|231->1,66->4,55->8,45->4,36->4,28->4,21->84,15->48,10->228,6->580,3->4660,1->82016|>},
  12. {12,101981,<|276->1,153->4,91->24,78->8,45->32,36->32,28->68,21->128,15->424,10->780,6->1840,3->8504,1->90088|>},
  13. {13,178465,<|325->1,91->4,78->8,66->4,55->4,45->4,36->12,28->52,21->100,15->128,10->396,6->1056,3->8284,1->168360|>},
  14. {14,220113,<|378->1,153->4,105->8,91->8,78->8,55->4,45->44,36->60,28->140,21->144,15->256,10->924,6->2980,3->13144,1->202332|>}
复制代码

点评

好清晰的图!来一个:正方形边长4等分形成的交点和区域图=1。只要1/8=直角等腰三角形——腰=边长/2。谢谢!!!!!!  发表于 4 天前
你应该单开一个话题  发表于 5 天前
那就不是一个题了  发表于 5 天前
我说的是正n边形的情况,最多有7条线段交于一点,是正确的。本题不是正n边形,是正方形每边均布n+1个点,把每边n等分,又是另外的分析了  发表于 5 天前
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
回复 支持 1 反对 0

使用道具 举报

 楼主| 发表于 5 天前 来自手机 | 显示全部楼层
       我说的是正n边形的情况:当n为奇数时,内部所有交点都由2条线段相交构成,没有其它情况;    当n为偶数时,除中心点外,其它交点最多由7条线段相交构成,这是国外的结论。  本题是正方形每边n等分的情况,结论不同。
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 4 天前 来自手机 | 显示全部楼层
https://bbs.emath.ac.cn/forum.php?mod=viewthread&tid=1112
那个问题到那个帖子里讨论吧
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 4 天前 | 显示全部楼层
下面这段C++代码,通过修改宏N,就可以计算第N项的结果。

  1. #include <iostream>
  2. #include <map>
  3. #include <math.h>
  4. #include <vector>
  5. #include <gmpxx.h>
  6. #include <algorithm>

  7. #ifndef N
  8. #define N 5
  9. #endif
  10. typedef int dtype;
  11. typedef  long d2type;

  12. struct Point3{
  13.         dtype x,y,z;
  14.         bool operator<(const Point3& p)const{
  15.                 d2type xm=(d2type)x*p.z, pxm=(d2type)p.x*z;
  16.                 if(xm!=pxm){
  17.                         return xm<pxm;
  18.                 }
  19.                 d2type ym=(d2type)y*p.z,pym=(d2type)p.y*z;
  20.                 return ym<pym;
  21.         }
  22. };

  23. void get_coord(int n, dtype& a, dtype& b)
  24. {
  25.         if(n<N){
  26.                 a=n;b=0;
  27.         }else if(n<2*N){
  28.                 a=N;b=n-N;
  29.         }else if(n<3*N){
  30.                 a=(3*N-n);b=N;
  31.         }else{
  32.                 a=0;b=4*N-n;
  33.         }
  34. }

  35. void get_point(int n1, int n2, int n3, int n4, Point3& p)
  36. {
  37.         dtype a,b,c,d,e,f,g,h;
  38.         get_coord(n1,a,b);get_coord(n2,c,d);get_coord(n3,e,f);get_coord(n4,g,h);
  39.         p.x=((e - g)*d + (-h*e + g*f))*a + ((-e + g)*c*b + (h*e - g*f)*c);
  40.         p.y=(f - h)*d*a + (((-f + h)*c + (-h*e + g*f))*b + (h*e - g*f)*d);
  41.         p.z=(f - h)*a + ((-e + g)*b + ((-f + h)*c + (e - g)*d));
  42.         if(p.z<0){
  43.                 p.z=-p.z;
  44.                 p.y=-p.y;
  45.                 p.x=-p.x;
  46.         }else if(p.z==0&&p.y<0){
  47.                 p.y=-p.y;
  48.                 p.x=-p.x;
  49.         }
  50. }


  51. void output(const Point3& p)
  52. {
  53.         std::cout<<p.x<<","<<p.y<<","<<p.z<<std::endl;
  54. }

  55. void get_start_end(int i, int& js, int& je)
  56. {
  57.         if(i<N){
  58.                 js = N+1;
  59.         }else if(i<2*N){
  60.                 js = 2*N+1;
  61.         }else if(i<3*N){
  62.                 js = 3*N+1;
  63.         }else{
  64.                 js=4*N;
  65.         }
  66.         if(i==0){
  67.                 je=3*N-1;
  68.         }else{
  69.                 je=4*N-1;
  70.         }
  71. }

  72. int get_edge_by_count(int c)
  73. {
  74.         long r=(long)round(sqrt(1+c*8.0));
  75.         if(r*r!=1+c*8L){
  76.                 std::cerr<<"count "<<c<<" looks invalid\n";
  77.                 exit(-1);
  78.         }

  79.         return (r+1)/2;
  80. }

  81. int main()
  82. {
  83.     std::map<Point3, int> points;
  84.     std::map<Point3, int> sympoints;
  85.     std::map<int, int> cmap;
  86.     int i;
  87.     for(i=0;i<=2*N;i++){
  88.             int j;
  89.             int jstart,jend;
  90.             get_start_end(i,jstart,jend);
  91.             for(j=jstart;j<=jend;j++){//line from point i to point j
  92.                     if(i>N/2&&i<2*N+N/2&&j>N/2&&j<2*N+N/2)continue;
  93.                     if(i>N+N/2&&i<3*N+N/2&&j>N+N/2&&j<3*N+N/2)continue;
  94.                     int s,t;
  95.                     for(s=i+1;s<j;s++){
  96.                             int tstart,tend;
  97.                             get_start_end(s,tstart,tend);
  98.                             if(tstart<j+1)tstart=j+1;
  99.                             for(t=tstart;t<=tend;t++){//next line from s to t
  100.                                     Point3 p;
  101.                                     get_point(i,j,s,t,p);
  102.                                     if(p.x>=p.y&&2*p.x<=N*p.z){
  103.                                             if(p.x==p.y||2*p.x==N*p.z){
  104.                                                     if(2*p.x!=N*p.z||p.x!=p.y){
  105.                                                             sympoints[p]++;
  106.                                                     }
  107.                                             }else{
  108.                                                 points[p]++;
  109.                                             }
  110.                                     }
  111.                             }
  112.                     }
  113.             }
  114.     }
  115.     long degsums=0;
  116.     degsums=4*(2*N-1)+(4*N-4)*(3*N-1)+8*N;
  117.     for(auto p:points){
  118.             int ec=get_edge_by_count(p.second);
  119.             degsums+=16*ec;
  120.             cmap[ec]+=8;
  121.     }
  122.     for(auto p:sympoints){
  123.             int ec=get_edge_by_count(p.second);
  124.             degsums+=8*ec;
  125.             cmap[ec]+=4;
  126.     }
  127.     cmap[2*N]++;
  128.     degsums+=4*N;
  129.     degsums/=2;//num of edges
  130.     long numnodes = 8*points.size()+4*sympoints.size()+4*N+1;
  131.     std::cout<<N<<" "<<numnodes<<" "<<degsums-numnodes+1<<std::endl;
  132.     std::cout<<"{ ";
  133.     for(auto p:cmap){
  134.             std::cout<<p.first<<"->"<<p.second<<" ";
  135.     }
  136.     std::cout<<"}\n";
  137.     return 0;
  138. }
复制代码

其中前136项已经提交到OEIS, 现在计算机还在计算中,后面主要瓶颈在于内存。
136项以后有
项数    点数         区域数   
137 2799111561 2852305564
138 2802295529 2885610248
139 2968204097 3023971364
140 2910421145 3018970376
141 3106485517 3178850140
142 3206824821 3277434288
143 3272404781 3354411404
144 3261033533 3381583448
145 3467680413 3551349400
146 3586980529 3665068784
147 3629800925 3730279736
148 3757489605 3850787144
149 3927242969 3998841568
150 3867752689 4000300016
151 4144009073 4219108464
152 4150282137 4265220392
153 4271295825 4385633048
154 4347603237 4478109376
155 4541859465 4647072672
156 4540575149 4690623000
157 4846820121 4933832076
158 4934850625 5037730120
159 5049794561 5159179864

点评

nyy
你计算的原理是什么?算法的原理是什么?  发表于 3 天前
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
 楼主| 发表于 3 天前 | 显示全部楼层
mathe 发表于 2025-4-16 21:58
下面这段C++代码,通过修改宏N,就可以计算第N项的结果。

更希望你把怪兽那个程序发出来
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
发表于 3 天前 | 显示全部楼层
gend12.tgz (58.13 KB, 下载次数: 1)
以n=12为例子,可以做出每个大于等于3的交叉点所经过的直线段
可以看出,对于那些经过直线段多的都非常规律,但是稍微少一些的就不规律了。
a.png

点评

Mathe,能把这题的Mathematica代码发一下,c语言我会  发表于 3 天前
nyy
你写的代码是什么意思呢?原理是什么呢?  发表于 3 天前
毋因群疑而阻独见  毋任己意而废人言
毋私小惠而伤大体  毋借公论以快私情
您需要登录后才可以回帖 登录 | 欢迎注册

本版积分规则

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

GMT+8, 2025-4-20 00:05 , Processed in 0.083035 second(s), 19 queries .

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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