自定义操作符
已知\(x@y=\frac{x+y}{1+xy}, 2@3@4@5@.....@2021=\frac{q}{p}\),求$q$的末尾三个数字。 难道mathematica解决不了这个问题? 本帖最后由 mathematica 于 2021-1-27 09:13 编辑Clear["Global`*"];(*mathematica11.2,win7(64bit)Clear all variables*)
x=2;
Do,{k,3,2001}];
x//Numerator
最后的值是\(\frac{1001500}{1001501}\),分子的值是1001500,这个问题很难吗?
算到2021结果是
1021615/1021616 这个是双曲正切的对加公式吧? 这次换成了 gp 的代码,结果很让人震惊:
n=2021 q/p=1021615/1021616
(f(x,y)=(x+y)/(1+x*y));a=f(2,3);for(n=4,2021, b=f(a,n);print(n, " ", b);a=b)
竟对于所有的 q/p,q 和 p 的差不超过 2. mathematica 发表于 2021-1-27 08:30
难道mathematica解决不了这个问题?
Fold[(#1+#2)/(1+#1 #2)&,Range]
可以解决,我还没问升级版呢,如果题目2021我改成$n$,你该怎么办 本帖最后由 王守恩 于 2021-1-27 18:39 编辑
手工也可以解决。
\(@_{3}=\frac{2+3}{1+2*3}=\frac{5}{7}\)
\(@_{4}=\frac{5/7+4}{1+5/7*4}=\frac{5+7*4}{7+5*4}=\frac{11}{9}\)
\(@_{5}=\frac{11/9+5}{1+11/9*5}=\frac{11+9*5}{9+11*5}=\frac{14}{16}\)
\(@_{6}=\frac{14/16+6}{1+14/16*6}=\frac{14+16*6}{16+14*6}=\frac{22}{20}\)
\(@_{7}=\frac{22+20*7}{20+22*7}=\frac{27}{29}\)
\(@_{8}=\frac{27+29*8}{29+27*8}=\frac{37}{35}\)
\(@_{9}=\frac{37+35*9}{35+37*9}=\frac{44}{46}\)
\(@_{10}=\frac{55+1}{55-1}\)
\(@_{11}=\frac{66-1}{66+1}\)
\(@_{12}=\frac{78+1}{78-1}\)
\(@_{13}=\frac{91-1}{91+1}\)
.............
\(@_{n}=\frac{n(n+1)\cos(n\pi)+2}{n(n+1)\cos(n\pi)-2}\)
谢谢 wayne!已经修改。 嗯,有那么一点意思,Table-1),{n,2,100}]
\(x@y=\frac{x+y}{1+xy}, 2@3@4@5@.....@2021=\frac{q}{p} = 1+\frac{2}{(-1)^nC_{n+1}^2-1}\) wayne 发表于 2021-1-27 11:50
嗯,有那么一点意思,
\(x@y=\frac{x+y}{1+xy}, 2@3@4@5@.....@2021=\frac{q}{p} = 1+\frac{2}{(-1)^nC_{n ...
Table[{4 k + 3, 7 + 14 k + 8 k^2}, {k, 0, 20}]
如果n=4k+3,那么分母是7 + 14 k + 8 k^2,
以4位周期,推导一下就可以了 mathematica 发表于 2021-1-27 12:52
Table[{4 k + 3, 7 + 14 k + 8 k^2}, {k, 0, 20}]
如果n=4k+3,那么分母是7 + 14 k + 8 k^2,
以4位周 ...
Clear["Global`*"];(*mathematica11.2,win7(64bit)Clear all variables*)
x=2;
mylist={};
Do;
new={y,x,Numerator@x,FactorInteger@Numerator@x,Denominator@x,FactorInteger@Denominator@x};
mylist=Append,
{k,3,51}];
Grid
容易观测到以4位周期
\[\begin{array}{llllll}
3 & \frac{5}{7} & 5 & \left(
\begin{array}{cc}
5 & 1 \\
\end{array}
\right) & 7 & \left(
\begin{array}{cc}
7 & 1 \\
\end{array}
\right) \\
4 & \frac{11}{9} & 11 & \left(
\begin{array}{cc}
11 & 1 \\
\end{array}
\right) & 9 & \left(
\begin{array}{cc}
3 & 2 \\
\end{array}
\right) \\
5 & \frac{7}{8} & 7 & \left(
\begin{array}{cc}
7 & 1 \\
\end{array}
\right) & 8 & \left(
\begin{array}{cc}
2 & 3 \\
\end{array}
\right) \\
6 & \frac{11}{10} & 11 & \left(
\begin{array}{cc}
11 & 1 \\
\end{array}
\right) & 10 & \left(
\begin{array}{cc}
2 & 1 \\
5 & 1 \\
\end{array}
\right) \\
7 & \frac{27}{29} & 27 & \left(
\begin{array}{cc}
3 & 3 \\
\end{array}
\right) & 29 & \left(
\begin{array}{cc}
29 & 1 \\
\end{array}
\right) \\
8 & \frac{37}{35} & 37 & \left(
\begin{array}{cc}
37 & 1 \\
\end{array}
\right) & 35 & \left(
\begin{array}{cc}
5 & 1 \\
7 & 1 \\
\end{array}
\right) \\
9 & \frac{22}{23} & 22 & \left(
\begin{array}{cc}
2 & 1 \\
11 & 1 \\
\end{array}
\right) & 23 & \left(
\begin{array}{cc}
23 & 1 \\
\end{array}
\right) \\
10 & \frac{28}{27} & 28 & \left(
\begin{array}{cc}
2 & 2 \\
7 & 1 \\
\end{array}
\right) & 27 & \left(
\begin{array}{cc}
3 & 3 \\
\end{array}
\right) \\
11 & \frac{65}{67} & 65 & \left(
\begin{array}{cc}
5 & 1 \\
13 & 1 \\
\end{array}
\right) & 67 & \left(
\begin{array}{cc}
67 & 1 \\
\end{array}
\right) \\
12 & \frac{79}{77} & 79 & \left(
\begin{array}{cc}
79 & 1 \\
\end{array}
\right) & 77 & \left(
\begin{array}{cc}
7 & 1 \\
11 & 1 \\
\end{array}
\right) \\
13 & \frac{45}{46} & 45 & \left(
\begin{array}{cc}
3 & 2 \\
5 & 1 \\
\end{array}
\right) & 46 & \left(
\begin{array}{cc}
2 & 1 \\
23 & 1 \\
\end{array}
\right) \\
14 & \frac{53}{52} & 53 & \left(
\begin{array}{cc}
53 & 1 \\
\end{array}
\right) & 52 & \left(
\begin{array}{cc}
2 & 2 \\
13 & 1 \\
\end{array}
\right) \\
15 & \frac{119}{121} & 119 & \left(
\begin{array}{cc}
7 & 1 \\
17 & 1 \\
\end{array}
\right) & 121 & \left(
\begin{array}{cc}
11 & 2 \\
\end{array}
\right) \\
16 & \frac{137}{135} & 137 & \left(
\begin{array}{cc}
137 & 1 \\
\end{array}
\right) & 135 & \left(
\begin{array}{cc}
3 & 3 \\
5 & 1 \\
\end{array}
\right) \\
17 & \frac{76}{77} & 76 & \left(
\begin{array}{cc}
2 & 2 \\
19 & 1 \\
\end{array}
\right) & 77 & \left(
\begin{array}{cc}
7 & 1 \\
11 & 1 \\
\end{array}
\right) \\
18 & \frac{86}{85} & 86 & \left(
\begin{array}{cc}
2 & 1 \\
43 & 1 \\
\end{array}
\right) & 85 & \left(
\begin{array}{cc}
5 & 1 \\
17 & 1 \\
\end{array}
\right) \\
19 & \frac{189}{191} & 189 & \left(
\begin{array}{cc}
3 & 3 \\
7 & 1 \\
\end{array}
\right) & 191 & \left(
\begin{array}{cc}
191 & 1 \\
\end{array}
\right) \\
20 & \frac{211}{209} & 211 & \left(
\begin{array}{cc}
211 & 1 \\
\end{array}
\right) & 209 & \left(
\begin{array}{cc}
11 & 1 \\
19 & 1 \\
\end{array}
\right) \\
21 & \frac{115}{116} & 115 & \left(
\begin{array}{cc}
5 & 1 \\
23 & 1 \\
\end{array}
\right) & 116 & \left(
\begin{array}{cc}
2 & 2 \\
29 & 1 \\
\end{array}
\right) \\
22 & \frac{127}{126} & 127 & \left(
\begin{array}{cc}
127 & 1 \\
\end{array}
\right) & 126 & \left(
\begin{array}{cc}
2 & 1 \\
3 & 2 \\
7 & 1 \\
\end{array}
\right) \\
23 & \frac{275}{277} & 275 & \left(
\begin{array}{cc}
5 & 2 \\
11 & 1 \\
\end{array}
\right) & 277 & \left(
\begin{array}{cc}
277 & 1 \\
\end{array}
\right) \\
24 & \frac{301}{299} & 301 & \left(
\begin{array}{cc}
7 & 1 \\
43 & 1 \\
\end{array}
\right) & 299 & \left(
\begin{array}{cc}
13 & 1 \\
23 & 1 \\
\end{array}
\right) \\
25 & \frac{162}{163} & 162 & \left(
\begin{array}{cc}
2 & 1 \\
3 & 4 \\
\end{array}
\right) & 163 & \left(
\begin{array}{cc}
163 & 1 \\
\end{array}
\right) \\
26 & \frac{176}{175} & 176 & \left(
\begin{array}{cc}
2 & 4 \\
11 & 1 \\
\end{array}
\right) & 175 & \left(
\begin{array}{cc}
5 & 2 \\
7 & 1 \\
\end{array}
\right) \\
27 & \frac{377}{379} & 377 & \left(
\begin{array}{cc}
13 & 1 \\
29 & 1 \\
\end{array}
\right) & 379 & \left(
\begin{array}{cc}
379 & 1 \\
\end{array}
\right) \\
28 & \frac{407}{405} & 407 & \left(
\begin{array}{cc}
11 & 1 \\
37 & 1 \\
\end{array}
\right) & 405 & \left(
\begin{array}{cc}
3 & 4 \\
5 & 1 \\
\end{array}
\right) \\
29 & \frac{217}{218} & 217 & \left(
\begin{array}{cc}
7 & 1 \\
31 & 1 \\
\end{array}
\right) & 218 & \left(
\begin{array}{cc}
2 & 1 \\
109 & 1 \\
\end{array}
\right) \\
30 & \frac{233}{232} & 233 & \left(
\begin{array}{cc}
233 & 1 \\
\end{array}
\right) & 232 & \left(
\begin{array}{cc}
2 & 3 \\
29 & 1 \\
\end{array}
\right) \\
31 & \frac{495}{497} & 495 & \left(
\begin{array}{cc}
3 & 2 \\
5 & 1 \\
11 & 1 \\
\end{array}
\right) & 497 & \left(
\begin{array}{cc}
7 & 1 \\
71 & 1 \\
\end{array}
\right) \\
32 & \frac{529}{527} & 529 & \left(
\begin{array}{cc}
23 & 2 \\
\end{array}
\right) & 527 & \left(
\begin{array}{cc}
17 & 1 \\
31 & 1 \\
\end{array}
\right) \\
33 & \frac{280}{281} & 280 & \left(
\begin{array}{cc}
2 & 3 \\
5 & 1 \\
7 & 1 \\
\end{array}
\right) & 281 & \left(
\begin{array}{cc}
281 & 1 \\
\end{array}
\right) \\
34 & \frac{298}{297} & 298 & \left(
\begin{array}{cc}
2 & 1 \\
149 & 1 \\
\end{array}
\right) & 297 & \left(
\begin{array}{cc}
3 & 3 \\
11 & 1 \\
\end{array}
\right) \\
35 & \frac{629}{631} & 629 & \left(
\begin{array}{cc}
17 & 1 \\
37 & 1 \\
\end{array}
\right) & 631 & \left(
\begin{array}{cc}
631 & 1 \\
\end{array}
\right) \\
36 & \frac{667}{665} & 667 & \left(
\begin{array}{cc}
23 & 1 \\
29 & 1 \\
\end{array}
\right) & 665 & \left(
\begin{array}{cc}
5 & 1 \\
7 & 1 \\
19 & 1 \\
\end{array}
\right) \\
37 & \frac{351}{352} & 351 & \left(
\begin{array}{cc}
3 & 3 \\
13 & 1 \\
\end{array}
\right) & 352 & \left(
\begin{array}{cc}
2 & 5 \\
11 & 1 \\
\end{array}
\right) \\
38 & \frac{371}{370} & 371 & \left(
\begin{array}{cc}
7 & 1 \\
53 & 1 \\
\end{array}
\right) & 370 & \left(
\begin{array}{cc}
2 & 1 \\
5 & 1 \\
37 & 1 \\
\end{array}
\right) \\
39 & \frac{779}{781} & 779 & \left(
\begin{array}{cc}
19 & 1 \\
41 & 1 \\
\end{array}
\right) & 781 & \left(
\begin{array}{cc}
11 & 1 \\
71 & 1 \\
\end{array}
\right) \\
40 & \frac{821}{819} & 821 & \left(
\begin{array}{cc}
821 & 1 \\
\end{array}
\right) & 819 & \left(
\begin{array}{cc}
3 & 2 \\
7 & 1 \\
13 & 1 \\
\end{array}
\right) \\
41 & \frac{430}{431} & 430 & \left(
\begin{array}{cc}
2 & 1 \\
5 & 1 \\
43 & 1 \\
\end{array}
\right) & 431 & \left(
\begin{array}{cc}
431 & 1 \\
\end{array}
\right) \\
42 & \frac{452}{451} & 452 & \left(
\begin{array}{cc}
2 & 2 \\
113 & 1 \\
\end{array}
\right) & 451 & \left(
\begin{array}{cc}
11 & 1 \\
41 & 1 \\
\end{array}
\right) \\
43 & \frac{945}{947} & 945 & \left(
\begin{array}{cc}
3 & 3 \\
5 & 1 \\
7 & 1 \\
\end{array}
\right) & 947 & \left(
\begin{array}{cc}
947 & 1 \\
\end{array}
\right) \\
44 & \frac{991}{989} & 991 & \left(
\begin{array}{cc}
991 & 1 \\
\end{array}
\right) & 989 & \left(
\begin{array}{cc}
23 & 1 \\
43 & 1 \\
\end{array}
\right) \\
45 & \frac{517}{518} & 517 & \left(
\begin{array}{cc}
11 & 1 \\
47 & 1 \\
\end{array}
\right) & 518 & \left(
\begin{array}{cc}
2 & 1 \\
7 & 1 \\
37 & 1 \\
\end{array}
\right) \\
46 & \frac{541}{540} & 541 & \left(
\begin{array}{cc}
541 & 1 \\
\end{array}
\right) & 540 & \left(
\begin{array}{cc}
2 & 2 \\
3 & 3 \\
5 & 1 \\
\end{array}
\right) \\
47 & \frac{1127}{1129} & 1127 & \left(
\begin{array}{cc}
7 & 2 \\
23 & 1 \\
\end{array}
\right) & 1129 & \left(
\begin{array}{cc}
1129 & 1 \\
\end{array}
\right) \\
48 & \frac{1177}{1175} & 1177 & \left(
\begin{array}{cc}
11 & 1 \\
107 & 1 \\
\end{array}
\right) & 1175 & \left(
\begin{array}{cc}
5 & 2 \\
47 & 1 \\
\end{array}
\right) \\
49 & \frac{612}{613} & 612 & \left(
\begin{array}{cc}
2 & 2 \\
3 & 2 \\
17 & 1 \\
\end{array}
\right) & 613 & \left(
\begin{array}{cc}
613 & 1 \\
\end{array}
\right) \\
50 & \frac{638}{637} & 638 & \left(
\begin{array}{cc}
2 & 1 \\
11 & 1 \\
29 & 1 \\
\end{array}
\right) & 637 & \left(
\begin{array}{cc}
7 & 2 \\
13 & 1 \\
\end{array}
\right) \\
51 & \frac{1325}{1327} & 1325 & \left(
\begin{array}{cc}
5 & 2 \\
53 & 1 \\
\end{array}
\right) & 1327 & \left(
\begin{array}{cc}
1327 & 1 \\
\end{array}
\right) \\
\end{array}\]