chore(i8n,learn): processed translations

This commit is contained in:
Crowdin Bot
2021-02-06 04:42:36 +00:00
committed by Mrugesh Mohapatra
parent 15047f2d90
commit e5c44a3ae5
3274 changed files with 172122 additions and 14164 deletions

View File

@ -1,43 +1,49 @@
---
id: 5900f36e1000cf542c50fe80
title: 问题13和5的倍数
title: 'Problem 1: Multiples of 3 and 5'
challengeType: 5
videoUrl: ''
forumTopicId: 301722
dashedName: problem-1-multiples-of-3-and-5
---
# --description--
如果我们列出所有10以下是3或5的倍数的自然数我们会得到356和9。这些倍数的总和是23
If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.
求出所有在`number`以下的3或5的倍数的总和。
Find the sum of all the multiples of 3 or 5 below the provided parameter value `number`.
# --hints--
`multiplesOf3and5(1000)`应该返回233168。
`multiplesOf3and5(10)` should return a number.
```js
assert.strictEqual(multiplesOf3and5(1000), 233168);
assert(typeof multiplesOf3and5(10) === 'number');
```
`multiplesOf3and5(49)`应该返回543
`multiplesOf3and5(49)` should return 543.
```js
assert.strictEqual(multiplesOf3and5(49), 543);
```
`multiplesOf3and5(19564)`应该返回89301183。
`multiplesOf3and5(1000)` should return 233168.
```js
assert.strictEqual(multiplesOf3and5(19564), 89301183);
assert.strictEqual(multiplesOf3and5(1000), 233168);
```
您的函数未使用我们的测试值返回正确的结果。
`multiplesOf3and5(8456)` should return 16687353.
```js
assert.strictEqual(multiplesOf3and5(8456), 16687353);
```
`multiplesOf3and5(19564)` should return 89301183.
```js
assert.strictEqual(multiplesOf3and5(19564), 89301183);
```
# --seed--
## --seed-contents--

View File

@ -1,36 +1,44 @@
---
id: 5900f3761000cf542c50fe89
title: 问题10素数的总和
title: 'Problem 10: Summation of primes'
challengeType: 5
videoUrl: ''
forumTopicId: 301723
dashedName: problem-10-summation-of-primes
---
# --description--
低于10的素数之和为2 + 3 + 5 + 7 = 17.求出n以下所有素数的总和。
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17.
Find the sum of all the primes below `n`.
# --hints--
`primeSummation(17)`应该返回41。
`primeSummation(17)` should return a number.
```js
assert(typeof primeSummation(17) === 'number');
```
`primeSummation(17)` should return 41.
```js
assert.strictEqual(primeSummation(17), 41);
```
`primeSummation(2001)`应该返回277050
`primeSummation(2001)` should return 277050.
```js
assert.strictEqual(primeSummation(2001), 277050);
```
`primeSummation(140759)`应该返回873608362
`primeSummation(140759)` should return 873608362.
```js
assert.strictEqual(primeSummation(140759), 873608362);
```
`primeSummation(2000000)`应返回142913828922
`primeSummation(2000000)` should return 142913828922.
```js
assert.strictEqual(primeSummation(2000000), 142913828922);

View File

@ -1,21 +1,31 @@
---
id: 5900f3d01000cf542c50fee3
title: 问题100安排概率
title: 'Problem 100: Arranged probability'
challengeType: 5
videoUrl: ''
forumTopicId: 301724
dashedName: problem-100-arranged-probability
---
# --description--
如果一个盒子包含21个彩色光盘由15个蓝色光盘和6个红色光盘组成随机拍摄两张光盘可以看出拍摄两张蓝色光盘的概率PBB=15/21 ×14/20= 1/2。下一个这样的安排其中有50的机会随机拍摄两张蓝色光盘是一个包含八十五个蓝色光盘和三十五个红色光盘的盒子。通过找到第一个包含总共超过1012 = 1,000,000,000,000个光盘的布置确定该盒子将包含的蓝色光盘的数量。
If a box contains twenty-one coloured discs, composed of fifteen blue discs and six red discs, and two discs were taken at random, it can be seen that the probability of taking two blue discs, P(BB) = (15/21)×(14/20) = 1/2.
The next such arrangement, for which there is exactly 50% chance of taking two blue discs at random, is a box containing eighty-five blue discs and thirty-five red discs.
By finding the first arrangement to contain over 10<sup>12</sup> = 1,000,000,000,000 discs in total, determine the number of blue discs that the box would contain.
# --hints--
`euler100()`应该返回756872327473。
`arrangedProbability()` should return a number.
```js
assert.strictEqual(euler100(), 756872327473);
assert(typeof arrangedProbability() === 'number');
```
`arrangedProbability()` should return 756872327473.
```js
assert.strictEqual(arrangedProbability(), 756872327473);
```
# --seed--

View File

@ -1,22 +1,32 @@
---
id: 5900f3d21000cf542c50fee4
title: 问题101最佳多项式
title: 'Problem 101: Optimum polynomial'
challengeType: 5
videoUrl: ''
forumTopicId: 301725
dashedName: problem-101-optimum-polynomial
---
# --description--
如果我们被给出序列的前k个项则不可能肯定地说下一个项的值因为存在无限多个可以对序列建模的多项式函数。举个例子让我们考虑一下立方体数字的顺序。这由生成函数定义un = n31,8,27,64,125,216 ......假设我们只给出了该序列的前两个项。根据“简单就是最好”的原则我们应该假设一个线性关系并预测下一个项为15公共差异7。即使我们被提出前三个术语按照相同的简单原则也应假设二次关系。我们将OPkn定义为序列的前k个项的最佳多项式生成函数的第n项。应该清楚的是OPkn将准确地生成n≤k的序列项并且可能第一个不正确的项FIT将是OPkk + 1;在这种情况下我们将其称为坏OPBOP。作为一个基础如果我们只给出第一个序列项那么假设恒定是最明智的;也就是说对于n≥2OP1n= u1。因此我们获得了立方序列的以下OP
If we are presented with the first k terms of a sequence it is impossible to say with certainty the value of the next term, as there are infinitely many polynomial functions that can model the sequence.
OP1n= 11 1,1,1,1 ...... OP2n= 7n-6 1,8,15...... OP3n= 6n2-11n + 6 1,8,27,58... OP4n= n3 1,8,27,64,125......
As an example, let us consider the sequence of cube numbers. This is defined by the generating function, un = n3: 1, 8, 27, 64, 125, 216, ...
显然对于k≥4不存在BOP。通过考虑BOP产生的FIT之和以红色表示我们得到1 + 15 + 58 = 74.考虑下面的十度多项式生成函数un = 1 - n + n2 - n3 + n4 - n5 + n6 - n7 + n8 - n9 + n10求BOP的FIT之和。
Suppose we were only given the first two terms of this sequence. Working on the principle that "simple is best" we should assume a linear relationship and predict the next term to be 15 (common difference 7). Even if we were presented with the first three terms, by the same principle of simplicity, a quadratic relationship should be assumed.
We shall define OP(k, n) to be the nth term of the optimum polynomial generating function for the first k terms of a sequence. It should be clear that OP(k, n) will accurately generate the terms of the sequence for n ≤ k, and potentially the first incorrect term (FIT) will be OP(k, k+1); in which case we shall call it a bad OP (BOP).
As a basis, if we were only given the first term of sequence, it would be most sensible to assume constancy; that is, for n ≥ 2, OP(1, n) = u1.
Hence we obtain the following OPs for the cubic sequence:
OP(1, n) = 1 1, 1, 1, 1, ... OP(2, n) = 7n6 1, 8, 15, ... OP(3, n) = 6n211n+6 1, 8, 27, 58, ... OP(4, n) = n3 1, 8, 27, 64, 125, ...
Clearly no BOPs exist for k ≥ 4. By considering the sum of FITs generated by the BOPs (indicated in red above), we obtain 1 + 15 + 58 = 74. Consider the following tenth degree polynomial generating function: un = 1 n + n2 n3 + n4 n5 + n6 n7 + n8 n9 + n10 Find the sum of FITs for the BOPs.
# --hints--
`euler101()`应该返回37076114526
`euler101()` should return 37076114526.
```js
assert.strictEqual(euler101(), 37076114526);

View File

@ -1,18 +1,30 @@
---
id: 5900f3d21000cf542c50fee5
title: 问题102三角形遏制
title: 'Problem 102: Triangle containment'
challengeType: 5
videoUrl: ''
forumTopicId: 301726
dashedName: problem-102-triangle-containment
---
# --description--
在笛卡尔平面上随机绘制三个不同的点,其中-1000≤xy≤1000从而形成三角形。考虑以下两个三角形A-340,495B-153-910C835-947X-175,41Y-421-714Z574 - 645可以验证三角形ABC包含原点而三角形XYZ不包含原点。使用triangles.txt右键单击并将“Save Link / Target As ...”保存包含一千个“随机”三角形坐标的27K文本文件找到内部包含原点的三角形数。注意文件中的前两个示例表示上面给出的示例中的三角形。
Three distinct points are plotted at random on a Cartesian plane, for which -1000 ≤ x, y ≤ 1000, such that a triangle is formed.
Consider the following two triangles:
A(-340,495), B(-153,-910), C(835,-947)
X(-175,41), Y(-421,-714), Z(574,-645)
It can be verified that triangle ABC contains the origin, whereas triangle XYZ does not.
Using triangles.txt (right click and 'Save Link/Target As...'), a 27K text file containing the coordinates of one thousand "random" triangles, find the number of triangles for which the interior contains the origin.
NOTE: The first two examples in the file represent the triangles in the example given above.
# --hints--
`euler102()`应该返回228
`euler102()` should return 228.
```js
assert.strictEqual(euler102(), 228);

View File

@ -1,18 +1,34 @@
---
id: 5900f3d61000cf542c50fee7
title: 问题103特殊子集和最佳
title: 'Problem 103: Special subset sums: optimum'
challengeType: 5
videoUrl: ''
forumTopicId: 301727
dashedName: problem-103-special-subset-sums-optimum
---
# --description--
设SA表示大小为n的集合A中的元素之和。如果对于任何两个非空的不相交子集B和C我们将其称为特殊和集合以下属性为真SB≠SC;也就是说子集的总和不能相等。如果B包含的元素多于C则SB> SC。如果对于给定的nSA被最小化我们将其称为最优的特殊和集。下面给出前五个最佳特殊和集。 n = 1{1} n = 2{1,2} n = 3{2,3,4} n = 4{3,5,6,7} n = 5{6,9,11 12,13}似乎对于给定的最优集合A = {a1a2...an}下一个最优集合的形式为B = {ba1 + ba2 + b... ..an + b}其中b是前一行的“中间”元素。通过应用这个“规则”我们期望n = 6的最优集合为A = {11,17,20,22,23,24}其中SA= 117.但是,这不是最佳集合因为我们仅应用算法来提供接近最优的集合。 n = 6的最佳集合是A = {11,18,19,20,22,25}其中SA= 115并且对应的集合字符串111819202225。假设A是n =的最优特殊和集合7找到它的设置字符串。注意此问题与问题105和问题106有关。
Let S(A) represent the sum of elements in set A of size n. We shall call it a special sum set if for any two non-empty disjoint subsets, B and C, the following properties are true:
S(B) ≠ S(C); that is, sums of subsets cannot be equal.
If B contains more elements than C then S(B) > S(C).
If S(A) is minimised for a given n, we shall call it an optimum special sum set. The first five optimum special sum sets are given below.
n = 1: {1}n = 2: {1, 2}n = 3: {2, 3, 4}n = 4: {3, 5, 6, 7}n = 5: {6, 9, 11, 12, 13}
It seems that for a given optimum set, A = {a1, a2, ... , an}, the next optimum set is of the form B = {b, a1+b, a2+b, ... ,an+b}, where b is the "middle" element on the previous row.
By applying this "rule" we would expect the optimum set for n = 6 to be A = {11, 17, 20, 22, 23, 24}, with S(A) = 117. However, this is not the optimum set, as we have merely applied an algorithm to provide a near optimum set. The optimum set for n = 6 is A = {11, 18, 19, 20, 22, 25}, with S(A) = 115 and corresponding set string: 111819202225.
Given that A is an optimum special sum set for n = 7, find its set string.
NOTE: This problem is related to Problem 105 and Problem 106.
# --hints--
`euler103()`应该返回20313839404245
`euler103()` should return 20313839404245.
```js
assert.strictEqual(euler103(), 20313839404245);

View File

@ -1,18 +1,24 @@
---
id: 5900f3d51000cf542c50fee6
title: 问题104Pandigital Fibonacci结束
title: 'Problem 104: Pandigital Fibonacci ends'
challengeType: 5
videoUrl: ''
forumTopicId: 301728
dashedName: problem-104-pandigital-fibonacci-ends
---
# --description--
Fibonacci序列由递归关系定义Fn = Fn-1 + Fn-2其中F1 = 1且F2 = 1.事实证明包含113位数字的F541是第一个斐波那契数字其中最后九个数字是1-9 pandigital包含所有数字1到9但不一定按顺序。 F2749包含575个数字是第一个斐波那契数字前九个数字是1-9 pandigital。鉴于Fk是第一个斐波纳契数前九个数字和后九个数字是1-9 pandigital找到k。
The Fibonacci sequence is defined by the recurrence relation:
Fn = Fn1 + Fn2, where F1 = 1 and F2 = 1.
It turns out that F541, which contains 113 digits, is the first Fibonacci number for which the last nine digits are 1-9 pandigital (contain all the digits 1 to 9, but not necessarily in order). And F2749, which contains 575 digits, is the first Fibonacci number for which the first nine digits are 1-9 pandigital.
Given that Fk is the first Fibonacci number for which the first nine digits AND the last nine digits are 1-9 pandigital, find k.
# --hints--
`euler104()`应返回329468
`euler104()` should return 329468.
```js
assert.strictEqual(euler104(), 329468);

View File

@ -1,18 +1,28 @@
---
id: 5900f3d61000cf542c50fee8
title: 问题105特殊子集总和测试
title: 'Problem 105: Special subset sums: testing'
challengeType: 5
videoUrl: ''
forumTopicId: 301729
dashedName: problem-105-special-subset-sums-testing
---
# --description--
设SA表示大小为n的集合A中的元素之和。如果对于任何两个非空的不相交子集B和C我们将其称为特殊和集合以下属性为真SB≠SC;也就是说子集的总和不能相等。如果B包含的元素多于C则SB> SC。例如{81,88,75,42,87,84,86,65}不是一个特殊的和集因为65 + 87 + 88 = 75 + 81 + 84而{157,150,164,119,79 159,161,139,158}满足所有可能的子集对组合的规则并且SA= 1286.使用sets.txt右键单击并“将链接/目标另存为...”4K文本文件包含七到十二个元素的一百个集合上面给出的两个例子是文件中的前两个集合识别所有特殊的和集A1A2...Ak并找到S的值 A1+ SA2+ ... + SAk。注意此问题与问题103和问题106有关。
Let S(A) represent the sum of elements in set A of size n. We shall call it a special sum set if for any two non-empty disjoint subsets, B and C, the following properties are true:
S(B) ≠ S(C); that is, sums of subsets cannot be equal.
If B contains more elements than C then S(B) > S(C).
For example, {81, 88, 75, 42, 87, 84, 86, 65} is not a special sum set because 65 + 87 + 88 = 75 + 81 + 84, whereas {157, 150, 164, 119, 79, 159, 161, 139, 158} satisfies both rules for all possible subset pair combinations and S(A) = 1286.
Using sets.txt (right click and "Save Link/Target As..."), a 4K text file with one-hundred sets containing seven to twelve elements (the two examples given above are the first two sets in the file), identify all the special sum sets, A1, A2, ..., Ak, and find the value of S(A1) + S(A2) + ... + S(Ak).
NOTE: This problem is related to Problem 103 and Problem 106.
# --hints--
`euler105()`应返回73702
`euler105()` should return 73702.
```js
assert.strictEqual(euler105(), 73702);

View File

@ -1,18 +1,30 @@
---
id: 5900f3d71000cf542c50fee9
title: 问题106特殊子集和元测试
title: 'Problem 106: Special subset sums: meta-testing'
challengeType: 5
videoUrl: ''
forumTopicId: 301730
dashedName: problem-106-special-subset-sums-meta-testing
---
# --description--
设SA表示大小为n的集合A中的元素之和。如果对于任何两个非空的不相交子集B和C我们将其称为特殊和集合以下属性为真SB≠SC;也就是说子集的总和不能相等。如果B包含的元素多于C则SB> SC。对于这个问题我们假设给定的集合包含n个严格增加的元素并且它已经满足第二个规则。令人惊讶的是在可以从n = 4的集合中获得的25个可能的子集对中仅需要对这些对中的1个进行相等性测试第一规则。类似地当n = 7时仅需要测试966个子集对中的70个。对于n = 12可以获得多少261625个子集对需要进行相等性测试注意此问题与问题103和问题105有关。
Let S(A) represent the sum of elements in set A of size n. We shall call it a special sum set if for any two non-empty disjoint subsets, B and C, the following properties are true:
S(B) ≠ S(C); that is, sums of subsets cannot be equal.
If B contains more elements than C then S(B) > S(C).
For this problem we shall assume that a given set contains n strictly increasing elements and it already satisfies the second rule.
Surprisingly, out of the 25 possible subset pairs that can be obtained from a set for which n = 4, only 1 of these pairs need to be tested for equality (first rule). Similarly, when n = 7, only 70 out of the 966 subset pairs need to be tested.
For n = 12, how many of the 261625 subset pairs that can be obtained need to be tested for equality?
NOTE: This problem is related to Problem 103 and Problem 105.
# --hints--
`euler106()`应返回21384
`euler106()` should return 21384.
```js
assert.strictEqual(euler106(), 21384);

View File

@ -1,22 +1,22 @@
---
id: 5900f3d91000cf542c50feea
title: 问题107最小网络
title: 'Problem 107: Minimal network'
challengeType: 5
videoUrl: ''
forumTopicId: 301731
dashedName: problem-107-minimal-network
---
# --description--
以下无向网络由七个顶点和十二个边组成,总权重为243
The following undirected network consists of seven vertices and twelve edges with a total weight of 243.
相同的网络可以由下面的矩阵表示。 ABCDEFG A-161221 --- B16--1720-- C12--28-31- D211728-181923 E-20-18--11 F-3119--27 G --- 231127-但是有可能通过删除一些边缘来优化网络并仍然确保网络上的所有点保持连接。实现最大节省的网络如下所示。它的权重为93比原始网络节省了243 - 93 = 150
The same network can be represented by the matrix below. ABCDEFG A-161221--- B16--1720-- C12--28-31- D211728-181923 E-20-18--11 F--3119--27 G---231127- However, it is possible to optimise the network by removing some edges and still ensure that all points on the network remain connected. The network which achieves the maximum saving is shown below. It has a weight of 93, representing a saving of 243 93 = 150 from the original network.
使用network.txt(右键单击并“保存链接/目标为...”一个6K文本文件包含一个具有四十个顶点的网络并以矩阵形式给出找到通过删除冗余边缘可以实现的最大节省确保网络保持连接。
Using network.txt (right click and 'Save Link/Target As...'), a 6K text file containing a network with forty vertices, and given in matrix form, find the maximum saving which can be achieved by removing redundant edges whilst ensuring that the network remains connected.
# --hints--
`euler107()`应该返回259679
`euler107()` should return 259679.
```js
assert.strictEqual(euler107(), 259679);

View File

