顯示具有 Math 標籤的文章。 顯示所有文章
顯示具有 Math 標籤的文章。 顯示所有文章

2025年9月24日 星期三

Scribd

主要是研究所時期做的一些投影片,少部份是後來做的:

 https://www.scribd.com/user/21556865/davidsmc

"8 Kyu":Never visit a . . . !?特解

Never visit a . . . !?

 這題我是用暴力解的.但解了之後,看別人其實有特解,
就是直接輸出9-apple
原因在於:

1. Sum all the digits of n.

假設n 是a + 10*b + 100*c + 1000*d
Sum all the digits of n的結果是s.

s=a+b+c+d

2. Subtract the sum from n, and it is your new n.

所以 new n = n - s 

= a + 10*b + 100*c + 1000*d - (a + b + c + d)

= 9*b + 99*c + 999*d

所以一定是9的倍數。
其餘不是千位數的n類推,也是9的倍數

3. If the new n is in the list below return the associated fruit, otherwise return back to task 1.

...

9-apple

...

18-apple

...

27-apple

...

36-apple

...

45-apple

...

54-apple

...

63-apple

...

72-apple

...

81-apple

...

90-apple

91-kiwi

92-banana

93-kiwi

94-banana

95-melon

96-banana

97-melon

98-pineapple

99-apple

100-pineapple

9的倍數,相關的水果一定是apple.不會是別的。 

2022年9月26日 星期一

平面圓形切割

 在Zero Judge上的

a042: 平面圓形切割

對任意正整數n,平面上的n 個圓最多可將平面切成幾個區域?


我發現跟以下數列有關:



2014年3月4日 星期二

直角三角形一定有一邊長是無理數,要不然有一角度是無理數

高中時,猜想的:
直角三角形一定有一邊長是無理數,要不然必有一角度是無理數。

我不會證,但由泰勒展開式,似乎可推得此結果。
不曉得是不是這樣?有沒有人證過?

Lean 4 極簡教學 (Using VS Code on macOS)

 1. Install Lean Environment: https://lean-lang.org/install/ 試著完Step one, two, three 2. 在VS code下,建一新的project: 取名Hello_World 3. 嘗試執行Main.lea...