题目174:数出能形成不同安排的空心薄板
Counting the number of "hollow" square laminae that can form one, two, three, ... distinct arrangementsWe shall define a square lamina to be a square outline with a square "hole" so that the shape possesses vertical and horizontal symmetry.
Given eight tiles it is possible to form a lamina in only one way: 3x3 square with a 1x1 hole in the middle. However, using thirty-two tiles it is possible to form two distinct laminae.
If t represents the number of tiles used, we shall say that t = 8 is type L(1) and t = 32 is type L(2).
Let N(n) be the number of t ≤ 1000000 such that t is type L(n); for example, N(15) = 832.
What is ∑ N(n) for 1 ≤ n ≤ 10?
题目:
我们定义一个正方形薄板为一个中间为正方形空洞的正方形外框。这个形状在水平和竖直方向上都是对称的。
用 8 块瓷砖,它只能形成一种空心薄板:大小为 3×3,中间带一个 1x1 的洞的正方形。然而,用 32 块砖的话,就可以形成两个不同的薄板。
如果 t 代表了瓷砖的数目。我们说 t = 8 是 L(1) 型的,t=32 是 L(2) 型的。
定义 N(n) 为 t ≤ 1000000 中属于 L(n) 型的 t 个数。比如,N(15)=832。
对于 1 ≤ n ≤ 10,求 ∑ N(n)。
print(sum((1000000//4//s-s for s in range(1, int((1000000//4)**0.5))))) print(sum((1000000//4//s-s for s in range(1, int((1000000//4)**0.5)))))
页:
[1]