@ -1,20 +1,28 @@
---
id: 5900f3d91000cf542c50feeb
title: 问题108丢番图互惠I
title: 'Problem 108: Diophantine Reciprocals I'
challengeType: 5
videoUrl: ''
forumTopicId: 301732
dashedName: problem-108-diophantine-reciprocals-i
---
# --description--
在下面的等式中xy和n是正整数。 1 / `x` + 1 / `y` = 1 / `n`对于`n` = 4恰好有三种不同的解1/5 + 1/20 = 1/4
In the following equation x, y, and n are positive integers.
1/`x` + 1/`y` = 1/`n`
For `n` = 4 there are exactly three distinct solutions:
1/5 + 1/20 = 1/4
1/6 + 1/12 = 1/4
1/8 + 1/8 = 1/4不同解的数量超过一千的`n的`最小值是多少?
1/8 + 1/8 = 1/4
What is the least value of `n` for which the number of distinct solutions exceeds one-thousand?
# --hints--
diophantineOne `diophantineOne()`应返回180180
`diophantineOne()` should return 180180.
```js
assert.strictEqual(diophantineOne(), 180180);

View File

@ -1,16 +1,16 @@
---
id: 5900f3db1000cf542c50feec
title: 问题109飞镖
title: 'Problem 109: Darts'
challengeType: 5
videoUrl: ''
forumTopicId: 301733
dashedName: problem-109-darts
---
# --description--
在飞镖游戏中,玩家在目标板上投掷三个飞镖,该目标板被分成二十个相等大小的部分,编号为一到二十。
In the game of darts a player throws three darts at a target board which is split into twenty equal sized sections numbered one to twenty.
飞镖的得分由飞镖着陆区域的数量决定。红色/绿色外圈外的飞镖着陆得分为零。该戒指内的黑色和奶油色区域代表单个分数。然而,红色/绿色外圈和中圈分别得分为双倍和高音。在董事会的中心是两个同心圆称为公牛区或公牛眼。外面的公牛价值25点内部公牛是双倍价值50点。规则有很多变化但在最流行的游戏中玩家将以301或501的分数开始并且第一个将他们的总跑动总数减少到零的玩家是胜利者。然而玩“双打”系统是正常的这意味着玩家必须在他们的最终飞镖上获得双倍包括在棋盘中央的双靶心才能获胜;任何其他飞镖都会将他们的跑动总数减少到一个或更低意味着这组三个飞镖的得分是“半身像”。当玩家能够完成他们当前的分数时,它被称为“结账”,最高结账时间是170T20 T20 D25两个高音20和双牛。有6种截然不同的结账方式分数为6
The score of a dart is determined by the number of the region that the dart lands in. A dart landing outside the red/green outer ring scores zero. The black and cream regions inside this ring represent single scores. However, the red/green outer ring and middle ring score double and treble scores respectively. At the centre of the board are two concentric circles called the bull region, or bulls-eye. The outer bull is worth 25 points and the inner bull is a double, worth 50 points. There are many variations of rules but in the most popular game the players will begin with a score 301 or 501 and the first player to reduce their running total to zero is a winner. However, it is normal to play a "doubles out" system, which means that the player must land a double (including the double bulls-eye at the centre of the board) on their final dart to win; any other dart that would reduce their running total to one or lower means the score for that set of three darts is "bust". When a player is able to finish on their current score it is called a "checkout" and the highest checkout is 170: T20 T20 D25 (two treble 20s and double bull). There are exactly eleven distinct ways to checkout on a score of 6:
D3
@ -24,11 +24,11 @@ S4 D1
S1 S1 D2 S1 T1 D1 S1 S3 D1 D1 D1 D1 D1 S2 D1 S2 S2 D1
请注意D1 D2被认为与D2 D1不同因为它们在不同的双打上完成。但是组合S1 T1 D1被认为与T1 S1 D1相同。此外我们不会在考虑组合时包含未命中数;例如D3与0 D3和0 0 D3相同。令人难以置信的是共有42336种不同的检查方式。玩家以低于100的分数结账有多少种不同的方式
Note that D1 D2 is considered different to D2 D1 as they finish on different doubles. However, the combination S1 T1 D1 is considered the same as T1 S1 D1. In addition we shall not include misses in considering combinations; for example, D3 is the same as 0 D3 and 0 0 D3. Incredibly there are 42336 distinct ways of checking out in total. How many distinct ways can a player checkout with a score less than 100?
# --hints--
`euler109()`应返回38182
`euler109()` should return 38182.
```js
assert.strictEqual(euler109(), 38182);

View File

@ -1,71 +1,62 @@
---
id: 5900f3781000cf542c50fe8a
title: 问题11网格中最大的产品
title: 'Problem 11: Largest product in a grid'
challengeType: 5
videoUrl: ''
forumTopicId: 301734
dashedName: problem-11-largest-product-in-a-grid
---
# --description--
在下面的20×20网格中沿对角线的四个数字标记为红色。
In the 20×20 grid below, four numbers along a diagonal line have been marked in red.
08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08
<div style='text-align: center;'>
08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08<br>
49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00<br>
81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65<br>
52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91<br>
22 31 16 71 51 67 63 89 41 92 36 54 22 40 40 28 66 33 13 80<br>
24 47 32 60 99 03 45 02 44 75 33 53 78 36 84 20 35 17 12 50<br>
32 98 81 28 64 23 67 10 <span style='color: red'><b>26</b></span> 38 40 67 59 54 70 66 18 38 64 70<br>
67 26 20 68 02 62 12 20 95 <span style='color: red'><b>63</b></span> 94 39 63 08 40 91 66 49 94 21<br>
24 55 58 05 66 73 99 26 97 17 <span style='color: red'><b>78</b></span> 78 96 83 14 88 34 89 63 72<br>
21 36 23 09 75 00 76 44 20 45 35 <span style='color: red'><b>14</b></span> 00 61 33 97 34 31 33 95<br>
78 17 53 28 22 75 31 67 15 94 03 80 04 62 16 14 09 53 56 92<br>
16 39 05 42 96 35 31 47 55 58 88 24 00 17 54 24 36 29 85 57<br>
86 56 00 48 35 71 89 07 05 44 44 37 44 60 21 58 51 54 17 58<br>
19 80 81 68 05 94 47 69 28 73 92 13 86 52 17 77 04 89 55 40<br>
04 52 08 83 97 35 99 16 07 97 57 32 16 26 26 79 33 27 98 66<br>
88 36 68 87 57 62 20 72 03 46 33 67 46 55 12 32 63 93 53 69<br>
04 42 16 73 38 25 39 11 24 94 72 18 08 46 29 32 40 62 76 36<br>
20 69 36 41 72 30 23 88 34 62 99 69 82 67 59 85 74 04 36 16<br>
20 73 35 29 78 31 90 01 74 31 49 71 48 86 81 16 23 57 05 54<br>
01 70 54 71 83 51 54 69 16 92 33 48 61 43 52 01 89 19 67 48<br>
</div>
49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00
The product of these numbers is 26 × 63 × 78 × 14 = 1788696.
81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65
52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91
22 31 16 71 51 67 63 89 41 92 36 54 22 40 40 28 66 33 13 80
24 47 32 60 99 03 45 02 44 75 33 53 78 36 84 20 35 17 12 50
32 98 81 28 64 23 67 10 **26** 38 40 67 59 54 70 66 18 38 64 70
67 26 20 68 02 62 12 20 95 **63** 94 39 63 08 40 91 66 49 94 21
24 55 58 05 66 73 99 26 97 17 **78** 78 96 83 14 88 34 89 63 72
21 36 23 09 75 00 76 44 20 45 35 **14** 00 61 33 97 34 31 33 95
78 17 53 28 22 75 31 67 15 94 03 80 04 62 16 14 09 53 56 92
16 39 05 42 96 35 31 47 55 58 88 24 00 17 54 24 36 29 85 57
86 56 00 48 35 71 89 07 05 44 44 37 44 60 21 58 51 54 17 58
19 80 81 68 05 94 47 69 28 73 92 13 86 52 17 77 04 89 55 40
04 52 08 83 97 35 99 16 07 97 57 32 16 26 26 79 33 27 98 66
88 36 68 87 57 62 20 72 03 46 33 67 46 55 12 32 63 93 53 69
04 42 16 73 38 25 39 11 24 94 72 18 08 46 29 32 40 62 76 36
20 69 36 41 72 30 23 88 34 62 99 69 82 67 59 85 74 04 36 16
20 73 35 29 78 31 90 01 74 31 49 71 48 86 81 16 23 57 05 54
01 70 54 71 83 51 54 69 16 92 33 48 61 43 52 01 89 19 67 48
这些数字的乘积是26×63×78×14 = 1788696.在给定的`arr`网格中,相同方向(上,下,左,右或对角)的四个相邻数字的最大乘积是多少?
What is the greatest product of four adjacent numbers in the same direction (up, down, left, right, or diagonally) in a given `arr` grid?
# --hints--
`largestGridProduct(grid)`应该返回70600674。
`largestGridProduct(testGrid)` should return a number.
```js
assert.strictEqual(largestGridProduct(grid), 70600674);
assert(typeof largestGridProduct(testGrid) === 'number');
```
`largestGridProduct(testGrid)`应该返回14169081
`largestGridProduct(testGrid)` should return 14169081.
```js
assert.strictEqual(largestGridProduct(testGrid), 14169081);
```
`largestGridProduct(grid)` should return 70600674.
```js
assert.strictEqual(largestGridProduct(grid), 70600674);
```
# --seed--
## --seed-contents--

View File

@ -1,18 +1,24 @@
---
id: 5900f3db1000cf542c50feed
title: 问题110丢番图互惠II
title: 'Problem 110: Diophantine Reciprocals II'
challengeType: 5
videoUrl: ''
forumTopicId: 301735
dashedName: problem-110-diophantine-reciprocals-ii
---
# --description--
在下面的等式中xy和n是正整数。 1 / `x` + 1 / `y` = 1 / `n`可以证实,当`n` = 1260时存在113个不同的解并且这是`n的`最小值其中不同解的总数超过100。 `n的`最小值是多少,不同解决方案的数量超过四百万?
In the following equation x, y, and n are positive integers.
1/`x` + 1/`y` = 1/`n`
It can be verified that when `n` = 1260 there are 113 distinct solutions and this is the least value of `n` for which the total number of distinct solutions exceeds one hundred.
What is the least value of `n` for which the number of distinct solutions exceeds four million?
# --hints--
`diophantineTwo`应该返回9350130049860600
`diophantineTwo()` should return 9350130049860600.
```js
assert.strictEqual(diophantineTwo(), 9350130049860600);

View File

@ -1,22 +1,30 @@
---
id: 5900f3db1000cf542c50feee
title: 问题111运行的Primes
title: 'Problem 111: Primes with runs'
challengeType: 5
videoUrl: ''
forumTopicId: 301736
dashedName: problem-111-primes-with-runs
---
# --description--
考虑到包含重复数字的4位数素数很明显它们不能全部相同1111可被11整除2222可被22整除依此类推。但是有九个4位数的素数包含三个素数1117,1151,1171,1181,1511,1811,2111,4111,8111我们将说Mnd表示n-的最大重复数位数。数字素数其中d是重复数字Nnd表示这些素数的数量Snd表示这些素数的总和。所以M4,1= 3是4位数的素数的最大重复位数其中一个是重复的数字有N4,1= 9个这样的素数这些素数的总和是S 4,1= 22275.事实证明对于d = 0只能使M4,0= 2个重复数字但是存在N4,0= 13个这样的情况。同样地我们获得了4位素数的以下结果。
Considering 4-digit primes containing repeated digits it is clear that they cannot all be the same: 1111 is divisible by 11, 2222 is divisible by 22, and so on. But there are nine 4-digit primes containing three ones:
数字d M4dN4dS4d0 2 13 67061 1 3 9 22275 2 3 1 2221 3 3 12 46214 4 3 2 8888 5 3 1 5557 6 3 1 6661 7 3 9 57863 8 3 1 8887 9 3 7 48073
1117, 1151, 1171, 1181, 1511, 1811, 2111, 4111, 8111
对于d = 0到9所有S4d的总和是273700.求所有S10d的总和。
We shall say that M(n, d) represents the maximum number of repeated digits for an n-digit prime where d is the repeated digit, N(n, d) represents the number of such primes, and S(n, d) represents the sum of these primes.
So M(4, 1) = 3 is the maximum number of repeated digits for a 4-digit prime where one is the repeated digit, there are N(4, 1) = 9 such primes, and the sum of these primes is S(4, 1) = 22275. It turns out that for d = 0, it is only possible to have M(4, 0) = 2 repeated digits, but there are N(4, 0) = 13 such cases.
In the same way we obtain the following results for 4-digit primes.
Digit, d M(4, d) N(4, d) S(4, d) 0 2 13 67061 1 3 9 22275 2 3 1 2221 3 3 12 46214 4 3 2 8888 5 3 1 5557 6 3 1 6661 7 3 9 57863 8 3 1 8887 9 3 7 48073
For d = 0 to 9, the sum of all S(4, d) is 273700. Find the sum of all S(10, d).
# --hints--
`euler111()`应返回612407567715
`euler111()` should return 612407567715.
```js
assert.strictEqual(euler111(), 612407567715);

View File

@ -1,18 +1,28 @@
---
id: 5900f3dd1000cf542c50feef
title: 问题112有弹性的数字
title: 'Problem 112: Bouncy numbers'
challengeType: 5
videoUrl: ''
forumTopicId: 301738
dashedName: problem-112-bouncy-numbers
---
# --description--
如果左边的数字没有超过数字,则从左到右工作,称为递增数字;例如134468。同样如果右边的数字没有超过数字则称为递减数字;例如66420。我们将调用一个既不增加也不减少“有弹性”数的正整数;例如155349。显然不会有任何低于一百的弹性数字但只有超过一千525的数字超过一半是有弹性的。事实上有弹性数字首次达到50的最小数量是538.令人惊讶的是有弹性的数字变得越来越普遍当我们达到21780时有弹性数字的比例等于90。找出有弹性数字的比例正好为99的最小数字。
Working from left-to-right if no digit is exceeded by the digit to its left it is called an increasing number; for example, 134468.
Similarly if no digit is exceeded by the digit to its right it is called a decreasing number; for example, 66420.
We shall call a positive integer that is neither increasing nor decreasing a "bouncy" number; for example, 155349.
Clearly there cannot be any bouncy numbers below one-hundred, but just over half of the numbers below one-thousand (525) are bouncy. In fact, the least number for which the proportion of bouncy numbers first reaches 50% is 538.
Surprisingly, bouncy numbers become more and more common and by the time we reach 21780 the proportion of bouncy numbers is equal to 90%.
Find the least number for which the proportion of bouncy numbers is exactly 99%.
# --hints--
`euler112()`应返回1587000
`euler112()` should return 1587000.
```js
assert.strictEqual(euler112(), 1587000);

View File

@ -1,18 +1,26 @@
---
id: 5900f3dd1000cf542c50fef0
title: 问题113非弹性数字
title: 'Problem 113: Non-bouncy numbers'
challengeType: 5
videoUrl: ''
forumTopicId: 301739
dashedName: problem-113-non-bouncy-numbers
---
# --description--
如果左边的数字没有超过数字,则从左到右工作,称为递增数字;例如134468。同样如果右边的数字没有超过数字则称为递减数字;例如66420。我们将调用一个既不增加也不减少“有弹性”数的正整数;例如随着n的增加低于n的弹性数的比例增加使得只有12951个数字低于一百万个而不是有弹性而只有277032个非有弹性的数字低于1010.一个数量低于一个googol10100 )是不是有弹性?
Working from left-to-right if no digit is exceeded by the digit to its left it is called an increasing number; for example, 134468.
Similarly if no digit is exceeded by the digit to its right it is called a decreasing number; for example, 66420.
We shall call a positive integer that is neither increasing nor decreasing a "bouncy" number; for example, 155349.
As n increases, the proportion of bouncy numbers below n increases such that there are only 12951 numbers below one-million that are not bouncy and only 277032 non-bouncy numbers below 1010.
How many numbers below a googol (10100) are not bouncy?
# --hints--
`euler113()`应该返回51161058134250
`euler113()` should return 51161058134250.
```js
assert.strictEqual(euler113(), 51161058134250);

View File

@ -1,20 +1,20 @@
---
id: 5900f3e01000cf542c50fef2
title: 问题114计数块组合I
title: 'Problem 114: Counting block combinations I'
challengeType: 5
videoUrl: ''
forumTopicId: 301740
dashedName: problem-114-counting-block-combinations-i
---
# --description--
测量七个单元长度的行具有红色块,其上放置有最小长度为三个单元,使得任何两个红色块(允许为不同长度)由至少一个黑色方块隔开。有七种方法可以做到这一点。
A row measuring seven units in length has red blocks with a minimum length of three units placed on it, such that any two red blocks (which are allowed to be different lengths) are separated by at least one black square. There are exactly seventeen ways of doing this.
一行可以测量多达50个长度的行数注意虽然上面的示例不适合这种可能性但通常允许混合块大小。例如在一个长度为8个单位的行上您可以使用红色3黑色1和红色4
How many ways can a row measuring fifty units in length be filled? NOTE: Although the example above does not lend itself to the possibility, in general it is permitted to mix block sizes. For example, on a row measuring eight units in length you could use red (3), black (1), and red (4).
# --hints--
`euler114()`应该返回16475640049
`euler114()` should return 16475640049.
```js
assert.strictEqual(euler114(), 16475640049);

View File

@ -1,18 +1,30 @@
---
id: 5900f3df1000cf542c50fef1
title: 问题115计数块组合II
title: 'Problem 115: Counting block combinations II'
challengeType: 5
videoUrl: ''
forumTopicId: 301741
dashedName: problem-115-counting-block-combinations-ii
---
# --description--
注意这是问题114的更难的版本。测量n个单位长度的行具有红色块其上放置最小长度为m个单位使得任何两个红色块允许不同长度被分开至少有一个黑色方块。让fill-count函数Fmn表示可以填充行的方式的数量。例如F3,29= 673135和F3,30= 1089155.也就是说对于m = 3可以看出n = 30是填充计数函数首次超过的最小值一百万。同样对于m = 10可以验证F10,56= 880711和F10,57= 1148904因此n = 57是填充计数函数首次超过的最小值一百万。对于m = 50找到填充计数函数首先超过一百万的n的最小值。
NOTE: This is a more difficult version of Problem 114.
A row measuring n units in length has red blocks with a minimum length of m units placed on it, such that any two red blocks (which are allowed to be different lengths) are separated by at least one black square.
Let the fill-count function, F(m, n), represent the number of ways that a row can be filled.
For example, F(3, 29) = 673135 and F(3, 30) = 1089155.
That is, for m = 3, it can be seen that n = 30 is the smallest value for which the fill-count function first exceeds one million.
In the same way, for m = 10, it can be verified that F(10, 56) = 880711 and F(10, 57) = 1148904, so n = 57 is the least value for which the fill-count function first exceeds one million.
For m = 50, find the least value of n for which the fill-count function first exceeds one million.
# --hints--
`euler115()`应返回168
`euler115()` should return 168.
```js
assert.strictEqual(euler115(), 168);

View File

@ -1,24 +1,26 @@
---
id: 5900f3e01000cf542c50fef3
title: 问题116红色绿色或蓝色瓷砖
title: 'Problem 116: Red, green or blue tiles'
challengeType: 5
videoUrl: ''
forumTopicId: 301742
dashedName: problem-116-red-green-or-blue-tiles
---
# --description--
一排五个黑色正方形瓷砖是用彩色椭圆形瓷砖代替的其中红色长度为2绿色长度为3或蓝色长度为4。如果选择红色瓷砖则可以通过七种方式完成此操作。
A row of five black square tiles is to have a number of its tiles replaced with coloured oblong tiles chosen from red (length two), green (length three), or blue (length four).
如果选择绿色瓷砖,有三种方法。
If red tiles are chosen there are exactly seven ways this can be done.
如果选择蓝色瓷砖,有两种方法。
If green tiles are chosen there are three ways.
假设颜色不能混合则有7 + 3 + 2 = 12种方式替换长度为五个单位的行中的黑色瓷砖。如果不能混合颜色并且必须使用至少一个彩色瓷砖那么连续测量五十个单位的黑色瓷砖有多少种不同的方式可以替换注意这与问题117有关。
And if blue tiles are chosen there are two ways.
Assuming that colours cannot be mixed there are 7 + 3 + 2 = 12 ways of replacing the black tiles in a row measuring five units in length. How many different ways can the black tiles in a row measuring fifty units in length be replaced if colours cannot be mixed and at least one coloured tile must be used? NOTE: This is related to Problem 117.
# --hints--
`euler116()`应该返回20492570929
`euler116()` should return 20492570929.
```js
assert.strictEqual(euler116(), 20492570929);

View File

@ -1,20 +1,20 @@
---
id: 5900f3e21000cf542c50fef4
title: 问题117红色绿色和蓝色瓷砖
title: 'Problem 117: Red, green, and blue tiles'
challengeType: 5
videoUrl: ''
forumTopicId: 301743
dashedName: problem-117-red-green-and-blue-tiles
---
# --description--
使用黑色正方形瓷砖和椭圆形瓷砖的组合,选自:测量两个单位的红色瓷砖,测量三个单位的绿色瓷砖和测量四个单位的蓝色瓷砖,可以以十五种不同的方式平铺一个长度为五个单位的行。
Using a combination of black square tiles and oblong tiles chosen from: red tiles measuring two units, green tiles measuring three units, and blue tiles measuring four units, it is possible to tile a row measuring five units in length in exactly fifteen different ways.
一行测量五十个单位长度的平铺方式有多少注意这与问题116有关。
How many ways can a row measuring fifty units in length be tiled? NOTE: This is related to Problem 116.
# --hints--
`euler117()`应该返回100808458960497
`euler117()` should return 100808458960497.
```js
assert.strictEqual(euler117(), 100808458960497);

View File

@ -1,18 +1,20 @@
---
id: 5900f3e21000cf542c50fef5
title: 问题118Pandigital prime set
title: 'Problem 118: Pandigital prime sets'
challengeType: 5
videoUrl: ''
forumTopicId: 301744
dashedName: problem-118-pandigital-prime-sets
---
# --description--
使用所有数字1到9并自由地连接它们以形成十进制整数可以形成不同的集合。有趣的是集合{2,5,47,89,631}属于它的所有元素都是素数。包含每个数字1到9的多少个不同的集合只包含主要元素
Using all of the digits 1 through 9 and concatenating them freely to form decimal integers, different sets can be formed. Interestingly with the set {2,5,47,89,631}, all of the elements belonging to it are prime.
How many distinct sets containing each of the digits one through nine exactly once contain only prime elements?
# --hints--
`euler118()`应返回44680
`euler118()` should return 44680.
```js
assert.strictEqual(euler118(), 44680);

View File

@ -1,18 +1,24 @@
---
id: 5900f3e41000cf542c50fef6
title: 问题119数字功率总和
title: 'Problem 119: Digit power sum'
challengeType: 5
videoUrl: ''
forumTopicId: 301745
dashedName: problem-119-digit-power-sum
---
# --description--
数字512很有意思因为它等于它的数字加到某个幂的总和5 + 1 + 2 = 8,而83 = 512.具有这个属性的数字的另一个例子是614656 = 284.我们将定义一个成为这个序列的第n个术语并坚持一个数字必须包含至少两个数字才能得到一个总和。给出a2 = 512和a10 = 614656。找到a30。
The number 512 is interesting because it is equal to the sum of its digits raised to some power: 5 + 1 + 2 = 8, and 83 = 512. Another example of a number with this property is 614656 = 284.
We shall define an to be the nth term of this sequence and insist that a number must contain at least two digits to have a sum.
You are given that a2 = 512 and a10 = 614656.
Find a30.
# --hints--
`euler119()`应该返回248155780267521
`euler119()` should return 248155780267521.
```js
assert.strictEqual(euler119(), 248155780267521);

View File

@ -1,62 +1,64 @@
---
id: 5900f3781000cf542c50fe8b
title: 问题12高度可分的三角数
title: 'Problem 12: Highly divisible triangular number'
challengeType: 5
videoUrl: ''
forumTopicId: 301746
dashedName: problem-12-highly-divisible-triangular-number
---
# --description--
通过添加自然数生成三角数的序列。所以第7个三角形数字是1 + 2 + 3 + 4 + 5 + 6 + 7 = 28.前十个术语是:
The sequence of triangle numbers is generated by adding the natural numbers. So the 7th triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be:
1,3,6,10,15,21,28,36,45,55 ......
<div style='text-align: center;'>1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ...</div>
让我们列出前七个三角形数字的因子:
Let us list the factors of the first seven triangle numbers:
**1** 1
<div style='padding-left: 4em;'><b>1:</b> 1</div>
<div style='padding-left: 4em;'><b>3:</b> 1, 3</div>
<div style='padding-left: 4em;'><b>6:</b> 1, 2, 3, 6</div>
<div style='padding-left: 4em;'><b>10:</b> 1, 2, 5, 10</div>
<div style='padding-left: 4em;'><b>15:</b> 1, 3, 5, 15</div>
<div style='padding-left: 4em;'><b>21:</b> 1, 3, 7, 21</div>
<div style='padding-left: 4em;'><b>28:</b> 1, 2, 4, 7, 14, 28</div>
**3** 1,3
We can see that 28 is the first triangle number to have over five divisors.
**6** 1,2,3,6
**10** 1,2,5,10
**15** 1,3,5,15
**21** 1,3,7,21
**28** 1,2,4,7,14,28
我们可以看到28是第一个超过五个除数的三角形数。超过`n`除数的第一个三角形数的值是多少?
What is the value of the first triangle number to have over `n` divisors?
# --hints--
`divisibleTriangleNumber(5)`应该返回28。
`divisibleTriangleNumber(5)` should return a number.
```js
assert(typeof divisibleTriangleNumber(5) === 'number');
```
`divisibleTriangleNumber(5)` should return 28.
```js
assert.strictEqual(divisibleTriangleNumber(5), 28);
```
`divisibleTriangleNumber(23)`应该返回630
`divisibleTriangleNumber(23)` should return 630.
```js
assert.strictEqual(divisibleTriangleNumber(23), 630);
```
divisibleTriangleNumber `divisibleTriangleNumber(167)`应该返回1385280
`divisibleTriangleNumber(167)` should return 1385280.
```js
assert.strictEqual(divisibleTriangleNumber(167), 1385280);
```
divisibleTriangleNumber `divisibleTriangleNumber(374)`应该返回17907120
`divisibleTriangleNumber(374)` should return 17907120.
```js
assert.strictEqual(divisibleTriangleNumber(374), 17907120);
```
divisibleTriangleNumber `divisibleTriangleNumber(500)`应该返回76576500
`divisibleTriangleNumber(500)` should return 76576500.
```js
assert.strictEqual(divisibleTriangleNumber(500), 76576500);

View File

@ -1,18 +1,22 @@
---
id: 5900f3e41000cf542c50fef7
title: 问题120方形剩余部分
title: 'Problem 120: Square remainders'
challengeType: 5
videoUrl: ''
forumTopicId: 301747
dashedName: problem-120-square-remainders
---
# --description--
设r是a-1n +a + 1n除以a2时的余数。例如如果a = 7且n = 3则r = 4263 + 83 =728≡42mod 49.并且当n变化时r也将变化但是对于a = 7结果是rmax = 42。对于3≤a≤1000找到Σrmax。
Let r be the remainder when (a1)n + (a+1)n is divided by a2.
For example, if a = 7 and n = 3, then r = 42: 63 + 83 = 728 ≡ 42 mod 49. And as n varies, so too will r, but for a = 7 it turns out that rmax = 42.
For 3 ≤ a ≤ 1000, find ∑ rmax.
# --hints--
`euler120()`应返回333082500
`euler120()` should return 333082500.
```js
assert.strictEqual(euler120(), 333082500);

View File

@ -1,18 +1,24 @@
---
id: 5900f3e51000cf542c50fef8
title: 问题121光盘游戏奖金
title: 'Problem 121: Disc game prize fund'
challengeType: 5
videoUrl: ''
forumTopicId: 301748
dashedName: problem-121-disc-game-prize-fund
---
# --description--
一个包包含一个红色圆盘和一个蓝色圆盘。在有机会的游戏中玩家随机拍摄光盘并记录其颜色。每次转动后光盘返回到包中添加一个额外的红色光盘随机拍摄另一张光盘。如果玩家在游戏结束时拍摄的红色光盘多于红色光盘则玩家可以支付1英镑玩游戏并获胜。如果游戏进行了四轮比赛那么玩家获胜的概率恰好是11/120因此银行家在这场比赛中应该分配的最高奖金将是10英镑然后才会产生损失。请注意任何支付都将是一个整数磅并且还包括为玩游戏而支付的原始£1因此在给出的示例中玩家实际上赢得了9英镑。找到应该分配给单个游戏的最大奖金其中玩15个回合。
A bag contains one red disc and one blue disc. In a game of chance a player takes a disc at random and its colour is noted. After each turn the disc is returned to the bag, an extra red disc is added, and another disc is taken at random.
The player pays £1 to play and wins if they have taken more blue discs than red discs at the end of the game.
If the game is played for four turns, the probability of a player winning is exactly 11/120, and so the maximum prize fund the banker should allocate for winning in this game would be £10 before they would expect to incur a loss. Note that any payout will be a whole number of pounds and also includes the original £1 paid to play the game, so in the example given the player actually wins £9.
Find the maximum prize fund that should be allocated to a single game in which fifteen turns are played.
# --hints--
`euler121()`应返回2269
`euler121()` should return 2269.
```js
assert.strictEqual(euler121(), 2269);

View File

@ -1,18 +1,32 @@
---
id: 5900f3e61000cf542c50fef9
title: 问题122有效取幂
title: 'Problem 122: Efficient exponentiation'
challengeType: 5
videoUrl: ''
forumTopicId: 301749
dashedName: problem-122-efficient-exponentiation
---
# --description--
最简单的计算n15的方法需要十四次乘法n×n×...×n = n15但是使用“二进制”方法可以在六次乘法中计算它n×n = n2n2×n2 = n4n4×n4 = n8n8 ×n4 = n12n12×n2 = n14n14×n = n15然而只能在五次乘法中计算它n×n = n2n2×n = n3n3×n3 = n6n6×n6 = n12n12×n3 = n15我们将定义m k是计算nk的最小乘法数;例如m15= 5.对于1≤k≤200找到Σmk
The most naive way of computing n15 requires fourteen multiplications:
n × n × ... × n = n15
But using a "binary" method you can compute it in six multiplications:
n × n = n2n2 × n2 = n4n4 × n4 = n8n8 × n4 = n12n12 × n2 = n14n14 × n = n15
However it is yet possible to compute it in only five multiplications:
n × n = n2n2 × n = n3n3 × n3 = n6n6 × n6 = n12n12 × n3 = n15
We shall define m(k) to be the minimum number of multiplications to compute nk; for example m(15) = 5.
For 1 ≤ k ≤ 200, find ∑ m(k).
# --hints--
`euler122()`应返回1582
`euler122()` should return 1582.
```js
assert.strictEqual(euler122(), 1582);

View File

@ -1,18 +1,24 @@
---
id: 5900f3e71000cf542c50fefa
title: 问题123素数正方形余数
title: 'Problem 123: Prime square remainders'
challengeType: 5
videoUrl: ''
forumTopicId: 301750
dashedName: problem-123-prime-square-remainders
---
# --description--
令pn为第n个素数2,3,5,7,11 ......并且当rpn-1n +pn + 1n除以pn2时令r为余数。例如当n = 3时p3 = 5并且43 + 63 =280≡5mod 25.余数首先超过109的n的最小值是7037.求出余数首次超过的n的最小值1010。
Let pn be the nth prime: 2, 3, 5, 7, 11, ..., and let r be the remainder when (pn1)n + (pn+1)n is divided by pn2.
For example, when n = 3, p3 = 5, and 43 + 63 = 280 ≡ 5 mod 25.
The least value of n for which the remainder first exceeds 109 is 7037.
Find the least value of n for which the remainder first exceeds 1010.
# --hints--
`euler123()`应该返回21035
`euler123()` should return 21035.
```js
assert.strictEqual(euler123(), 21035);

View File

@ -1,18 +1,22 @@
---
id: 5900f3e81000cf542c50fefb
title: 问题124有序的激进分子
title: 'Problem 124: Ordered radicals'
challengeType: 5
videoUrl: ''
forumTopicId: 301751
dashedName: problem-124-ordered-radicals
---
# --description--
nradn的基数是n的不同素因子的乘积。例如504 = 23×32×7因此rad504= 2×3×7 = 42.如果我们计算1≤n≤10的radn则在radn上对它们进行排序并进行排序如果激进值相等我们得到未分类
The radical of n, rad(n), is the product of the distinct prime factors of n. For example, 504 = 23 × 32 × 7, so rad(504) = 2 × 3 × 7 = 42.
排序n radn
If we calculate rad(n) for 1 ≤ n ≤ 10, then sort them on rad(n), and sorting on n if the radical values are equal, we get:
n radnk 11
Unsorted
Sorted n rad(n)
n rad(n) k 11
111 22
@ -32,11 +36,11 @@ n radnk 11
779 1010
101010令Ek为有序n列中的第k个元素;例如E4= 8且E6= 9.如果radn按1≤n≤100000排序则找到E10000)。
101010 Let E(k) be the kth element in the sorted n column; for example, E(4) = 8 and E(6) = 9. If rad(n) is sorted for 1 ≤ n ≤ 100000, find E(10000).
# --hints--
`euler124()`应返回21417
`euler124()` should return 21417.
```js
assert.strictEqual(euler124(), 21417);

View File

@ -1,18 +1,22 @@
---
id: 5900f3e91000cf542c50fefc
title: 问题125回文总和
title: 'Problem 125: Palindromic sums'
challengeType: 5
videoUrl: ''
forumTopicId: 301752
dashedName: problem-125-palindromic-sums
---
# --description--
回文数595很有意思因为它可以写成连续正方形的总和62 + 72 + 82 + 92 + 102 + 112 + 122.正好有11个以下的回文可以写成连续的平方和并且这些回文的总和是4164.注意没有包括1 = 02 + 12因为该问题涉及正整数的平方。找到小于108的所有数字的总和这些数字都是回文并且可以写为连续正方形的总和。
The palindromic number 595 is interesting because it can be written as the sum of consecutive squares: 62 + 72 + 82 + 92 + 102 + 112 + 122.
There are exactly eleven palindromes below one-thousand that can be written as consecutive square sums, and the sum of these palindromes is 4164. Note that 1 = 02 + 12 has not been included as this problem is concerned with the squares of positive integers.
Find the sum of all the numbers less than 108 that are both palindromic and can be written as the sum of consecutive squares.
# --hints--
`euler125()`应该返回2906969179
`euler125()` should return 2906969179.
```js
assert.strictEqual(euler125(), 2906969179);

View File

@ -1,20 +1,20 @@
---
id: 5900f3ea1000cf542c50fefd
title: 问题126长方体层
title: 'Problem 126: Cuboid layers'
challengeType: 5
videoUrl: ''
forumTopicId: 301753
dashedName: problem-126-cuboid-layers
---
# --description--
覆盖尺寸为3 x 2 x 1的长方体上每个可见面的最小立方体数量为22。
The minimum number of cubes to cover every visible face on a cuboid measuring 3 x 2 x 1 is twenty-two.
如果我们在这个固体上添加第二层则需要四十六个立方体来覆盖每个可见面第三层需要七十八个立方体第四层需要一百一十八个立方体来覆盖每个可见面。然而尺寸为5 x 1 x 1的长方体上的第一层也需要22个立方体;类似地,尺寸为5 x 3 x 1,7 x 2 x 111 x 1 x 1的长方体上的第一层都包含四十六个立方体。我们将定义Cn来表示在其一个层中包含n个立方体的长方体的数量。因此C22= 2C46= 4C78= 5并且C118= 8.结果154是n的最小值其中Cn= 10。找到n的最小值其中Cn= 1000
If we then add a second layer to this solid it would require forty-six cubes to cover every visible face, the third layer would require seventy-eight cubes, and the fourth layer would require one-hundred and eighteen cubes to cover every visible face. However, the first layer on a cuboid measuring 5 x 1 x 1 also requires twenty-two cubes; similarly the first layer on cuboids measuring 5 x 3 x 1, 7 x 2 x 1, and 11 x 1 x 1 all contain forty-six cubes. We shall define C(n) to represent the number of cuboids that contain n cubes in one of its layers. So C(22) = 2, C(46) = 4, C(78) = 5, and C(118) = 8. It turns out that 154 is the least value of n for which C(n) = 10. Find the least value of n for which C(n) = 1000.
# --hints--
`euler126()`应返回18522
`euler126()` should return 18522.
```js
assert.strictEqual(euler126(), 18522);

View File

@ -1,18 +1,42 @@
---
id: 5900f3ec1000cf542c50fefe
title: 问题127abc-hits
title: 'Problem 127: abc-hits'
challengeType: 5
videoUrl: ''
forumTopicId: 301754
dashedName: problem-127-abc-hits
---
# --description--
nradn的基数是n的不同素因子的乘积。例如504 = 23×32×7因此rad504= 2×3×7 = 42.如果出现以下情况我们将正整数abc的三元组定义为abc-hitGCD ab= GCDac= GCDbc= 1 a &lt;ba + b = c radabc&lt;c例如5,27,32是abc-hit因为GCD5,27= GCD5,32= GCD27,32= 1 5 &lt;27 5 + 27 = 32 rad4320= 30 &lt;32事实证明abc-hits是非常罕见的c &lt;1000只有31次abc命中Σc= 12523。查找Σc表示c &lt;120000。
The radical of n, rad(n), is the product of distinct prime factors of n. For example, 504 = 23 × 32 × 7, so rad(504) = 2 × 3 × 7 = 42.
We shall define the triplet of positive integers (a, b, c) to be an abc-hit if:
GCD(a, b) = GCD(a, c) = GCD(b, c) = 1
a &lt; b
a + b = c
rad(abc) &lt; c
For example, (5, 27, 32) is an abc-hit, because:
GCD(5, 27) = GCD(5, 32) = GCD(27, 32) = 1
5 &lt; 27
5 + 27 = 32
rad(4320) = 30 &lt; 32
It turns out that abc-hits are quite rare and there are only thirty-one abc-hits for c &lt; 1000, with ∑c = 12523.
Find ∑c for c &lt; 120000.
# --hints--
`euler127()`应该返回18407904
`euler127()` should return 18407904.
```js
assert.strictEqual(euler127(), 18407904);

View File

@ -1,20 +1,22 @@
---
id: 5900f3ec1000cf542c50feff
title: 问题128六边形瓷砖差异
title: 'Problem 128: Hexagonal tile differences'
challengeType: 5
videoUrl: ''
forumTopicId: 301755
dashedName: problem-128-hexagonal-tile-differences
---
# --description--
编号为1的六边形瓷砖由六个六边形瓷砖环围绕从“12点钟”开始并以逆时针方向对瓷砖2至7进行编号。新环以相同的方式添加下一个环编号为8至19,20至37,38至61依此类推。下图显示了前三个环。
A hexagonal tile with number 1 is surrounded by a ring of six hexagonal tiles, starting at "12 o'clock" and numbering the tiles 2 to 7 in an anti-clockwise direction.
通过找到tile n与其六个邻居中的每一个之间的差异我们将PDn定义为那些作为素数的差异的数量。例如在瓦片8周围顺时针工作差异是12,29,11,6,1和13.因此PD8= 3.以相同的方式瓦片17周围的差异是1,17,16,1 11和10因此PD17= 2.可以证明PDn的最大值是3.如果PDn= 3的所有瓦片按升序列出以形成一个序列第10个瓦片将是271.按此顺序找到第2000个瓦片。
New rings are added in the same fashion, with the next rings being numbered 8 to 19, 20 to 37, 38 to 61, and so on. The diagram below shows the first three rings.
By finding the difference between tile n and each of its six neighbours we shall define PD(n) to be the number of those differences which are prime. For example, working clockwise around tile 8 the differences are 12, 29, 11, 6, 1, and 13. So PD(8) = 3. In the same way, the differences around tile 17 are 1, 17, 16, 1, 11, and 10, hence PD(17) = 2. It can be shown that the maximum value of PD(n) is 3. If all of the tiles for which PD(n) = 3 are listed in ascending order to form a sequence, the 10th tile would be 271. Find the 2000th tile in this sequence.
# --hints--
`euler128()`应该返回14516824220
`euler128()` should return 14516824220.
```js
assert.strictEqual(euler128(), 14516824220);

View File

@ -1,18 +1,24 @@
---
id: 5900f3ef1000cf542c50ff01
title: 问题129重新划分可分性
title: 'Problem 129: Repunit divisibility'
challengeType: 5
videoUrl: ''
forumTopicId: 301756
dashedName: problem-129-repunit-divisibility
---
# --description--
完全由1组成的数字称为repunit。我们将Rk定义为长度k的重新定位;例如R6= 111111.假设n是正整数且GCDn10= 1则可以证明总是存在一个值k其中Rk可被n整除让An成为k的最小值;例如A7= 6且A41= 5.An首先超过10的n的最小值是17.求出An首先超过1的n的最小值 - 百万。
A number consisting entirely of ones is called a repunit. We shall define R(k) to be a repunit of length k; for example, R(6) = 111111.
Given that n is a positive integer and GCD(n, 10) = 1, it can be shown that there always exists a value, k, for which R(k) is divisible by n, and let A(n) be the least such value of k; for example, A(7) = 6 and A(41) = 5.
The least value of n for which A(n) first exceeds ten is 17.
Find the least value of n for which A(n) first exceeds one-million.
# --hints--
`euler129()`应该返回1000023
`euler129()` should return 1000023.
```js
assert.strictEqual(euler129(), 1000023);

View File

@ -1,18 +1,26 @@
---
id: 5900f3ee1000cf542c50ff00
title: 问题130具有主要repunit属性的复合材料
title: 'Problem 130: Composites with prime repunit property'
challengeType: 5
videoUrl: ''
forumTopicId: 301758
dashedName: problem-130-composites-with-prime-repunit-property
---
# --description--
完全由1组成的数字称为repunit。我们将Rk定义为长度k的重新定位;例如R6= 111111.假设n是正整数且GCDn10= 1则可以证明总是存在一个值k其中Rk可被n整除让An成为k的最小值;例如A7= 6和A41= 5.对于所有素数p> 5p-1可以被Ap整除。例如当p = 41时A41= 5并且40可被5整除。但是也有罕见的复合值这也是正确的;前五个例子是91,259,451,481和703.找到n的前25个复合值之和其中GCDn10= 1n-1可被An整除。
A number consisting entirely of ones is called a repunit. We shall define R(k) to be a repunit of length k; for example, R(6) = 111111.
Given that n is a positive integer and GCD(n, 10) = 1, it can be shown that there always exists a value, k, for which R(k) is divisible by n, and let A(n) be the least such value of k; for example, A(7) = 6 and A(41) = 5.
You are given that for all primes, p > 5, that p 1 is divisible by A(p). For example, when p = 41, A(41) = 5, and 40 is divisible by 5.
However, there are rare composite values for which this is also true; the first five examples being 91, 259, 451, 481, and 703.
Find the sum of the first twenty-five composite values of n for whichGCD(n, 10) = 1 and n 1 is divisible by A(n).
# --hints--
`euler130()`应返回149253
`euler130()` should return 149253.
```js
assert.strictEqual(euler130(), 149253);

View File

@ -1,18 +1,24 @@
---
id: 5900f3ef1000cf542c50ff02
title: 问题131Prime立方体伙伴关系
title: 'Problem 131: Prime cube partnership'
challengeType: 5
videoUrl: ''
forumTopicId: 301759
dashedName: problem-131-prime-cube-partnership
---
# --description--
存在一些素数值p其中存在正整数n使得表达式n3 + n2p是完美的立方体。例如当p = 19时83 + 82×19 = 123.最令人惊讶的是对于具有此属性的每个素数n的值是唯一的并且在100之下只有四个这样的素数。一百万以下的素数有多少这个非凡的财产
There are some prime values, p, for which there exists a positive integer, n, such that the expression n3 + n2p is a perfect cube.
For example, when p = 19, 83 + 82×19 = 123.
What is perhaps most surprising is that for each prime with this property the value of n is unique, and there are only four such primes below one-hundred.
How many primes below one million have this remarkable property?
# --hints--
`euler131()`应该返回173
`euler131()` should return 173.
```js
assert.strictEqual(euler131(), 173);

View File

@ -1,18 +1,22 @@
---
id: 5900f3f11000cf542c50ff03
title: 问题132大的重新安置因素
title: 'Problem 132: Large repunit factors'
challengeType: 5
videoUrl: ''
forumTopicId: 301760
dashedName: problem-132-large-repunit-factors
---
# --description--
完全由1组成的数字称为repunit。我们将Rk定义为长度k的重新定位。例如R10= 1111111111 = 11×41×271×9091并且这些素因子的总和是9414.求出R109的前40个素因子的总和。
A number consisting entirely of ones is called a repunit. We shall define R(k) to be a repunit of length k.
For example, R(10) = 1111111111 = 11×41×271×9091, and the sum of these prime factors is 9414.
Find the sum of the first forty prime factors of R(109).
# --hints--
`euler132()`应返回843296
`euler132()` should return 843296.
```js
assert.strictEqual(euler132(), 843296);

View File

@ -1,18 +1,24 @@
---
id: 5900f3f21000cf542c50ff04
title: 问题133重新计算非因素
title: 'Problem 133: Repunit nonfactors'
challengeType: 5
videoUrl: ''
forumTopicId: 301761
dashedName: problem-133-repunit-nonfactors
---
# --description--
完全由1组成的数字称为repunit。我们将Rk定义为长度k的重新定位;例如R6= 111111.让我们考虑R10n形式的重新组合。虽然R10R100或R1000不能被17整除但R10000可被17整除。但是没有n的值R10n将除以19。事实上值得注意的是11,17,41和73是低于100的唯一四个素数可以是R10n的因子。求出十万以下所有素数的总和这些素数永远不会是R10n的因子。
A number consisting entirely of ones is called a repunit. We shall define R(k) to be a repunit of length k; for example, R(6) = 111111.
Let us consider repunits of the form R(10n).
Although R(10), R(100), or R(1000) are not divisible by 17, R(10000) is divisible by 17. Yet there is no value of n for which R(10n) will divide by 19. In fact, it is remarkable that 11, 17, 41, and 73 are the only four primes below one-hundred that can be a factor of R(10n).
Find the sum of all the primes below one-hundred thousand that will never be a factor of R(10n).
# --hints--
`euler133()`应返回453647705
`euler133()` should return 453647705.
```js
assert.strictEqual(euler133(), 453647705);

View File

@ -1,18 +1,22 @@
---
id: 5900f3f21000cf542c50ff05
title: 问题134素对对连接
title: 'Problem 134: Prime pair connection'
challengeType: 5
videoUrl: ''
forumTopicId: 301762
dashedName: problem-134-prime-pair-connection
---
# --description--
考虑连续的素数p1 = 19p2 = 23.可以证实1219是最小的数字使得最后的数字由p1形成同时也可以被p2整除。实际上除了p1 = 3和p2 = 5之外对于每对连续质数p2> p1存在n的值其中最后的数字由p1形成n可以被p2整除。设S是n的这些值中最小的。找到每对连续质数的ΣS其中5≤p1≤1000000。
Consider the consecutive primes p1 = 19 and p2 = 23. It can be verified that 1219 is the smallest number such that the last digits are formed by p1 whilst also being divisible by p2.
In fact, with the exception of p1 = 3 and p2 = 5, for every pair of consecutive primes, p2 > p1, there exist values of n for which the last digits are formed by p1 and n is divisible by p2. Let S be the smallest of these values of n.
Find ∑ S for every pair of consecutive primes with 5 ≤ p1 ≤ 1000000.
# --hints--
`euler134()`应该返回18613426663617120
`euler134()` should return 18613426663617120.
```js
assert.strictEqual(euler134(), 18613426663617120);

View File

@ -1,18 +1,24 @@
---
id: 5900f3f31000cf542c50ff06
title: 问题135同样的差异
title: 'Problem 135: Same differences'
challengeType: 5
videoUrl: ''
forumTopicId: 301763
dashedName: problem-135-same-differences
---
# --description--
给定正整数xy和z是算术级数的连续项正整数n的最小值其中等式x2-y2-z2 = n恰好有两个解是n = 27342 - 272 - 202 = 122 - 92 - 62 = 27事实证明n = 1155是具有正好十个解的最小值。 n不到一百万的多少个值有十个不同的解
Given the positive integers, x, y, and z, are consecutive terms of an arithmetic progression, the least value of the positive integer, n, for which the equation, x2 y2 z2 = n, has exactly two solutions is n = 27:
342 272 202 = 122 92 62 = 27
It turns out that n = 1155 is the least value which has exactly ten solutions.
How many values of n less than one million have exactly ten distinct solutions?
# --hints--
`euler135()`应该返回4989
`euler135()` should return 4989.
```js
assert.strictEqual(euler135(), 4989);

View File

@ -1,18 +1,24 @@
---
id: 5900f3f51000cf542c50ff07
title: 问题136单身人士差异
title: 'Problem 136: Singleton difference'
challengeType: 5
videoUrl: ''
forumTopicId: 301764
dashedName: problem-136-singleton-difference
---
# --description--
正整数xy和z是算术级数的连续项。假设n是一个正整数当n = 20时方程x2 - y2 - z2 = n恰好有一个解132 - 102 - 72 = 20实际上有二十五个n低于一百的值其中方程有一个独特的解决方案。 n小于五千万的有多少个值只有一个解
The positive integers, x, y, and z, are consecutive terms of an arithmetic progression. Given that n is a positive integer, the equation, x2 y2 z2 = n, has exactly one solution when n = 20:
132 102 72 = 20
In fact there are twenty-five values of n below one hundred for which the equation has a unique solution.
How many values of n less than fifty million have exactly one solution?
# --hints--
`euler136()`应返回2544559
`euler136()` should return 2544559.
```js
assert.strictEqual(euler136(), 2544559);

View File

@ -1,26 +1,34 @@
---
id: 5900f3f51000cf542c50ff08
title: 问题137斐波那契金块
title: 'Problem 137: Fibonacci golden nuggets'
challengeType: 5
videoUrl: ''
forumTopicId: 301765
dashedName: problem-137-fibonacci-golden-nuggets
---
# --description--
考虑无穷多项式系列AFx= xF1 + x2F2 + x3F3 + ...其中Fk是斐波纳契数列中的第k项1,1,2,3,5,8...;也就是说,Fk = Fk-1 + Fk-2F1 = 1且F2 = 1.对于这个问题我们将对x的值感兴趣其中AFx是正整数。令人惊讶的是AF1/2=1/2.1 +1/22.1 +1/23.2 +1/24.3 +1/25.5 + ......
Consider the infinite polynomial series AF(x) = xF1 + x2F2 + x3F3 + ..., where Fk is the kth term in the Fibonacci sequence: 1, 1, 2, 3, 5, 8, ... ; that is, Fk = Fk1 + Fk2, F1 = 1 and F2 = 1.
= 1/2 + 1/4 + 2/8 + 3/16 + 5/32 + ......
For this problem we shall be interested in values of x for which AF(x) is a positive integer.
= 2前五个自然数的x的相应值如下所示。
Surprisingly AF(1/2)
xAFx√2-111/ 22√13-2/ 33√89-5/ 84√34-3/ 55
=
如果x是理性的我们将AFx称为金块因为它们变得越来越稀少;例如第10个金块是74049690.找到第15个金块。
(1/2).1 + (1/2)2.1 + (1/2)3.2 + (1/2)4.3 + (1/2)5.5 + ...
= 1/2 + 1/4 + 2/8 + 3/16 + 5/32 + ...
= 2 The corresponding values of x for the first five natural numbers are shown below.
xAF(x) √211 1/22 (√132)/33 (√895)/84 (√343)/55
We shall call AF(x) a golden nugget if x is rational, because they become increasingly rarer; for example, the 10th golden nugget is 74049690. Find the 15th golden nugget.
# --hints--
`euler137()`应该返回1120149658760
`euler137()` should return 1120149658760.
```js
assert.strictEqual(euler137(), 1120149658760);

View File

@ -1,20 +1,20 @@
---
id: 5900f3f61000cf542c50ff09
title: 问题138特殊的等腰三角形
title: 'Problem 138: Special isosceles triangles'
challengeType: 5
videoUrl: ''
forumTopicId: 301766
dashedName: problem-138-special-isosceles-triangles
---
# --description--
考虑具有基本长度b = 16和腿L = 17的等腰三角形。
Consider the isosceles triangle with base length, b = 16, and legs, L = 17.
通过使用毕达哥拉斯定理可以看出三角形的高度h =√172-82= 15比基本长度小1。当b = 272L = 305我们得到h = 273这比基本长度多一个这是第二个最小的等腰三角形具有h = b±1的性质。找到12个最小等腰的ΣL h = b±1且bL为正整数的三角形。
By using the Pythagorean theorem it can be seen that the height of the triangle, h = √(172 82) = 15, which is one less than the base length. With b = 272 and L = 305, we get h = 273, which is one more than the base length, and this is the second smallest isosceles triangle with the property that h = b ± 1. Find ∑ L for the twelve smallest isosceles triangles for which h = b ± 1 and b, L are positive integers.
# --hints--
`euler138()`应该返回1118049290473932
`euler138()` should return 1118049290473932.
```js
assert.strictEqual(euler138(), 1118049290473932);

View File

@ -1,20 +1,22 @@
---
id: 5900f3f71000cf542c50ff0a
title: 问题139毕达哥拉斯瓷砖
title: 'Problem 139: Pythagorean tiles'
challengeType: 5
videoUrl: ''
forumTopicId: 301767
dashedName: problem-139-pythagorean-tiles
---
# --description--
abc表示具有整数长边的直角三角形的三个边。可以将四个这样的三角形放在一起以形成长度为c的正方形。例如3,4,5三角形可以放在一起形成一个5乘5的正方形中间有一个1个洞可以看到5乘5的正方形可以用二十五个平铺1个方格。
Let (a, b, c) represent the three sides of a right angle triangle with integral length sides. It is possible to place four such triangles together to form a square with length c.
但是如果使用5,12,13三角形则孔将按7乘7测量并且这些不能用于平铺13乘13平方。鉴于直角三角形的周长小于一亿有多少毕达哥拉斯三角形允许这样的平铺
For example, (3, 4, 5) triangles can be placed together to form a 5 by 5 square with a 1 by 1 hole in the middle and it can be seen that the 5 by 5 square can be tiled with twenty-five 1 by 1 squares.
However, if (5, 12, 13) triangles were used then the hole would measure 7 by 7 and these could not be used to tile the 13 by 13 square. Given that the perimeter of the right triangle is less than one-hundred million, how many Pythagorean triangles would allow such a tiling to take place?
# --hints--
`euler139()`应该返回10057761
`euler139()` should return 10057761.
```js
assert.strictEqual(euler139(), 10057761);

View File

@ -1,57 +1,73 @@
---
id: 5900f37a1000cf542c50fe8d
title: 问题14最长的Collatz序列
title: 'Problem 14: Longest Collatz sequence'
challengeType: 5
videoUrl: ''
forumTopicId: 301768
dashedName: problem-14-longest-collatz-sequence
---
# --description--
为正整数集定义以下迭代序列:
The following iterative sequence is defined for the set of positive integers:
`n``n` / 2 `n`是偶数)
<div style='padding-left: 4em;'><var>n</var><var>n</var>/2 (<var>n</var> is even)</div>
`n` →3 `n` + 1 `n`为奇数)
<div style='padding-left: 4em;'><var>n</var> → 3<var>n</var> + 1 (<var>n</var> is odd)</div>
使用上面的规则并从13开始我们生成以下序列
Using the rule above and starting with 13, we generate the following sequence:
13→40→20→10→5→16→8→4→2→1
<div style='text-align: center;'>13 → 40 → 20 → 10 → 5 → 16 → 8 → 4 → 2 → 1</div>
可以看出该序列从13开始并在1结束包含10个项。虽然尚未证实Collatz问题但是认为所有起始数字都在1处结束。在给定`limit`下,哪个起始数产生最长链?注意:一旦链条启动,条款允许超过一百万。
It can be seen that this sequence (starting at 13 and finishing at 1) contains 10 terms. Although it has not been proved yet (Collatz Problem), it is thought that all starting numbers finish at 1.
Which starting number, under the given `limit`, produces the longest chain?
**Note:** Once the chain starts the terms are allowed to go above one million.
# --hints--
`longestCollatzSequence(14)`应该返回9。
`longestCollatzSequence(14)` should return a number.
```js
assert(typeof longestCollatzSequence(14) === 'number');
```
`longestCollatzSequence(14)` should return 9.
```js
assert.strictEqual(longestCollatzSequence(14), 9);
```
`longestCollatzSequence(5847)`应返回3711
`longestCollatzSequence(5847)` should return 3711.
```js
assert.strictEqual(longestCollatzSequence(5847), 3711);
```
`longestCollatzSequence(46500)`应返回35655
`longestCollatzSequence(46500)` should return 35655.
```js
assert.strictEqual(longestCollatzSequence(46500), 35655);
```
`longestCollatzSequence(54512)`应返回52527
`longestCollatzSequence(54512)` should return 52527.
```js
assert.strictEqual(longestCollatzSequence(54512), 52527);
```
`longestCollatzSequence(1000000)`应返回837799。
`longestCollatzSequence(100000)` should return 77031.
```js
assert.strictEqual(longestCollatzSequence(100000), 77031);
```
`longestCollatzSequence(1000000)` should return 837799.
```js
assert.strictEqual(longestCollatzSequence(1000000), 837799);
```
# --seed--
## --seed-contents--

View File

@ -1,22 +1,26 @@
---
id: 5900f3fa1000cf542c50ff0c
title: 问题140改进的斐波那契金块
title: 'Problem 140: Modified Fibonacci golden nuggets'
challengeType: 5
videoUrl: ''
forumTopicId: 301769
dashedName: problem-140-modified-fibonacci-golden-nuggets
---
# --description--
考虑无穷多项式系列AGx= xG1 + x2G2 + x3G3 + ...其中Gk是二阶递归关系的第k项Gk = Gk-1 + Gk-2G1 = 1G2 = 4;也就是说,1,4,5,9,14,23 ......对于这个问题我们将关注x的值其中AGx是正整数。前五个自然数的x的相应值如下所示。
Consider the infinite polynomial series AG(x) = xG1 + x2G2 + x3G3 + ..., where Gk is the kth term of the second order recurrence relation Gk = Gk1 + Gk2, G1 = 1 and G2 = 4; that is, 1, 4, 5, 9, 14, 23, ... .
xAGx√5-1/ 41 2/52√22-2/ 63√137-5/ 144 1/25
For this problem we shall be concerned with values of x for which AG(x) is a positive integer.
如果x是理性的我们将称AGx为金块因为它们变得越来越稀少;例如第20个金块是211345365.找到前30个金块的总和。
The corresponding values of x for the first five natural numbers are shown below.
xAG(x) (√51)/41 2/52 (√222)/63 (√1375)/144 1/25
We shall call AG(x) a golden nugget if x is rational, because they become increasingly rarer; for example, the 20th golden nugget is 211345365. Find the sum of the first thirty golden nuggets.
# --hints--
`euler140()`应该返回5673835352990
`euler140()` should return 5673835352990.
```js
assert.strictEqual(euler140(), 5673835352990);

View File

@ -1,18 +1,26 @@
---
id: 5900f3f91000cf542c50ff0b
title: 问题141调查渐进数n它们也是正方形
title: 'Problem 141: Investigating progressive numbers, n, which are also square'
challengeType: 5
videoUrl: ''
forumTopicId: 301770
dashedName: problem-141-investigating-progressive-numbers-n-which-are-also-square
---
# --description--
正整数n除以d商和余数分别为q和r。另外dq和r是几何序列中的连续正整数项但不一定是该顺序。例如58除以6具有商9和余数4.还可以看出4,6,9是几何序列中的连续项公共比率3/2。我们将这样的数字称为n进步。一些渐进的数字例如9和10404 = 1022恰好也是完美的正方形。所有渐进完美正方形的总和低于十万是124657.找到所有渐进完美正方形的总和低于一万亿1012
A positive integer, n, is divided by d and the quotient and remainder are q and r respectively. In addition d, q, and r are consecutive positive integer terms in a geometric sequence, but not necessarily in that order.
For example, 58 divided by 6 has quotient 9 and remainder 4. It can also be seen that 4, 6, 9 are consecutive terms in a geometric sequence (common ratio 3/2).
We will call such numbers, n, progressive.
Some progressive numbers, such as 9 and 10404 = 1022, happen to also be perfect squares. The sum of all progressive perfect squares below one hundred thousand is 124657.
Find the sum of all progressive perfect squares below one trillion (1012).
# --hints--
`euler141()`应该返回878454337159
`euler141()` should return 878454337159.
```js
assert.strictEqual(euler141(), 878454337159);

View File

@ -1,18 +1,18 @@
---
id: 5900f3fa1000cf542c50ff0d
title: 问题142完美的方形集合
title: 'Problem 142: Perfect Square Collection'
challengeType: 5
videoUrl: ''
forumTopicId: 301771
dashedName: problem-142-perfect-square-collection
---
# --description--
找到具有整数x> y> z> 0的最小x + y + z使得x + yx-yx + zx-zy + zy-z都是完美正方形。
Find the smallest x + y + z with integers x > y > z > 0 such that x + y, x y, x + z, x z, y + z, y z are all perfect squares.
# --hints--
`euler142()`应返回1006193
`euler142()` should return 1006193.
```js
assert.strictEqual(euler142(), 1006193);

View File

@ -1,20 +1,24 @@
---
id: 5900f3fc1000cf542c50ff0e
title: 问题143研究三角形的Torricelli点
title: 'Problem 143: Investigating the Torricelli point of a triangle'
challengeType: 5
videoUrl: ''
forumTopicId: 301772
dashedName: problem-143-investigating-the-torricelli-point-of-a-triangle
---
# --description--
设ABC为三角形所有内角均小于120度。设X为三角形内的任意点并使XA = pXC = qXB = r。 Fermat挑战Torricelli找到X的位置使p + q + r最小化。 Torricelli能够证明如果在三角形ABC的每一侧构造等边三角形AOBBNC和AMC则AOBBNC和AMC的外接圆将在三角形内的单个点T处相交。此外他证明了T称为Torricelli / Fermat点最小化p + q + r。更值得注意的是可以证明当总和最小化时AN = BM = CO = p + q + r并且ANBM和CO也在T处相交。
Let ABC be a triangle with all interior angles being less than 120 degrees. Let X be any point inside the triangle and let XA = p, XC = q, and XB = r.
如果总和最小化并且abcpq和r都是正整数我们将称三角形ABC为Torricelli三角形。例如a = 399b = 455c = 511是Torricelli三角形的示例其中p + q + r = 784.找到Torricelli三角形的p + q +r≤120000的所有不同值的总和。
Fermat challenged Torricelli to find the position of X such that p + q + r was minimised.
Torricelli was able to prove that if equilateral triangles AOB, BNC and AMC are constructed on each side of triangle ABC, the circumscribed circles of AOB, BNC, and AMC will intersect at a single point, T, inside the triangle. Moreover he proved that T, called the Torricelli/Fermat point, minimises p + q + r. Even more remarkable, it can be shown that when the sum is minimised, AN = BM = CO = p + q + r and that AN, BM and CO also intersect at T.
If the sum is minimised and a, b, c, p, q and r are all positive integers we shall call triangle ABC a Torricelli triangle. For example, a = 399, b = 455, c = 511 is an example of a Torricelli triangle, with p + q + r = 784. Find the sum of all distinct values of p + q + r ≤ 120000 for Torricelli triangles.
# --hints--
`euler143()`应返回30758397
`euler143()` should return 30758397.
```js
assert.strictEqual(euler143(), 30758397);

View File

@ -1,22 +1,26 @@
---
id: 5900f3fc1000cf542c50ff0f
title: 问题144研究激光束的多次反射
title: 'Problem 144: Investigating multiple reflections of a laser beam'
challengeType: 5
videoUrl: ''
forumTopicId: 301773
dashedName: problem-144-investigating-multiple-reflections-of-a-laser-beam
---
# --description--
在激光物理学中“白色单元”是镜像系统其充当激光束的延迟线。光束进入细胞在镜子上反弹最终恢复原状。我们将考虑的特定白色单元是椭圆形其等式为4x2 + y2 = 100。顶部对应于-0.01≤x≤+ 0.01的部分缺失,允许光线通过孔进入和退出。
In laser physics, a "white cell" is a mirror system that acts as a delay line for the laser beam. The beam enters the cell, bounces around on the mirrors, and eventually works its way back out.
此问题中的光束从白色单元外部的点0.0,10.1开始光束首先在1.4-9.6)处撞击镜子。每次激光束撞击椭圆的表面时,它遵循通常的反射定律“入射角等于反射角”。也就是说,入射光束和反射光束都与入射点处的法线形成相同的角度。在左图中,红线表示激光束与白色单元壁之间的前两个接触点;蓝线表示在第一次反弹入射点处与椭圆相切的直线。给定椭圆的任意点xy处的切线的斜率m为m = -4x / y法线为垂直于入射点处的该切线。右侧的动画显示了光束的前10个反射。
The specific white cell we will be considering is an ellipse with the equation 4x2 + y2 = 100
在离开之前,光束到达白细胞内表面的次数是多少?
The section corresponding to 0.01 ≤ x ≤ +0.01 at the top is missing, allowing the light to enter and exit through the hole.
The light beam in this problem starts at the point (0.0,10.1) just outside the white cell, and the beam first impacts the mirror at (1.4,-9.6). Each time the laser beam hits the surface of the ellipse, it follows the usual law of reflection "angle of incidence equals angle of reflection." That is, both the incident and reflected beams make the same angle with the normal line at the point of incidence. In the figure on the left, the red line shows the first two points of contact between the laser beam and the wall of the white cell; the blue line shows the line tangent to the ellipse at the point of incidence of the first bounce.The slope m of the tangent line at any point (x,y) of the given ellipse is: m = 4x/yThe normal line is perpendicular to this tangent line at the point of incidence. The animation on the right shows the first 10 reflections of the beam.
How many times does the beam hit the internal surface of the white cell before exiting?
# --hints--
`euler144()`应返回354
`euler144()` should return 354.
```js
assert.strictEqual(euler144(), 354);

View File

@ -1,22 +1,22 @@
---
id: 5900f3fd1000cf542c50ff10
title: 问题145有多少可逆数字低于十亿
title: 'Problem 145: How many reversible numbers are there below one-billion?'
challengeType: 5
videoUrl: ''
forumTopicId: 301774
dashedName: problem-145-how-many-reversible-numbers-are-there-below-one-billion
---
# --description--
一些正整数n具有sum \[n + reversen]完全由奇数(十进制)数字组成的属性。例如,36 + 63 = 99409 + 904 = 1313.我们将这些数字称为可逆的;所以36,63,409和904是可逆的。 n或反向n中不允许前导零。
Some positive integers n have the property that the sum \[ n + reverse(n) ] consists entirely of odd (decimal) digits. For instance, 36 + 63 = 99 and 409 + 904 = 1313. We will call such numbers reversible; so 36, 63, 409, and 904 are reversible. Leading zeroes are not allowed in either n or reverse(n).
有一千个可逆数字低于一千。
There are 120 reversible numbers below one-thousand.
有多少可逆数字低于十亿(109
How many reversible numbers are there below one-billion (109)?
# --hints--
`euler145()`应该返回608720
`euler145()` should return 608720.
```js
assert.strictEqual(euler145(), 608720);

View File

@ -1,20 +1,20 @@
---
id: 5900f3fe1000cf542c50ff11
title: 问题146调查素数模式
title: 'Problem 146: Investigating a Prime Pattern'
challengeType: 5
videoUrl: ''
forumTopicId: 301775
dashedName: problem-146-investigating-a-prime-pattern
---
# --description--
整数n2 + 1n2 + 3n2 + 7n2 + 9n2 + 13和n2 + 27为其连续质数的最小正整数n为10。所有小于100万的整数n的总和 是1242490
The smallest positive integer n for which the numbers n2+1, n2+3, n2+7, n2+9, n2+13, and n2+27 are consecutive primes is 10. The sum of all such integers n below one-million is 1242490.
所有小于1.5亿的整数n的总和是多少
What is the sum of all such integers n below 150 million?
# --hints--
`euler146()`应该返回676333270
`euler146()` should return 676333270.
```js
assert.strictEqual(euler146(), 676333270);

View File

@ -1,24 +1,24 @@
---
id: 5900f3ff1000cf542c50ff12
title: 问题147交叉阴影网格中的矩形
title: 'Problem 147: Rectangles in cross-hatched grids'
challengeType: 5
videoUrl: ''
forumTopicId: 301776
dashedName: problem-147-rectangles-in-cross-hatched-grids
---
# --description--
在3x2交叉阴影网格中如图所示总共37个不同的矩形可以位于该网格内。
In a 3x2 cross-hatched grid, a total of 37 different rectangles could be situated within that grid as indicated in the sketch.
有5个小于3x2的网格垂直和水平尺寸很重要1x1,2x1,3x1,1x2和2x2。如果它们中的每一个都是交叉阴影线则可以在这些较小的网格中放置以下数量的不同矩形1x11 2x14 3x18 1x24 2x218
There are 5 grids smaller than 3x2, vertical and horizontal dimensions being important, i.e. 1x1, 2x1, 3x1, 1x2 and 2x2. If each of them is cross-hatched, the following number of different rectangles could be situated within those smaller grids: 1x1: 1 2x1: 4 3x1: 8 1x2: 4 2x2: 18
将它们添加到3x2网格中的37个总共72个不同的矩形可以位于3x2和更小的网格中。
Adding those to the 37 of the 3x2 grid, a total of 72 different rectangles could be situated within 3x2 and smaller grids.
在47x43和更小的网格中可以放置多少个不同的矩形
How many different rectangles could be situated within 47x43 and smaller grids?
# --hints--
`euler147()`应该返回846910284
`euler147()` should return 846910284.
```js
assert.strictEqual(euler147(), 846910284);

View File

@ -1,74 +1,34 @@
---
id: 5900f4021000cf542c50ff14
title: 问题148探索帕斯卡的三角形
title: 'Problem 148: Exploring Pascal''s triangle'
challengeType: 5
videoUrl: ''
forumTopicId: 301777
dashedName: problem-148-exploring-pascals-triangle
---
# --description--
我们可以很容易地验证Pascal三角形的前七行中的所有条目都不能被7整除
We can easily verify that none of the entries in the first seven rows of Pascal's triangle are divisible by 7:
1
<pre>
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
</pre>
1
However, if we check the first one hundred rows, we will find that only 2361 of the 5050 entries are not divisible by 7.
1
# --instructions--
1
2
1
1
3
3
1
1
4
6
4
1
1
10
10
1 1
6
15
20
15
6
1然而如果我们检查前100行我们会发现5050个条目中只有2361个不能被7整除。
找到Pascal三角形的前十亿109行中不能被7整除的条目数。
Find the number of entries which are not divisible by 7 in the first one billion (10<sup>9</sup>) rows of Pascal's triangle.
# --hints--
`euler148()`应该返回2129970655314432
`euler148()` should return 2129970655314432.
```js
assert.strictEqual(euler148(), 2129970655314432);

View File

@ -1,32 +1,32 @@
---
id: 5900f4021000cf542c50ff13
title: 问题149搜索最大和子序列
title: 'Problem 149: Searching for a maximum-sum subsequence'
challengeType: 5
videoUrl: ''
forumTopicId: 301778
dashedName: problem-149-searching-for-a-maximum-sum-subsequence
---
# --description--
查看下表可以很容易地验证任意方向水平垂直对角或反对角上相邻数字的最大和为16= 8 + 7 + 1)。
Looking at the table below, it is easy to verify that the maximum possible sum of adjacent numbers in any direction (horizontal, vertical, diagonal or anti-diagonal) is 16 (= 8 + 7 + 1).
253296513273184 8
现在,让我们重复搜索,但范围更大:
Now, let us repeat the search, but on a much larger scale:
首先,使用称为“滞后斐波那契生成器”的特定形式生成四百万个伪随机数:
First, generate four million pseudo-random numbers using a specific form of what is known as a "Lagged Fibonacci Generator":
对于1≤k≤55sk = \[100003 200003k + 300007k3](模1000000 500000。 对于56≤k≤4000000sk = \[sk-24 + sk-55 + 1000000](模1000000 500000
For 1 ≤ k ≤ 55, sk = \[100003 200003k + 300007k3] (modulo 1000000) 500000. For 56 ≤ k ≤ 4000000, sk = \[sk24 + sk55 + 1000000] (modulo 1000000) 500000.
因此,s10 = -393027s100 = 86613
Thus, s10 = 393027 and s100 = 86613.
然后将s的项排列在2000×2000表中使用前2000个数字顺序填充第一行使用后2000个数字填充第二行依此类推。
The terms of s are then arranged in a 2000×2000 table, using the first 2000 numbers to fill the first row (sequentially), the next 2000 numbers to fill the second row, and so on.
最后,在任何方向(水平,垂直,对角线或反对角线)上找到(任意数量)相邻项的最大和。
Finally, find the greatest sum of (any number of) adjacent entries in any direction (horizontal, vertical, diagonal or anti-diagonal).
# --hints--
`euler149()`应该返回52852124
`euler149()` should return 52852124.
```js
assert.strictEqual(euler149(), 52852124);

View File

@ -1,32 +1,40 @@
---
id: 5900f37b1000cf542c50fe8e
title: 问题15格子路径
title: 'Problem 15: Lattice paths'
challengeType: 5
videoUrl: ''
forumTopicId: 301780
dashedName: problem-15-lattice-paths
---
# --description--
从2×2网格的左上角开始只能向右和向下移动右下角有6条路线。 ![6 2乘2网格的图表显示了右下角的所有路线](https://cdn-media-1.freecodecamp.org/imgr/1Atixoj.gif)
Starting in the top left corner of a 2×2 grid, and only being able to move to the right and down, there are exactly 6 routes to the bottom right corner.
通过给定的`gridSize`有多少这样的路由?
<img class="img-responsive center-block" alt="a diagram of 6 2 by 2 grids showing all the routes to the bottom right corner" src="https://cdn-media-1.freecodecamp.org/project-euler/1Atixoj.gif" style="background-color: white; padding: 10px;" />
How many such routes are there through a given `gridSize`?
# --hints--
`latticePaths(4)`应该返回70。
`latticePaths(4)` should return a number.
```js
assert(typeof latticePaths(4) === 'number');
```
`latticePaths(4)` should return 70.
```js
assert.strictEqual(latticePaths(4), 70);
```
`latticePaths(9)`应该返回48620
`latticePaths(9)` should return 48620.
```js
assert.strictEqual(latticePaths(9), 48620);
```
`latticePaths(20)`应该返回137846528820
`latticePaths(20)` should return 137846528820.
```js
assert.strictEqual(latticePaths(20), 137846528820);

View File

@ -1,34 +1,37 @@
---
id: 5900f4031000cf542c50ff15
title: 问题150在三角形阵列中搜索具有最小和的子三角形
title: >-
Problem 150: Searching a triangular array for a sub-triangle having minimum-sum
challengeType: 5
videoUrl: ''
forumTopicId: 301781
dashedName: problem-150-searching-a-triangular-array-for-a-sub-triangle-having-minimum-sum
---
# --description--
在正整数和负整数的三角形阵列中,我们希望找到一个子三角形,使得它包含的数字之和尽可能小。在下面的示例中,可以很容易地验证标记的三角形满足具有-42的总和的条件。
In a triangular array of positive and negative integers, we wish to find a sub-triangle such that the sum of the numbers it contains is the smallest possible.
我们希望制作一个包含一千行的三角形数组因此我们使用一种随机数生成器称为线性同余生成器生成5009个伪随机数sk范围为±219如下所示t= 0
In the example below, it can be easily verified that the marked triangle satisfies this condition having a sum of 42.
对于k = 1到k = 500500
We wish to make such a triangular array with one thousand rows, so we generate 500500 pseudo-random numbers sk in the range ±219, using a type of random number generator (known as a Linear Congruential Generator) as follows: t := 0
t=615949 \* t + 797807modulo 220 sk= t-219因此s1 = 273519s2 = -153582s3 = 450905等我们的三角形数组然后使用伪随机数形成:
for k = 1 up to k = 500500:
t := (615949\*t + 797807) modulo 220 sk := t219 Thus: s1 = 273519, s2 = 153582, s3 = 450905 etc Our triangular array is then formed using the pseudo-random numbers thus:
s1 s2 s3 s4 s5 s6
s7 s8 s9 s10 ......
s7 s8 s9 s10 ...
子三角形可以从数组的任何元素开始,并在我们喜欢的范围内向下延伸(从下一行直接接收它下面的两个元素,之后直接从该行下面的三个元素,依此类推)。
Sub-triangles can start at any element of the array and extend down as far as we like (taking-in the two elements directly below it from the next row, the three elements directly below from the row after that, and so on).
“三角形的总和”定义为它包含的所有元素的总和。
The "sum of a sub-triangle" is defined as the sum of all the elements it contains.
找到可能的最小子三角形和。
Find the smallest possible sub-triangle sum.
# --hints--
`euler150()`应返回-271248680
`euler150()` should return -271248680.
```js
assert.strictEqual(euler150(), -271248680);

View File

@ -1,20 +1,26 @@
---
id: 5900f4031000cf542c50ff16
title: 问题151标准尺寸的纸张期望值问题
title: 'Problem 151: Paper sheets of standard sizes: an expected-value problem'
challengeType: 5
videoUrl: ''
forumTopicId: 301782
dashedName: problem-151-paper-sheets-of-standard-sizes-an-expected-value-problem
---
# --description--
印刷车间每周运行16批工作每批需要一张A5尺寸的特殊颜色纸。每个星期一早上工头打开一个新信封里面装着一张大小为A1的特殊纸张。他继续把它切成两半从而得到两张A2尺寸的纸。然后他将其中一个切成两半得到两张A3尺寸依此类推直到他获得了本周第一批所需的A5尺寸纸张。所有未使用的纸张都放回信封中。
A printing shop runs 16 batches (jobs) every week and each batch requires a sheet of special colour-proofing paper of size A5.
在每个后续批次开始时他随机从信封中取出一张纸。如果它的大小为A5他会使用它。如果它更大他会重复“切成两半”的程序直到他有他需要的东西任何剩余的床单总是放回信封里。排除本周的第一批和最后一批找到工头在信封中找到一张纸的预期次数每周。使用格式x.xxxxxx将您的答案四舍五入到小数点后六位。
Every Monday morning, the foreman opens a new envelope, containing a large sheet of the special paper with size A1.
He proceeds to cut it in half, thus getting two sheets of size A2. Then he cuts one of them in half to get two sheets of size A3 and so on until he obtains the A5-size sheet needed for the first batch of the week.
All the unused sheets are placed back in the envelope.
At the beginning of each subsequent batch, he takes from the envelope one sheet of paper at random. If it is of size A5, he uses it. If it is larger, he repeats the 'cut-in-half' procedure until he has what he needs and any remaining sheets are always placed back in the envelope. Excluding the first and last batch of the week, find the expected number of times (during each week) that the foreman finds a single sheet of paper in the envelope. Give your answer rounded to six decimal places using the format x.xxxxxx .
# --hints--
<code>euler151()&lt;/ code>应该返回0.464399
`euler151()` should return 0.464399.
```js
assert.strictEqual(euler151(), 0.464399);

View File

@ -1,22 +1,22 @@
---
id: 5900f4041000cf542c50ff17
title: 问题152将一半写为倒数平方和
title: 'Problem 152: Writing one half as a sum of inverse squares'
challengeType: 5
videoUrl: ''
forumTopicId: 301783
dashedName: problem-152-writing-one-half-as-a-sum-of-inverse-squares
---
# --description--
有几种方法可以使用不同的整数将数字1/2写成反平方和。
There are several ways to write the number 1/2 as a sum of inverse squares using distinct integers.
例如,可以使用数字{2,3,4,5,7,12,15,20,28,35}
For instance, the numbers {2,3,4,5,7,12,15,20,28,35} can be used:
实际上仅使用2到45之间的整数包括2和45完全可以通过三种方式来实现其余两种方式是{2,3,4,6,7,9,10,20,28,35,36,45 }和{2,3,4,6,7,9,12,15,28,30,35,36,45}。 使用2到80之间含2和80的不同整数有多少种方法可以将数字1/2写成反平方和
In fact, only using integers between 2 and 45 inclusive, there are exactly three ways to do it, the remaining two being: {2,3,4,6,7,9,10,20,28,35,36,45} and {2,3,4,6,7,9,12,15,28,30,35,36,45}. How many ways are there to write the number 1/2 as a sum of inverse squares using distinct integers between 2 and 80 inclusive?
# --hints--
<code>euler152()&lt;/ code>应该返回301
`euler152()` should return 301.
```js
assert.strictEqual(euler152(), 301);

View File

@ -1,50 +1,50 @@
---
id: 5900f4051000cf542c50ff18
title: 问题153调查高斯整数
title: 'Problem 153: Investigating Gaussian Integers'
challengeType: 5
videoUrl: ''
forumTopicId: 301784
dashedName: problem-153-investigating-gaussian-integers
---
# --description--
众所周知方程x2 = -1没有实数x的解。
As we all know the equation x2=-1 has no solutions for real x.
然而如果我们引入虚数i则该等式具有两个解x = i且x = -i
If we however introduce the imaginary number i this equation has two solutions: x=i and x=-i.
如果我们更进一步等式x-32 = -4有两个复数解x = 3 + 2i和x = 3-2i x = 3 + 2i和x = 3-2i被称为彼此的复共轭。
If we go a step further the equation (x-3)2=-4 has two complex solutions: x=3+2i and x=3-2i. x=3+2i and x=3-2i are called each others' complex conjugate.
形式a + bi的数字称为复数。
Numbers of the form a+bi are called complex numbers.
通常,+ bi和a-bi是彼此的复共轭。高斯整数是复数a + bi使得a和b都是整数。
In general a+bi and abi are each other's complex conjugate. A Gaussian Integer is a complex number a+bi such that both a and b are integers.
常规整数也是高斯整数b = 0
The regular integers are also Gaussian integers (with b=0).
为了将它们与b≠0的高斯整数区分开来我们称这样的整数为“有理整数”。
To distinguish them from Gaussian integers with b ≠ 0 we call such integers "rational integers."
如果结果也是高斯整数则高斯整数称为有理整数n的除数。
A Gaussian integer is called a divisor of a rational integer n if the result is also a Gaussian integer.
例如如果我们将5除以1 + 2i我们可以通过以下方式简化
If for example we divide 5 by 1+2i we can simplify in the following manner:
通过1 + 2i的复共轭乘以分子和分母1-2i
Multiply numerator and denominator by the complex conjugate of 1+2i: 12i.
结果是。
The result is .
所以1 + 2i是5的除数。
So 1+2i is a divisor of 5.
请注意1 + i不是5的除数因为。
Note that 1+i is not a divisor of 5 because .
还要注意如果高斯整数a + bi是有理整数n的除数则其复共轭a-bi也是n的除数。实际上5有六个除数使得实部是正的{1,1 + 2i1 - 2i2 + i2 - i5}
Note also that if the Gaussian Integer (a+bi) is a divisor of a rational integer n, then its complex conjugate (abi) is also a divisor of n. In fact, 5 has six divisors such that the real part is positive: {1, 1 + 2i, 1 2i, 2 + i, 2 i, 5}.
以下是前五个正整数的所有除数的表:
The following is a table of all of the divisors for the first five positive rational integers:
n高斯整数除数具有正实数partSum sn
n Gaussian integer divisors with positive real partSum s(n) of these
divisors111 21,1 + i1-i25 31,34 41,1 + i1-i2,2 + 2i2-2i413 51,1 + 2i1-2i2 + i 2-i512对于具有正实部的除数那么我们有。对于1≤n≤105Σsn= 17924657155。什么是Σsn1≤n≤108
divisors111 21, 1+i, 1-i, 25 31, 34 41, 1+i, 1-i, 2, 2+2i, 2-2i,413 51, 1+2i, 1-2i, 2+i, 2-i, 512 For divisors with positive real parts, then, we have: . For 1 ≤ n ≤ 105, ∑ s(n)=17924657155. What is ∑ s(n) for 1 ≤ n ≤ 108?
# --hints--
`euler153()`应该返回17971254122360636
`euler153()` should return 17971254122360636.
```js
assert.strictEqual(euler153(), 17971254122360636);

View File

@ -1,20 +1,20 @@
---
id: 5900f4071000cf542c50ff19
title: 问题154探索帕斯卡的金字塔
title: 'Problem 154: Exploring Pascal''s pyramid'
challengeType: 5
videoUrl: ''
forumTopicId: 301785
dashedName: problem-154-exploring-pascals-pyramid
---
# --description--
使用球形球构造三角形金字塔,使得每个球恰好位于下一个较低水平的三个球上。
A triangular pyramid is constructed using spherical balls so that each ball rests on exactly three balls of the next lower level.
然后我们计算从顶点到每个位置的路径数量路径从顶点开始并向下前进到当前位置正下方的三个球体中的任何一个。因此到达某个位置的路径数是紧接在其上方的数字的总和取决于位置在其上方最多有三个数字。结果是Pascal的金字塔每个级别n的数字是三项式展开x + y + zn的系数。 x + y + z200000的扩展中有多少个系数是1012的倍数
Then, we calculate the number of paths leading from the apex to each position: A path starts at the apex and progresses downwards to any of the three spheres directly below the current position. Consequently, the number of paths to reach a certain position is the sum of the numbers immediately above it (depending on the position, there are up to three numbers above it). The result is Pascal's pyramid and the numbers at each level n are the coefficients of the trinomial expansion (x + y + z)n. How many coefficients in the expansion of (x + y + z)200000 are multiples of 1012?
# --hints--
`euler154()`应该返回479742450
`euler154()` should return 479742450.
```js
assert.strictEqual(euler154(), 479742450);

View File

@ -1,24 +1,24 @@
---
id: 5900f4081000cf542c50ff1a
title: 问题155计算电容器电路
title: 'Problem 155: Counting Capacitor Circuits'
challengeType: 5
videoUrl: ''
forumTopicId: 301786
dashedName: problem-155-counting-capacitor-circuits
---
# --description--
电路仅使用相同值C的相同电容器。
An electric circuit uses exclusively identical capacitors of the same value C.
电容器可以串联或并联连接以形成子单元子单元然后可以与其他电容器或其他子单元串联或并联连接以形成更大的子单元以此类推直到最终电路。使用这个简单的程序和多达n个相同的电容器我们可以制造具有一系列不同总电容的电路。例如使用最多n = 3个电容器每个电容器为60 F我们可以获得以下7个不同的总电容值
The capacitors can be connected in series or in parallel to form sub-units, which can then be connected in series or in parallel with other capacitors or other sub-units to form larger sub-units, and so on up to a final circuit. Using this simple procedure and up to n identical capacitors, we can make circuits having a range of different total capacitances. For example, using up to n=3 capacitors of 60 F each, we can obtain the following 7 distinct total capacitance values:
如果我们用Dn表示当使用多达n个等值电容器时我们可以获得的不同总电容值的数量和上述简单程序我们得到D1= 1D2= 3 D3= 7 ...求D18。提醒当并联电容器C1C2等时总电容为CT = C1 + C2 + ......
If we denote by D(n) the number of distinct total capacitance values we can obtain when using up to n equal-valued capacitors and the simple procedure described above, we have: D(1)=1, D(2)=3, D(3)=7 ... Find D(18). Reminder : When connecting capacitors C1, C2 etc in parallel, the total capacitance is CT = C1 + C2 +...,
而当它们串联连接时,总电容由下式给出:
whereas when connecting them in series, the overall capacitance is given by:
# --hints--
`euler155()`应返回3857447
`euler155()` should return 3857447.
```js
assert.strictEqual(euler155(), 3857447);

View File

@ -1,32 +1,32 @@
---
id: 5900f4091000cf542c50ff1b
title: 问题156计数数字
title: 'Problem 156: Counting Digits'
challengeType: 5
videoUrl: ''
forumTopicId: 301787
dashedName: problem-156-counting-digits
---
# --description--
从零开始自然数字在基数10中写下如下所示
Starting from zero the natural numbers are written down in base 10 like this:
0 1 2 3 4 5 6 7 8 9 10 11 12 ....
0 1 2 3 4 5 6 7 8 9 10 11 12....
考虑数字d = 1。在我们写下每个数字n后我们将更新已发生的数字并将此数字称为fn1。那么fn1的第一个值如下
Consider the digit d=1. After we write down each number n, we will update the number of ones that have occurred and call this number f(n,1). The first values for f(n,1), then, are as follows:
nfn100 11 21 31 41 51 61 71 81 91 102 114 125
nf(n,1) 00 11 21 31 41 51 61 71 81 91 102 114 125
请注意fn1永远不等于3。
Note that f(n,1) never equals 3.
因此等式fn1= n的前两个解是n = 0并且n = 1。下一个解决方案是n = 199981。以相同的方式函数fnd给出在写入数字n之后已经写下的总位数d。
So the first two solutions of the equation f(n,1)=n are n=0 and n=1. The next solution is n=199981. In the same manner the function f(n,d) gives the total number of digits d that have been written down after the number n has been written.
实际上对于每个数字d≠0,0是方程fnd= n的第一个解。设sd是fnd= n的所有解的总和。
In fact, for every digit d ≠ 0, 0 is the first solution of the equation f(n,d)=n. Let s(d) be the sum of all the solutions for which f(n,d)=n.
你得到s1= 22786974071。找到Σsd的1≤d≤9。注意如果对于某些n对于多于一个d的值fnd= n对于d的每个值再次计算n的这个值。 FNd= N。
You are given that s(1)=22786974071. Find ∑ s(d) for 1 ≤ d ≤ 9. Note: if, for some n, f(n,d)=n for more than one value of d this value of n is counted again for every value of d for which f(n,d)=n.
# --hints--
`euler156`应该返回21295121502550
`euler156()` should return 21295121502550.
```js
assert.strictEqual(euler156(), 21295121502550);

View File

@ -1,64 +1,62 @@
---
id: 5900f4091000cf542c50ff1c
title: 问题157解决丢番图方程
title: 'Problem 157: Solving the diophantine equation'
challengeType: 5
videoUrl: ''
forumTopicId: 301788
dashedName: problem-157-solving-the-diophantine-equation
---
# --description--
491/5000
Consider the diophantine equation 1/a+1/b= p/10n with a, b, p, n positive integers and a ≤ b.
考虑具有abpn个正整数且a≤b的双色子方程1 / a + 1 / b = p / 10n。
For n=1 this equation has 20 solutions that are listed below:
对于n = 1此等式有20个解决方案如下所示
1/1+1/1=20/10
1/1 + 1/1 = 20/10
1/1+1/2=15/10
1/1 + 1/2 = 15/10
1/1+1/5=12/10
1/1 + 1/5 = 12/10
1/1+1/10=11/10
1/1 + 1/10 = 11/10
1/2+1/2=10/10
1/2 + 1/2 = 10/10
1/2+1/5=7/10
1/2 + 1/5 = 7/10
1/2+1/10=6/10
1/2 + 1/10 = 6/10
1/3+1/6=5/10
1/3 + 1/6 = 5/10
1/3+1/15=4/10
1/3 + 1/15 = 4/10
1/4+1/4=5/10
1/4 + 1/4 = 5/10
1/4+1/20=3/10
1/4 + 1/20 = 3/10
1/5+1/5=4/10
1/5 + 1/5 = 4/10
1/5+1/10=3/10
1/5 + 1/10 = 3/10
1/6+1/30=2/10
1/6 + 1/30 = 2/10
1/10+1/10=2/10
1/10 + 1/10 = 2/10
1/11+1/110=1/10
1/11 + 1/110 = 1/10
1/12+1/60=1/10
1/12 + 1/60 = 1/10
1/14+1/35=1/10
1/14 + 1/35 = 1/10
1/15+1/30=1/10
1/15 + 1/30 = 1/10
1/20+1/20=1/10
1/20 + 1/20 = 1/10
对于1≤n≤9该方程有多少个解
How many solutions has this equation for 1 ≤ n ≤ 9?
# --hints--
`euler157()`应返回53490
`euler157()` should return 53490.
```js
assert.strictEqual(euler157(), 53490);

View File

@ -1,19 +1,34 @@
---
id: 5900f40a1000cf542c50ff1d
title: 问题158探索在其邻居之后只有一个字符按字典顺序出现的字符串
title: >-
Problem 158: Exploring strings for which only one character comes lexicographically after its neighbour to the left
challengeType: 5
videoUrl: ''
forumTopicId: 301789
dashedName: >-
problem-158-exploring-strings-for-which-only-one-character-comes-lexicographically-after-its-neighbour-to-the-left
---
# --description--
从字母表的26个字母中取三个不同的字母可以形成长度为3的字符串。例如'abc''hat'和'zyx'。当我们研究这三个例子时,我们看到对于'abc',两个字符在其左边的邻居之后以字典方式出现。对于“帽子”,只有一个字符在其左边的邻居之后按字典顺序排列。对于'zyx'在左边的邻居之后字典上有零个字符。总共有10400个长度为3的字符串其中一个字符在其左边的邻居之后按字典顺序排列。我们现在考虑字母表中n≤26个不同字符的字符串。对于每个npn是长度为n的字符串的数量正好一个字符在其左边的邻居之后按字典顺序排列。 pn的最大值是多少
Taking three different letters from the 26 letters of the alphabet, character strings of length three can be formed.
Examples are 'abc', 'hat' and 'zyx'.
When we study these three examples we see that for 'abc' two characters come lexicographically after its neighbour to the left.
For 'hat' there is exactly one character that comes lexicographically after its neighbour to the left. For 'zyx' there are zero characters that come lexicographically after its neighbour to the left.
In all there are 10400 strings of length 3 for which exactly one character comes lexicographically after its neighbour to the left.
We now consider strings of n ≤ 26 different characters from the alphabet.
For every n, p(n) is the number of strings of length n for which exactly one character comes lexicographically after its neighbour to the left.
What is the maximum value of p(n)?
# --hints--
`euler158()`应该返回409511334375
`euler158()` should return 409511334375.
```js
assert.strictEqual(euler158(), 409511334375);

View File

@ -1,22 +1,24 @@
---
id: 5900f40c1000cf542c50ff1e
title: 问题159因子的数字根和
title: 'Problem 159: Digital root sums of factorisations'
challengeType: 5
videoUrl: ''
forumTopicId: 301790
dashedName: problem-159-digital-root-sums-of-factorisations
---
# --description--
复合数可以通过许多不同的方式考虑。例如不包括乘以一24可以用7种不同的方式考虑
A composite number can be factored many different ways.
For instance, not including multiplication by one, 24 can be factored in 7 distinct ways:
24 = 2x2x2x3 24 = 2x3x4 24 = 2x2x6 24 = 4x6 24 = 3x8 24 = 2x12 24 = 24
回想一下基数为10的数字的数字根是通过将该数字的数字加在一起而得到的并重复该过程直到到达的数字小于10.因此467的数字根是8。应将数字根和DRS称为我们数字的各个因子的数字根的总和。下图显示了所有DRS值24.因子分解数字根Sum2x2x2x3 92x3x4 92x2x6 104x6 103x8 112x12 524 6 24的最大数字根和为11.函数mdrsn给出n的最大数字根和。所以mdrs24= 11。找到Σmdrsn1 &lt;n &lt;1,000,000
Recall that the digital root of a number, in base 10, is found by adding together the digits of that number, and repeating that process until a number is arrived at that is less than 10. Thus the digital root of 467 is 8. We shall call a Digital Root Sum (DRS) the sum of the digital roots of the individual factors of our number. The chart below demonstrates all of the DRS values for 24. FactorisationDigital Root Sum2x2x2x3 92x3x4 92x2x6 104x6 103x8 112x12 524 6The maximum Digital Root Sum of 24 is 11. The function mdrs(n) gives the maximum Digital Root Sum of n. So mdrs(24)=11. Find ∑mdrs(n) for 1 &lt; n &lt; 1,000,000.
# --hints--
`euler159()`应返回14489159
`euler159()` should return 14489159.
```js
assert.strictEqual(euler159(), 14489159);

View File

@ -1,30 +1,38 @@
---
id: 5900f37d1000cf542c50fe8f
title: 问题16电源数字总和
title: 'Problem 16: Power digit sum'
challengeType: 5
videoUrl: ''
forumTopicId: 301791
dashedName: problem-16-power-digit-sum
---
# --description--
2 <sup>15<!-- sup-->= 32768其位数之和为3 + 2 + 7 + 6 + 8 = 26。 2 <sup><code>指数<!-- code--><!-- sup-->的数字总和是多少?</code></sup></sup>
2<sup>15</sup> = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26.
What is the sum of the digits of the number 2<sup><code>exponent</code></sup>?
# --hints--
`powerDigitSum(15)`应该返回26。
`powerDigitSum(15)` should return a number.
```js
assert(typeof powerDigitSum(15) === 'number');
```
`powerDigitSum(15)` should return 26.
```js
assert.strictEqual(powerDigitSum(15), 26);
```
`powerDigitSum(128)`应该返回166
`powerDigitSum(128)` should return 166.
```js
assert.strictEqual(powerDigitSum(128), 166);
```
`powerDigitSum(1000)`应返回1366
`powerDigitSum(1000)` should return 1366.
```js
assert.strictEqual(powerDigitSum(1000), 1366);

View File

@ -1,18 +1,28 @@
---
id: 5900f40d1000cf542c50ff1f
title: 问题160因子尾随数字
title: 'Problem 160: Factorial trailing digits'
challengeType: 5
videoUrl: ''
forumTopicId: 301794
dashedName: problem-160-factorial-trailing-digits
---
# --description--
对于任何N让fN为N中尾随零之前的最后五位数。例如9 = 362880所以f9= 36288 10 = 3628800所以f10= 36288 20 = 2432902008176640000所以f20= 17664查找f1,000,000,000,000
For any N, let f(N) be the last five digits before the trailing zeroes in N!.
For example,
9! = 362880 so f(9)=36288
10! = 3628800 so f(10)=36288
20! = 2432902008176640000 so f(20)=17664
Find f(1,000,000,000,000)
# --hints--
`euler160()`应返回16576
`euler160()` should return 16576.
```js
assert.strictEqual(euler160(), 16576);

View File

@ -1,24 +1,26 @@
---
id: 5900f40d1000cf542c50ff20
title: 问题161Triominoes
title: 'Problem 161: Triominoes'
challengeType: 5
videoUrl: ''
forumTopicId: 301795
dashedName: problem-161-triominoes
---
# --description--
三角形是由三个通过边缘连接的正方形组成的形状。有两种基本形式:
A triomino is a shape consisting of three squares joined via the edges.
如果考虑所有可能的方向,则有六个:
There are two basic forms:
任何n×m网格的nxm可以被3整除可以用三角形平铺。如果我们考虑通过反射或从另一个平铺旋转获得的倾斜不同有41种方式可以使用三角形平铺2乘9的网格
If all possible orientations are taken into account there are six:
有多少种方式可以通过三角形以这种方式平铺9乘12的网格
Any n by m grid for which nxm is divisible by 3 can be tiled with triominoes. If we consider tilings that can be obtained by reflection or rotation from another tiling as different there are 41 ways a 2 by 9 grid can be tiled with triominoes:
In how many ways can a 9 by 12 grid be tiled in this way by triominoes?
# --hints--
`euler161()`应该返回20574308184277972
`euler161()` should return 20574308184277972.
```js
assert.strictEqual(euler161(), 20574308184277972);

View File

@ -1,18 +1,32 @@
---
id: 5900f40e1000cf542c50ff21
title: 问题162十六进制数
title: 'Problem 162: Hexadecimal numbers'
challengeType: 5
videoUrl: ''
forumTopicId: 301796
dashedName: problem-162-hexadecimal-numbers
---
# --description--
在十六进制数中系统使用16个不同的数字表示数字0,1,2,3,4,5,6,7,8,9ABCDEF写入时的十六进制数AF在十进制数系统中等于10x16 + 15 = 175。在3位十六进制数10A1A0A10和A01中数字0,1和A都存在。就像用十进制数写的数字一样我们写十六进制数而不带前导零。包含最多十六个十六进制数字的十六进制数是多少所有数字0,1和A至少出现一次将答案作为十六进制数字给出。 ABCDE和F大写没有任何前导或尾随代码将数字标记为十六进制且没有前导零例如1A3F而不是1a3f而不是0x1a3f而不是$ 1A3F而不是1A3F而不是0000001A3F
In the hexadecimal number system numbers are represented using 16 different digits:
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
The hexadecimal number AF when written in the decimal number system equals 10x16+15=175.
In the 3-digit hexadecimal numbers 10A, 1A0, A10, and A01 the digits 0,1 and A are all present.
Like numbers written in base ten we write hexadecimal numbers without leading zeroes.
How many hexadecimal numbers containing at most sixteen hexadecimal digits exist with all of the digits 0,1, and A present at least once?
Give your answer as a hexadecimal number.
(A,B,C,D,E and F in upper case, without any leading or trailing code that marks the number as hexadecimal and without leading zeroes , e.g. 1A3F and not: 1a3f and not 0x1a3f and not $1A3F and not #1A3F and not 0000001A3F)
# --hints--
`euler162()` 应该返回3D58725572C62302
`euler162()` should return 3D58725572C62302.
```js
assert.strictEqual(euler162(), '3D58725572C62302');

View File

@ -1,20 +1,20 @@
---
id: 5900f40f1000cf542c50ff22
title: 问题163阴影线三角形
title: 'Problem 163: Cross-hatched triangles'
challengeType: 5
videoUrl: ''
forumTopicId: 301797
dashedName: problem-163-cross-hatched-triangles
---
# --description--
考虑等边三角形其中从每个顶点到相对侧的中间绘制直线例如在下面草图中的1号三角形中。
Consider an equilateral triangle in which straight lines are drawn from each vertex to the middle of the opposite side, such as in the size 1 triangle in the sketch below.
现在可以在该三角形中观察到具有不同形状或大小或方向或位置的十六个三角形。使用大小为1的三角形作为构建块可以形成更大的三角形例如上面草图中的大小为2的三角形。现在可以在该尺寸2三角形中观察到具有不同形状或尺寸或方向或位置的一百四十个三角形。可以观察到2号三角形包含4个1号三角形构造块。大小为3的三角形将包含9个大小为1的三角形构建块因此大小为n的三角形将包含n2个大小为1的三角形构建块。如果我们将Tn表示为大小为n的三角形中存在的三角形的数量则T1= 16 T2= 104 Find T36)。
Sixteen triangles of either different shape or size or orientation or location can now be observed in that triangle. Using size 1 triangles as building blocks, larger triangles can be formed, such as the size 2 triangle in the above sketch. One-hundred and four triangles of either different shape or size or orientation or location can now be observed in that size 2 triangle. It can be observed that the size 2 triangle contains 4 size 1 triangle building blocks. A size 3 triangle would contain 9 size 1 triangle building blocks and a size n triangle would thus contain n2 size 1 triangle building blocks. If we denote T(n) as the number of triangles present in a triangle of size n, then T(1) = 16 T(2) = 104 Find T(36).
# --hints--
`euler163()`应返回343047
`euler163()` should return 343047.
```js
assert.strictEqual(euler163(), 343047);

View File

@ -1,19 +1,20 @@
---
id: 5900f4111000cf542c50ff23
title: 问题164没有三个连续数字的总和大于给定值的数字
title: >-
Problem 164: Numbers for which no three consecutive digits have a sum greater than a given value
challengeType: 5
videoUrl: ''
forumTopicId: 301798
dashedName: >-
problem-164-numbers-for-which-no-three-consecutive-digits-have-a-sum-greater-than-a-given-value
---
# --description--
存在多少20个数字n没有任何前导零使得n的三个连续数字的总和不大于9
How many 20 digit numbers n (without any leading zero) exist such that no three consecutive digits of n have a sum greater than 9?
# --hints--
`euler164()`应该返回378158756814587
`euler164()` should return 378158756814587.
```js
assert.strictEqual(euler164(), 378158756814587);

View File

@ -1,20 +1,26 @@
---
id: 5900f4111000cf542c50ff24
title: 问题165交叉口
title: 'Problem 165: Intersections'
challengeType: 5
videoUrl: ''
forumTopicId: 301799
dashedName: problem-165-intersections
---
# --description--
段由其两个端点唯一定义。通过考虑平面几何中的两个线段存在三种可能性段具有零点一个点或无限多个共同点。此外当两个段恰好具有一个共同点时可能是该公共点是任一段或两者的端点的情况。如果两个段的公共点不是任一段的端点则它是两个段的内点。如果T是L1和L2的唯一公共点则我们将两个段L1和L2的公共点T称为L1和L2的真实交点并且T是两个段的内点。
A segment is uniquely defined by its two endpoints. By considering two line segments in plane geometry there are three possibilities:
考虑三个段L1L2和L3L127,4412,32L246,5317,62L346,7022,40可以证实线段L2和L3具有真实的交叉点。我们注意到作为L3的终点之一22,40位于L1上这不被认为是真正的交点。 L1和L2没有共同点。因此在三个线段中我们找到一个真正的交叉点。现在让我们对5000个线段进行相同的操作。为此我们使用所谓的“Blum Blum Shub”伪随机数生成器生成20000个数字。 s0 = 290797 sn + 1 = sn×snmodulo 50515093tn = snmodulo 500为了创建每个线段我们使用四个连续的数字tn。也就是说第一个线段由下式给出t1t2t3t4根据上述发生器计算的前四个数字应该是27,144,12和232.因此第一个线段是( 27,14412,232。在5000个线段中发现了多少个不同的真实交叉点
the segments have zero points, one point, or infinitely many points in common.
Moreover when two segments have exactly one point in common it might be the case that that common point is an endpoint of either one of the segments or of both. If a common point of two segments is not an endpoint of either of the segments it is an interior point of both segments.
We will call a common point T of two segments L1 and L2 a true intersection point of L1 and L2 if T is the only common point of L1 and L2 and T is an interior point of both segments.
Consider the three segments L1, L2, and L3: L1: (27, 44) to (12, 32) L2: (46, 53) to (17, 62) L3: (46, 70) to (22, 40) It can be verified that line segments L2 and L3 have a true intersection point. We note that as the one of the end points of L3: (22,40) lies on L1 this is not considered to be a true point of intersection. L1 and L2 have no common point. So among the three line segments, we find one true intersection point. Now let us do the same for 5000 line segments. To this end, we generate 20000 numbers using the so-called "Blum Blum Shub" pseudo-random number generator. s0 = 290797 sn+1 = sn×sn (modulo 50515093) tn = sn (modulo 500) To create each line segment, we use four consecutive numbers tn. That is, the first line segment is given by: (t1, t2) to (t3, t4) The first four numbers computed according to the above generator should be: 27, 144, 12 and 232. The first segment would thus be (27,144) to (12,232). How many distinct true intersection points are found among the 5000 line segments?
# --hints--
`euler165()`应该返回2868868
`euler165()` should return 2868868.
```js
assert.strictEqual(euler165(), 2868868);

View File

@ -1,26 +1,26 @@
---
id: 5900f4131000cf542c50ff25
title: 问题166克里斯十字架
title: 'Problem 166: Criss Cross'
challengeType: 5
videoUrl: ''
forumTopicId: 301800
dashedName: problem-166-criss-cross
---
# --description--
4x4网格填充数字d0≤d≤9。
A 4x4 grid is filled with digits d, 0 ≤ d ≤ 9.
可以看出,在网格中
It can be seen that in the grid
6 3 3 0 5 0 4 3 0 7 1 4 1 2 4 5
每行和每列的总和值为12.此外,每个对角线的总和也是12
the sum of each row and each column has the value 12. Moreover the sum of each diagonal is also 12.
在多少种方法中您可以使用数字d0≤d≤9填充4x4网格以便每行每列和两个对角线具有相同的总和
In how many ways can you fill a 4x4 grid with the digits d, 0 ≤ d ≤ 9 so that each row, each column, and both diagonals have the same sum?
# --hints--
`euler166()`应返回7130034
`euler166()` should return 7130034.
```js
assert.strictEqual(euler166(), 7130034);

View File

@ -1,18 +1,28 @@
---
id: 5900f4141000cf542c50ff26
title: 问题167研究Ulam序列
title: 'Problem 167: Investigating Ulam sequences'
challengeType: 5
videoUrl: ''
forumTopicId: 301801
dashedName: problem-167-investigating-ulam-sequences
---
# --description--
对于两个正整数a和bUlam序列Uab由Uab1 = aUab2 = b定义对于k> 2Uab k是大于Uabk-1的最小整数它可以用一种方式写成Uab的两个不同的先前成员的总和。例如序列U1,2以1,2,3 = 1 + 2,4 = 1 + 3,6 = 2 + 4,8 = 2 + 6,11 = 3 + 8开始; 5不属于它因为5 = 1 + 4 = 2 + 3有两个表示作为前两个成员的总和同样7 = 1 + 6 = 3 + 4.找到ΣU2,2n + 1k为2≤n≤10其中k = 1011。
For two positive integers a and b, the Ulam sequence U(a,b) is defined by U(a,b)1 = a, U(a,b)2 = b and for k > 2,
U(a,b)k is the smallest integer greater than U(a,b)(k-1) which can be written in exactly one way as the sum of two distinct previous members of U(a,b).
For example, the sequence U(1,2) begins with
1, 2, 3 = 1 + 2, 4 = 1 + 3, 6 = 2 + 4, 8 = 2 + 6, 11 = 3 + 8;
5 does not belong to it because 5 = 1 + 4 = 2 + 3 has two representations as the sum of two previous members, likewise 7 = 1 + 6 = 3 + 4.
Find ∑U(2,2n+1)k for 2 ≤ n ≤10, where k = 1011.
# --hints--
`euler167()`应该返回3916160068885
`euler167()` should return 3916160068885.
```js
assert.strictEqual(euler167(), 3916160068885);

View File

@ -1,18 +1,24 @@
---
id: 5900f4151000cf542c50ff27
title: 问题168数字轮换
title: 'Problem 168: Number Rotations'
challengeType: 5
videoUrl: ''
forumTopicId: 301802
dashedName: problem-168-number-rotations
---
# --description--
考虑数字142857.我们可以通过将最后一个数字7移动到它的前面来右旋这个数字给我们714285.可以验证714285 = 5×142857。这证明了142857的一个不寻常的属性它是右旋的除数。找到具有此属性的所有整数n10 &lt;n &lt;10100之和的最后5位数。
Consider the number 142857. We can right-rotate this number by moving the last digit (7) to the front of it, giving us 714285.
It can be verified that 714285=5×142857.
This demonstrates an unusual property of 142857: it is a divisor of its right-rotation.
Find the last 5 digits of the sum of all integers n, 10 &lt; n &lt; 10100, that have this property.
# --hints--
`euler168()`应返回`euler168()`
`euler168()` should return 59206.
```js
assert.strictEqual(euler168(), 59206);

View File

@ -1,19 +1,32 @@
---
id: 5900f4151000cf542c50ff28
title: 问题169探索数字可以表示为2的幂之和的不同方式的数量
title: >-
Problem 169: Exploring the number of different ways a number can be expressed as a sum of powers of 2
challengeType: 5
videoUrl: ''
forumTopicId: 301803
dashedName: >-
problem-169-exploring-the-number-of-different-ways-a-number-can-be-expressed-as-a-sum-of-powers-of-2
---
# --description--
将f0= 1和fn定义为不同方式的数量n可以表示为2的整数幂之和使用每个幂不超过两次。例如f10= 5因为有五种不同的表达方式101 + 1 + 8 1 + 1 + 4 + 41 + 1 + 2 + 2 + 4 2 + 4 + 4 2 + 8什么是f 1025
Define f(0)=1 and f(n) to be the number of different ways n can be expressed as a sum of integer powers of 2 using each power no more than twice.
For example, f(10)=5 since there are five different ways to express 10:
1 + 1 + 8
1 + 1 + 4 + 41 + 1 + 2 + 2 + 4
2 + 4 + 4
2 + 8
What is f(1025)?
# --hints--
`euler169()`应该返回178653872807
`euler169()` should return 178653872807.
```js
assert.strictEqual(euler169(), 178653872807);

View File

@ -1,30 +1,40 @@
---
id: 5900f37d1000cf542c50fe90
title: 问题17数字字母计数
title: 'Problem 17: Number letter counts'
challengeType: 5
videoUrl: ''
forumTopicId: 301804
dashedName: problem-17-number-letter-counts
---
# --description--
如果数字1到5用文字写出则总共使用3 + 3 + 5 + 4 + 4 = 19个字母。如果从1到包含`limit`所有数字都用文字写出,那么会使用多少个字母? **注意:** 不要计算空格或连字符。例如342三百四十二包含23个字母115一百一十五包含20个字母。在写出数字时使用“和”符合英国的用法。
If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.
If all the numbers from 1 to given `limit` inclusive were written out in words, how many letters would be used?
**Note:** Do not count spaces or hyphens. For example, 342 (three hundred and forty-two) contains 23 letters and 115 (one hundred and fifteen) contains 20 letters. The use of "and" when writing out numbers is in compliance with British usage.
# --hints--
`numberLetterCounts(5)`应返回19。
`numberLetterCounts(5)` should return a number.
```js
assert(typeof numberLetterCounts(5) === 'number');
```
`numberLetterCounts(5)` should return 19.
```js
assert.strictEqual(numberLetterCounts(5), 19);
```
`numberLetterCounts(150)`应该返回1903
`numberLetterCounts(150)` should return 1903.
```js
assert.strictEqual(numberLetterCounts(150), 1903);
```
`numberLetterCounts(1000)`应该返回21124
`numberLetterCounts(1000)` should return 21124.
```js
assert.strictEqual(numberLetterCounts(1000), 21124);

View File

@ -1,27 +1,28 @@
---
id: 5900f4161000cf542c50ff29
title: 问题170找到可以通过连接产品形成的最大的0到9个pandigital
title: >-
Problem 170: Find the largest 0 to 9 pandigital that can be formed by concatenating products
challengeType: 5
videoUrl: ''
forumTopicId: 301805
dashedName: >-
problem-170-find-the-largest-0-to-9-pandigital-that-can-be-formed-by-concatenating-products
---
# --description--
取数字6并乘以1273和9854
Take the number 6 and multiply it by each of 1273 and 9854:
6×1273 = 7638 6×9854 = 59124
6 × 1273 = 7638 6 × 9854 = 59124
通过连接这些产品我们得到1到9 pandigital 763859124.我们将763859124称为“6和1273,9854”的连接产品。另请注意输入数字612739854的串联也是1到9 pandigital
By concatenating these products we get the 1 to 9 pandigital 763859124. We will call 763859124 the "concatenated product of 6 and (1273,9854)". Notice too, that the concatenation of the input numbers, 612739854, is also 1 to 9 pandigital.
对于0到9个pandigital数字也可以这样做。
The same can be done for 0 to 9 pandigital numbers.
什么是具有两个或更多其他整数的整数的0到9 pandigital 10位连接产品这样输入数字的串联也是0到9 pandigital 10位数字?
What is the largest 0 to 9 pandigital 10-digit concatenated product of an integer with two or more other integers, such that the concatenation of the input numbers is also a 0 to 9 pandigital 10-digit number?
# --hints--
`euler170()`应返回9857164023
`euler170()` should return 9857164023.
```js
assert.strictEqual(euler170(), 9857164023);

View File

@ -1,19 +1,28 @@
---
id: 5900f4181000cf542c50ff2a
title: 问题171找到数字的平方和为正方形的数字
title: >-
Problem 171: Finding numbers for which the sum of the squares of the digits is a square
challengeType: 5
videoUrl: ''
forumTopicId: 301806
dashedName: >-
problem-171-finding-numbers-for-which-the-sum-of-the-squares-of-the-digits-is-a-square
---
# --description--
对于正整数n令fn为n的数字在基数10中的平方和例如f3= 32 = 9f25= 22 + 52 = 4 + 25 = 29f442= 42 + 42 + 22 = 16 + 16 + 4 = 36找到所有n的总和的最后九位数0 &lt;n &lt;1020使得fn是一个完美的平方。
For a positive integer n, let f(n) be the sum of the squares of the digits (in base 10) of n, e.g.
f(3) = 32 = 9,
f(25) = 22 + 52 = 4 + 25 = 29,
f(442) = 42 + 42 + 22 = 16 + 16 + 4 = 36
Find the last nine digits of the sum of all n, 0 &lt; n &lt; 1020, such that f(n) is a perfect square.
# --hints--
`euler171()`应该返回142989277
`euler171()` should return 142989277.
```js
assert.strictEqual(euler171(), 142989277);

View File

@ -1,18 +1,18 @@
---
id: 5900f4181000cf542c50ff2b
title: 问题172调查重复数字很少的数字
title: 'Problem 172: Investigating numbers with few repeated digits'
challengeType: 5
videoUrl: ''
forumTopicId: 301807
dashedName: problem-172-investigating-numbers-with-few-repeated-digits
---
# --description--
有多少个18位数字n没有前导零n中没有数字出现超过三次
How many 18-digit numbers n (without leading zeros) are there such that no digit occurs more than three times in n?
# --hints--
`euler172()`应返回227485267000992000
`euler172()` should return 227485267000992000.
```js
assert.strictEqual(euler172(), 227485267000992000);

View File

@ -1,21 +1,22 @@
---
id: 5900f41a1000cf542c50ff2c
title: 问题173使用多达一百万个瓷砖可以形成多少个不同的“空心”方形薄片
title: >-
Problem 173: Using up to one million tiles how many different "hollow" square laminae can be formed?
challengeType: 5
videoUrl: ''
forumTopicId: 301808
dashedName: >-
problem-173-using-up-to-one-million-tiles-how-many-different-hollow-square-laminae-can-be-formed
---
# --description--
我们将方形薄片定义为具有方形“孔”的方形轮廓,使得该形状具有垂直和水平对称性。例如,使用正好三十二平方的瓷砖,我们可以形成两个不同的方形薄片:
We shall define a square lamina to be a square outline with a square "hole" so that the shape possesses vertical and horizontal symmetry. For example, using exactly thirty-two square tiles we can form two different square laminae:
使用一百个瓷砖,并且不一定一次使用所有瓷砖,可以形成四十一个不同的方形薄片。使用多达一百万个瓷砖可以形成多少个不同的方形薄片?
With one-hundred tiles, and not necessarily using all of the tiles at one time, it is possible to form forty-one different square laminae. Using up to one million tiles how many different square laminae can be formed?
# --hints--
`euler173()`应该返回1572729
`euler173()` should return 1572729.
```js
assert.strictEqual(euler173(), 1572729);

View File

@ -1,21 +1,24 @@
---
id: 5900f41a1000cf542c50ff2d
title: 问题174计算可以形成一个两个三个......不同排列的“空心”方形薄片的数量
title: >-
Problem 174: Counting the number of "hollow" square laminae that can form one, two, three, ... distinct arrangements
challengeType: 5
videoUrl: ''
forumTopicId: 301809
dashedName: >-
problem-174-counting-the-number-of-hollow-square-laminae-that-can-form-one-two-three-----distinct-arrangements
---
# --description--
我们将方形薄片定义为具有方形“孔”的方形轮廓使得该形状具有垂直和水平对称性。给定八个瓷砖可以仅以一种方式形成薄层3x3正方形中间有1x1个孔。但是使用32个瓷砖可以形成两个不同的薄片。
We shall define a square lamina to be a square outline with a square "hole" so that the shape possesses vertical and horizontal symmetry.
如果t表示使用的瓦片数我们将说t = 8是类型L1并且t = 32是类型L2。令Nn为t≤1000000的数使得t为Ln型;例如N15= 832.对于1≤n≤10ΣNn是多少
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?
# --hints--
`euler174()`应该返回209566
`euler174()` should return 209566.
```js
assert.strictEqual(euler174(), 209566);

View File

@ -1,23 +1,24 @@
---
id: 5900f41c1000cf542c50ff2e
title: 问题175涉及不同方式的数量的分数数字可以表示为2的幂的总和
title: >-
Problem 175: Fractions involving the number of different ways a number can be expressed as a sum of powers of 2
challengeType: 5
videoUrl: ''
forumTopicId: 301810
dashedName: >-
problem-175-fractions-involving-the-number-of-different-ways-a-number-can-be-expressed-as-a-sum-of-powers-of-2
---
# --description--
将f0= 1和fn定义为将n作为2的幂之和进行写入的方式的数量其中没有功率发生超过两次。
Define f(0)=1 and f(n) to be the number of ways to write n as a sum of powers of 2 where no power occurs more than twice.
例如f10= 5因为有五种不同的表达方式10:10 = 8 + 2 = 8 + 1 + 1 = 4 + 4 + 2 = 4 + 2 + 2 + 1 + 1 = 4 + 4 + 1 + 1
For example, f(10)=5 since there are five different ways to express 10:10 = 8+2 = 8+1+1 = 4+4+2 = 4+2+2+1+1 = 4+4+1+1
可以证明对于每个分数p / qp> 0q> 0存在至少一个整数n使得fn/ fn-1= p / q。例如fn/ fn-1= 13/17的最小n是241. 241的二进制扩展是11110001.从最高有效位到最低有效位读取这个二进制数有4个13个零和1个。我们将字符串4,3,1称为缩短的二进制扩展241.找到最小n的缩短二进制扩展其中fn/ fn-1= 123456789/987654321。以逗号分隔的整数给出答案没有任何空格。
It can be shown that for every fraction p/q (p>0, q>0) there exists at least one integer n such that f(n)/f(n-1)=p/q. For instance, the smallest n for which f(n)/f(n-1)=13/17 is 241. The binary expansion of 241 is 11110001. Reading this binary number from the most significant bit to the least significant bit there are 4 one's, 3 zeroes and 1 one. We shall call the string 4,3,1 the Shortened Binary Expansion of 241. Find the Shortened Binary Expansion of the smallest n for which f(n)/f(n-1)=123456789/987654321. Give your answer as comma separated integers, without any whitespaces.
# --hints--
`euler175()`应该返回1,13717420,8。
`euler175()` should return 1, 13717420, 8.
```js
assert.strictEqual(euler175(), 1, 13717420, 8);

View File

@ -1,18 +1,20 @@
---
id: 5900f41c1000cf542c50ff2f
title: 问题176共用一个cathetus的直角三角形
title: 'Problem 176: Right-angled triangles that share a cathetus'
challengeType: 5
videoUrl: ''
forumTopicId: 301811
dashedName: problem-176-right-angled-triangles-that-share-a-cathetus
---
# --description--
具有侧面(9,12,1512,16,205,12,13)和(12,35,37的四个直角三角形都具有相等的一个短边导管可以证明没有其他整数侧直角三角形存在其中一个导管等于12.找到最小整数可以是恰好47547个不同整数侧直角三角形的cathetus的长度。
The four right-angled triangles with sides (9,12,15), (12,16,20), (5,12,13) and (12,35,37) all have one of the shorter sides (catheti) equal to 12. It can be shown that no other integer sided right-angled triangle exists with one of the catheti equal to 12.
Find the smallest integer that can be the length of a cathetus of exactly 47547 different integer sided right-angled triangles.
# --hints--
`euler176()`应返回96818198400000
`euler176()` should return 96818198400000.
```js
assert.strictEqual(euler176(), 96818198400000);

View File

@ -1,20 +1,20 @@
---
id: 5900f41e1000cf542c50ff30
title: 问题177整数角四边形
title: 'Problem 177: Integer angled Quadrilaterals'
challengeType: 5
videoUrl: ''
forumTopicId: 301812
dashedName: problem-177-integer-angled-quadrilaterals
---
# --description--
设ABCD为凸四边形对角线为AC和BD。在每个顶点处对角线与两侧中的每一侧形成一个角度从而产生八个角度角。
Let ABCD be a convex quadrilateral, with diagonals AC and BD. At each vertex the diagonal makes an angle with each of the two sides, creating eight corner angles.
例如在顶点A处两个角度是CADCAB。我们称之为四边形当以“整角四边形”度数度量时所有八个角度角都具有整数值。整数角度四边形的示例是正方形其中所有八个角度角都是45°。另一个例子是DAC = 20°BAC = 60°ABD = 50°CBD = 30°BCA = 40°DCA = 30°CDB = 80°ADB = 50°。非相似整数角度四边形的总数是多少注意在计算中如果计算出的角度在整数值的10-9范围内则可以假定计算出的角度是整数。
For example, at vertex A, the two angles are CAD, CAB. We call such a quadrilateral for which all eight corner angles have integer values when measured in degrees an "integer angled quadrilateral". An example of an integer angled quadrilateral is a square, where all eight corner angles are 45°. Another example is given by DAC = 20°, BAC = 60°, ABD = 50°, CBD = 30°, BCA = 40°, DCA = 30°, CDB = 80°, ADB = 50°. What is the total number of non-similar integer angled quadrilaterals? Note: In your calculations you may assume that a calculated angle is integral if it is within a tolerance of 10-9 of an integer value.
# --hints--
`euler177()`应返回129325
`euler177()` should return 129325.
```js
assert.strictEqual(euler177(), 129325);

View File

@ -1,20 +1,26 @@
---
id: 5900f41e1000cf542c50ff31
title: 问题178步骤编号
title: 'Problem 178: Step Numbers'
challengeType: 5
videoUrl: ''
forumTopicId: 301813
dashedName: problem-178-step-numbers
---
# --description--
考虑数字45656.可以看出45656的每对连续数字的差值为1。每对连续数字的差值为1的数字称为步数。 pandigital数字包含从0到9的每个十进制数字至少一次。
Consider the number 45656.
有多少pandigital步数小于1040
It can be seen that each pair of consecutive digits of 45656 has a difference of one.
A number for which every pair of consecutive digits has a difference of one is called a step number.
A pandigital number contains every decimal digit from 0 to 9 at least once.
How many pandigital step numbers less than 1040 are there?
# --hints--
`euler178()`应该返回126461847755
`euler178()` should return 126461847755.
```js
assert.strictEqual(euler178(), 126461847755);

View File

@ -1,18 +1,18 @@
---
id: 5900f41f1000cf542c50ff32
title: 问题179连续的正向除数
title: 'Problem 179: Consecutive positive divisors'
challengeType: 5
videoUrl: ''
forumTopicId: 301814
dashedName: problem-179-consecutive-positive-divisors
---
# --description--
求整数1 &lt;n &lt;107其中n和n + 1具有相同的正除数。例如14具有正除数1,2,7,14而15具有1,3,5,15
Find the number of integers 1 &lt; n &lt; 107, for which n and n + 1 have the same number of positive divisors. For example, 14 has the positive divisors 1, 2, 7, 14 while 15 has 1, 3, 5, 15.
# --hints--
`euler179()`应返回986262
`euler179()` should return 986262.
```js
assert.strictEqual(euler179(), 986262);

View File

@ -1,17 +1,27 @@
---
id: 5900f37e1000cf542c50fe91
title: 问题18最大路径总和I.
title: 'Problem 18: Maximum path sum I'
challengeType: 5
videoUrl: ''
forumTopicId: 301815
dashedName: problem-18-maximum-path-sum-i
---
# --description--
通过启动在低于该三角形的顶部和移动到相邻的数字下面的行中最大总从上到下为23 **3**
**7** 4
2 **4** 6
8 5 **9** 3也就是说3 + 7 + 4 + 9 = 23.找到下面三角形从上到下的最大总数: 75
By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23.
<span style='display: block; text-align: center;'>
<strong style='color: red;'>3</strong><br>
<strong style='color: red;'>7</strong> 4<br>
2 <strong style='color: red;'>4</strong> 6<br>
8 5 <strong style='color: red;'>9</strong> 3
</span>
That is, 3 + 7 + 4 + 9 = 23.
Find the maximum total from top to bottom of the triangle below:
75
95 64
17 47 82
18 35 87 10
@ -25,17 +35,25 @@ dashedName: problem-18-maximum-path-sum-i
70 11 33 28 77 73 17 78 39 68 17 57
91 71 52 38 17 14 91 43 58 50 27 29 48
63 66 04 68 89 53 67 30 73 16 69 87 40 31
04 62 98 27 23 09 70 98 73 93 38 53 60 04 23 **注意:** 由于只有16384条路线因此可以通过尝试每条路线来解决此问题。然而问题67与包含一百行的三角形是同样的挑战;它无法通过蛮力解决,需要一种聪明的方法! ; O
04 62 98 27 23 09 70 98 73 93 38 53 60 04 23
**NOTE:** As there are only 16384 routes, it is possible to solve this problem by trying every route. However, Problem 67, is the same challenge with a triangle containing one-hundred rows; it cannot be solved by brute force, and requires a clever method! ;o)
# --hints--
`maximumPathSumI(testTriangle)`应该返回23。
`maximumPathSumI(testTriangle)` should return a number.
```js
assert(typeof maximumPathSumI(testTriangle) === 'number');
```
`maximumPathSumI(testTriangle)` should return 23.
```js
assert.strictEqual(maximumPathSumI(testTriangle), 23);
```
`maximumPathSumI(numTriangle)`应该返回1074
`maximumPathSumI(numTriangle)` should return 1074.
```js
assert.strictEqual(maximumPathSumI(numTriangle), 1074);

View File

@ -1,18 +1,34 @@
---
id: 5900f4201000cf542c50ff33
title: 问题180三个变量函数的有理零点
title: 'Problem 180: Rational zeros of a function of three variables'
challengeType: 5
videoUrl: ''
forumTopicId: 301816
dashedName: problem-180-rational-zeros-of-a-function-of-three-variables
---
# --description--
对于任何整数n考虑三个函数f1nxyz= xn + 1 + yn + 1 - zn + 1f2nxyz=xy + yz + zx\* xn-1 + yn-1-zn-1f3nxyz= xyz \*xn-2 + yn-2-zn-2及其组合fnxyz= f1nxyz+ f2nxyz - f3nxyz如果是x我们将xyz称为k阶的黄金三元组 y和z都是形式为a / b的有理数0 &lt;a &lt;b≤k且存在至少一个整数n因此fnxyz= 0.设sx yz= x + y + z。设t = u / v是所有不同sxyz的所有黄金三元组xyz的总和。所有sxyz和t必须在减少形式。找到你+ v。
For any integer n, consider the three functions
f1,n(x,y,z) = xn+1 + yn+1 zn+1f2,n(x,y,z) = (xy + yz + zx)\*(xn-1 + yn-1 zn-1)f3,n(x,y,z) = xyz\*(xn-2 + yn-2 zn-2)
and their combination
fn(x,y,z) = f1,n(x,y,z) + f2,n(x,y,z) f3,n(x,y,z)
We call (x,y,z) a golden triple of order k if x, y, and z are all rational numbers of the form a / b with
0 &lt; a &lt; b ≤ k and there is (at least) one integer n, so that fn(x,y,z) = 0.
Let s(x,y,z) = x + y + z.
Let t = u / v be the sum of all distinct s(x,y,z) for all golden triples (x,y,z) of order 35. All the s(x,y,z) and t must be in reduced form.
Find u + v.
# --hints--
`euler180()`应该返回285196020571078980
`euler180()` should return 285196020571078980.
```js
assert.strictEqual(euler180(), 285196020571078980);

View File

@ -1,19 +1,26 @@
---
id: 5900f4231000cf542c50ff34
title: 问题181调查两种不同颜色的对象可以分组的方式
title: >-
Problem 181: Investigating in how many ways objects of two different colours can be grouped
challengeType: 5
videoUrl: ''
forumTopicId: 301817
dashedName: >-
problem-181-investigating-in-how-many-ways-objects-of-two-different-colours-can-be-grouped
---
# --description--
有三个黑色物体B和一个白色物体W它们可以用7种方式分组BBBWBBBWBBBWBBBWBBBW BBBWBBBW在六十个黑色物体B和四十个白色物体W的分组方式中有多少种
Having three black objects B and one white object W they can be grouped in 7 ways like this:
(BBBW)(B,BBW)(B,B,BW)(B,B,B,W)
(B,BB,W)(BBB,W)(BB,BW)
In how many ways can sixty black objects B and forty white objects W be thus grouped?
# --hints--
`euler181()`应该返回83735848679360670
`euler181()` should return 83735848679360670.
```js
assert.strictEqual(euler181(), 83735848679360670);

View File

@ -1,32 +1,34 @@
---
id: 5900f4231000cf542c50ff36
title: 问题183零件的最大产品
title: 'Problem 183: Maximum product of parts'
challengeType: 5
videoUrl: ''
forumTopicId: 301819
dashedName: problem-183-maximum-product-of-parts
---
# --description--
令N为正整数并且将N分成k个相等的部分r = N / k使得N = r + r + ... + r。设P是这些部分的乘积P = r×r×...×r = rk。
Let N be a positive integer and let N be split into k equal parts, r = N/k, so that N = r + r + ... + r.
例如如果11被分成五个相等的部分11 = 2.2 + 2.2 + 2.2 + 2.2 + 2.2那么P = 2.25 = 51.53632。
Let P be the product of these parts, P = r × r × ... × r = rk.
对于给定的N值设MN= Pmax。
For example, if 11 is split into five equal parts, 11 = 2.2 + 2.2 + 2.2 + 2.2 + 2.2, then P = 2.25 = 51.53632.
事实证明N = 11的最大值是通过将11分成4个相等的部分得到的这导致Pmax =11/44;即M11= 14641/256 = 57.19140625,这是终止小数。
Let M(N) = Pmax for a given value of N.
然而对于N = 8通过将其分成三个相等的部分来实现最大值因此M8= 512/27这是非终止小数。
It turns out that the maximum for N = 11 is found by splitting eleven into four equal parts which leads to Pmax = (11/4)4; that is, M(11) = 14641/256 = 57.19140625, which is a terminating decimal.
如果MN是非终止小数则令DN= N如果MN是终止小数则DN= -N。
However, for N = 8 the maximum is achieved by splitting it into three equal parts, so M(8) = 512/27, which is a non-terminating decimal.
例如5≤N≤100的ΣDN是2438。
Let D(N) = N if M(N) is a non-terminating decimal and D(N) = -N if M(N) is a terminating decimal.
求ΣDN为5≤N≤10000。
For example, ΣD(N) for 5 ≤ N ≤ 100 is 2438.
Find ΣD(N) for 5 ≤ N ≤ 10000.
# --hints--
`euler183()`应该返回48861552
`euler183()` should return 48861552.
```js
assert.strictEqual(euler183(), 48861552);

View File

@ -1,22 +1,24 @@
---
id: 5900f4241000cf542c50ff37
title: 问题184包含原点的三角形
title: 'Problem 184: Triangles containing the origin'
challengeType: 5
videoUrl: ''
forumTopicId: 301820
dashedName: problem-184-triangles-containing-the-origin
---
# --description--
考虑点xy的集合Ir其中半径为r的圆内部的整数坐标以原点为中心即x2 + y2 &lt;r2。对于半径为2I2包含九个点0,01,01,10,1 - 1,1 - 1,0 -1-10-11-1。在I2中有八个三角形具有全部三个顶点其中包含内部的原点。其中两个如下所示其他通过旋转从这些中获得。
Consider the set Ir of points (x,y) with integer coordinates in the interior of the circle with radius r, centered at the origin, i.e. x2 + y2 &lt; r2.
对于半径为3有360个三角形包含内部的原点并且所有顶点都在I3中而对于I5该数字是10600。
For a radius of 2, I2 contains the nine points (0,0), (1,0), (1,1), (0,1), (-1,1), (-1,0), (-1,-1), (0,-1) and (1,-1). There are eight triangles having all three vertices in I2 which contain the origin in the interior. Two of them are shown below, the others are obtained from these by rotation.
有多少个三角形包含内部的原点并且在I105中包含所有三个顶点
For a radius of 3, there are 360 triangles containing the origin in the interior and having all vertices in I3 and for I5 the number is 10600.
How many triangles are there containing the origin in the interior and having all three vertices in I105?
# --hints--
`euler184()`应返回1725323624056
`euler184()` should return 1725323624056.
```js
assert.strictEqual(euler184(), 1725323624056);

View File

@ -1,26 +1,28 @@
---
id: 5900f4251000cf542c50ff38
title: 问题185数字思维
title: 'Problem 185: Number Mind'
challengeType: 5
videoUrl: ''
forumTopicId: 301821
dashedName: problem-185-number-mind
---
# --description--
游戏Number Mind是众所周知的游戏Master Mind的变种。而不是彩色钉你必须猜测一个秘密的数字序列。在每次猜测之后你只会告诉你猜对了多少个正确的数字。所以如果序列是1234并且你猜到了2036那么你会被告知你有一个正确的数字;但是,你不会被告知你在错误的地方也有另一个数字。
The game Number Mind is a variant of the well known game Master Mind.
例如给出以下5位秘密序列的猜测90342; 2正确70794; 0正确39458; 2正确34109; 1正确51545; 2正确12531; 1正确正确序列39542是唯一的。
Instead of coloured pegs, you have to guess a secret sequence of digits. After each guess you're only told in how many places you've guessed the correct digit. So, if the sequence was 1234 and you guessed 2036, you'd be told that you have one correct digit; however, you would NOT be told that you also have another digit in the wrong place.
基于以下猜测,
For instance, given the following guesses for a 5-digit secret sequence, 90342 ;2 correct 70794 ;0 correct 39458 ;2 correct 34109 ;1 correct 51545 ;2 correct 12531 ;1 correct The correct sequence 39542 is unique.
5616185650518293 2正确3847439647293047 1正确5855462940810587 3正确9742855507068353 3正确4296849643607543 3正确3174248439465858 1正确4513559094146117 2正确7890971548908067 3正确8157356344118483 1正确2615250744386899 2正确8690095851526254 3正确6375711915077050 1正确6913859173121360; 1更正6442889055042768; 2更正2321386104303845; 0更正2326509471271448; 2更正5251583379644322; 2更正1748270476758276; 3更正4895722652190306; 1更正3041631117224635; 3更正1841236454324589; 3更正2659862637316867; 2更正
Based on the following guesses,
找到唯一的16位秘密序列。
5616185650518293 ;2 correct 3847439647293047 ;1 correct 5855462940810587 ;3 correct 9742855507068353 ;3 correct 4296849643607543 ;3 correct 3174248439465858 ;1 correct 4513559094146117 ;2 correct 7890971548908067 ;3 correct 8157356344118483 ;1 correct 2615250744386899 ;2 correct 8690095851526254 ;3 correct 6375711915077050 ;1 correct 6913859173121360 ;1 correct 6442889055042768 ;2 correct 2321386104303845 ;0 correct 2326509471271448 ;2 correct 5251583379644322 ;2 correct 1748270476758276 ;3 correct 4895722652190306 ;1 correct 3041631117224635 ;3 correct 1841236454324589 ;3 correct 2659862637316867 ;2 correct
Find the unique 16-digit secret sequence.
# --hints--
`euler185()`应该返回4640261571849533
`euler185()` should return 4640261571849533.
```js
assert.strictEqual(euler185(), 4640261571849533);

View File

@ -1,28 +1,28 @@
---
id: 5900f4281000cf542c50ff39
title: 问题186网络的连通性
title: 'Problem 186: Connectedness of a network'
challengeType: 5
videoUrl: ''
forumTopicId: 301822
dashedName: problem-186-connectedness-of-a-network
---
# --description--
以下是来自拥有100万用户的繁忙电话系统的记录
Here are the records from a busy telephone system with one million users:
RecNrCallerCalled120000710005326001835004393600863701497 .........来电者的电话号码和记录n中的被叫号码是来电者n= S2n-1和被叫n= S2n其中S1,2,3...来来自“Lagged Fibonacci Generator”:
RecNrCallerCalled120000710005326001835004393600863701497......... The telephone number of the caller and the called number in record n are Caller(n) = S2n-1 and Called(n) = S2n where S1,2,3,... come from the "Lagged Fibonacci Generator":
对于1≤k≤55Sk = \[100003 - 200003k + 300007k3]模1000000对于56≤kSk = \[Sk-24 + Sk-55](模1000000
For 1 ≤ k ≤ 55, Sk = \[100003 - 200003k + 300007k3] (modulo 1000000) For 56 ≤ k, Sk = \[Sk-24 + Sk-55] (modulo 1000000)
如果Callern= Calledn则假定用户误操作并且呼叫失败;否则通话成功。
If Caller(n) = Called(n) then the user is assumed to have misdialled and the call fails; otherwise the call is successful.
从记录的开头我们说如果X调用Y则任何一对用户X和Y都是朋友反之亦然。类似地如果X是Y的朋友并且Y是Z的朋友则X是Z的朋友的朋友;等等更长的链条。
From the start of the records, we say that any pair of users X and Y are friends if X calls Y or vice-versa. Similarly, X is a friend of a friend of Z if X is a friend of Y and Y is a friend of Z; and so on for longer chains.
总理的电话号码是524287.经过多少次成功的电话不计算误操作99的用户包括PM将成为总理的朋友朋友的朋友等
The Prime Minister's phone number is 524287. After how many successful calls, not counting misdials, will 99% of the users (including the PM) be a friend, or a friend of a friend etc., of the Prime Minister?
# --hints--
`euler186()`应返回2325629
`euler186()` should return 2325629.
```js
assert.strictEqual(euler186(), 2325629);

View File

@ -1,22 +1,22 @@
---
id: 5900f4291000cf542c50ff3a
title: 问题187半致
title: 'Problem 187: Semiprimes'
challengeType: 5
videoUrl: ''
forumTopicId: 301823
dashedName: problem-187-semiprimes
---
# --description--
复合是包含至少两个素因子的数字。例如,15 = 3×5; 9 = 3×3; 12 = 2×2×3。
A composite is a number containing at least two prime factors. For example, 15 = 3 × 5; 9 = 3 × 3; 12 = 2 × 2 × 3.
在30以下有十种复合材料恰好包含两个不一定是不同的主要因素4,6,9,10,14,15,21,22,25,26
There are ten composites below thirty containing precisely two, not necessarily distinct, prime factors: 4, 6, 9, 10, 14, 15, 21, 22, 25, 26.
有多少复合整数,n &lt;108,恰好有两个,不一定是不同的素因子?
How many composite integers, n &lt; 108, have precisely two, not necessarily distinct, prime factors?
# --hints--
`euler187()`应该返回17427258
`euler187()` should return 17427258.
```js
assert.strictEqual(euler187(), 17427258);

View File

@ -1,20 +1,24 @@
---
id: 5900f4291000cf542c50ff3b
title: 问题188数字的过度扩展
title: 'Problem 188: The hyperexponentiation of a number'
challengeType: 5
videoUrl: ''
forumTopicId: 301824
dashedName: problem-188-the-hyperexponentiation-of-a-number
---
# --description--
由↑^ b或ba表示的正整数b的数字a的过度增强或分解通过以下方式递归地定义a↑↑1 = aa↑↑k + 1= aa↑↑k )。
The hyperexponentiation or tetration of a number a by a positive integer b, denoted by a↑↑b or ba, is recursively defined by:
因此我们有例如3↑↑2 = 33 = 27因此3↑↑3 = 327 = 7625597484987和3↑↑4大致是103.6383346400240996 \* 10 ^ 12。查找1777↑↑1855的最后8位数字。
a↑↑1 = a,
a↑↑(k+1) = a(a↑↑k).
Thus we have e.g. 3↑↑2 = 33 = 27, hence 3↑↑3 = 327 = 7625597484987 and 3↑↑4 is roughly 103.6383346400240996\*10^12. Find the last 8 digits of 1777↑↑1855.
# --hints--
`euler188()`应该返回95962097
`euler188()` should return 95962097.
```js
assert.strictEqual(euler188(), 95962097);

View File

@ -1,26 +1,26 @@
---
id: 5900f4291000cf542c50ff3c
title: 问题189三角网格三色
title: 'Problem 189: Tri-colouring a triangular grid'
challengeType: 5
videoUrl: ''
forumTopicId: 301825
dashedName: problem-189-tri-colouring-a-triangular-grid
---
# --description--
考虑以下64个三角形的配置
Consider the following configuration of 64 triangles:
我们希望用三种颜色中的一种为每个三角形的内部着色:红色,绿色或蓝色,这样就不会有两个相邻的三角形具有相同的颜色。这种着色应称为有效。这里,如果两个三角形共享边缘,则称它们是相邻的。注意:如果它们只共享一个顶点,那么它们不是邻居。
We wish to colour the interior of each triangle with one of three colours: red, green or blue, so that no two neighbouring triangles have the same colour. Such a colouring shall be called valid. Here, two triangles are said to be neighbouring if they share an edge. Note: if they only share a vertex, then they are not neighbours.
例如,以下是上面网格的有效着色:
For example, here is a valid colouring of the above grid:
通过旋转或反射从着色C获得的着色C'被认为与C不同除非两者相同。
A colouring C' which is obtained from a colouring C by rotation or reflection is considered distinct from C unless the two are identical.
上述配置有多少种不同的有效着色?
How many distinct valid colourings are there for the above configuration?
# --hints--
`euler189()`应该返回10834893628237824
`euler189()` should return 10834893628237824.
```js
assert.strictEqual(euler189(), 10834893628237824);

View File

@ -1,40 +1,44 @@
---
id: 5900f37f1000cf542c50fe92
title: 问题19计算星期日
title: 'Problem 19: Counting Sundays'
challengeType: 5
videoUrl: ''
forumTopicId: 301827
dashedName: problem-19-counting-sundays
---
# --description--
您将获得以下信息,但您可能更愿意为自己做一些研究。
You are given the following information, but you may prefer to do some research for yourself.
- 1900年1月1日是星期一。
- 九月是三十天
四月,六月和十一月。
其余的都有三十一个,
仅拯救二月,
其中有二十八,风雨无阻。
在闰年,二十九岁。
- 闰年发生在任何一年可被4整除但除非可被400整除否则不会在一个世纪上。
- 在二十世纪的第一个月1901年1月1日至2000年12月31日有多少个星期日下降
<ul>
<li>1 Jan 1900 was a Monday.</li>
<li>Thirty days has September,<br>April, June and November.<br>All the rest have thirty-one,<br>Saving February alone,<br>Which has twenty-eight, rain or shine.<br>And on leap years, twenty-nine.</li>
<li>A leap year occurs on any year evenly divisible by 4, but not on a century unless it is divisible by 400.</li>
</ul>
How many Sundays fell on the first of the month during the twentieth century (1 Jan 1901 to 31 Dec 2000)?
# --hints--
`countingSundays(1943, 1946)`应该返回6。
`countingSundays(1943, 1946)` should return a number.
```js
assert(typeof countingSundays(1943, 1946) === 'number');
```
`countingSundays(1943, 1946)` should return 6.
```js
assert.strictEqual(countingSundays(1943, 1946), 6);
```
`countingSundays(1995, 2000)`应该返回9。
`countingSundays(1995, 2000)` should return 10.
```js
assert.strictEqual(countingSundays(1995, 2000), 10);
```
`countingSundays(1901, 2000)`应该返回171
`countingSundays(1901, 2000)` should return 171.
```js
assert.strictEqual(countingSundays(1901, 2000), 171);

Some files were not shown because too many files have changed in this diff Show More