id
int64
1
981
problem
stringlengths
97
5.29k
raw_html
stringlengths
121
5.63k
url
stringlengths
34
36
answer
stringlengths
1
29
201
For any set $A$ of numbers, let $\operatorname{sum}(A)$ be the sum of the elements of $A$. Consider the set $B = \{1,3,6,8,10,11\}$. There are $20$ subsets of $B$ containing three elements, and their sums are: $$\begin{align} \operatorname{sum}(\{1,3,6\}) &= 10,\\ \operatorname{sum}(\{1,3,8\}) &= 12,\\ \operatorname{...
<p>For any set $A$ of numbers, let $\operatorname{sum}(A)$ be the sum of the elements of $A$.<br> Consider the set $B = \{1,3,6,8,10,11\}$.<br> There are $20$ subsets of $B$ containing three elements, and their sums are:</p> $$\begin{align} \operatorname{sum}(\{1,3,6\}) &amp;= 10,\\ \operatorname{sum}(\{1,3,8\}) &amp;...
https://projecteuler.net/problem=201
115039000
202
Three mirrors are arranged in the shape of an equilateral triangle, with their reflective surfaces pointing inwards. There is an infinitesimal gap at each vertex of the triangle through which a laser beam may pass. Label the vertices $A$, $B$ and $C$. There are $2$ ways in which a laser beam may enter vertex $C$, boun...
<p>Three mirrors are arranged in the shape of an equilateral triangle, with their reflective surfaces pointing inwards. There is an infinitesimal gap at each vertex of the triangle through which a laser beam may pass.</p> <p>Label the vertices $A$, $B$ and $C$. There are $2$ ways in which a laser beam may enter vertex...
https://projecteuler.net/problem=202
1209002624
203
The binomial coefficients $\displaystyle \binom n k$ can be arranged in triangular form, Pascal's triangle, like this: | | 1 | | | | 1 | | 1 | | | | 1 | | 2 | | 1 | | | | 1 | | 3 | | 3 | | 1 | | | | 1 | | 4 | | 6 | | 4 | | 1 | | | | 1 | | 5 | | 10 | | 10 | | 5 | | 1 | | | | 1 | | 6 | | 15...
<p>The binomial coefficients $\displaystyle \binom n k$ can be arranged in triangular form, Pascal's triangle, like this:</p> <div class="center"> <table align="center"><tr><td colspan="7"></td><td>1</td><td colspan="7"></td></tr><tr><td colspan="6"></td><td>1</td><td></td><td>1</td><td colspan="6"></td></tr><tr><td c...
https://projecteuler.net/problem=203
34029210557338
204
A Hamming number is a positive number which has no prime factor larger than $5$. So the first few Hamming numbers are $1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15$. There are $1105$ Hamming numbers not exceeding $10^8$. We will call a positive number a generalised Hamming number of type $n$, if it has no prime factor larger ...
<p>A Hamming number is a positive number which has no prime factor larger than $5$.<br> So the first few Hamming numbers are $1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15$.<br> There are $1105$ Hamming numbers not exceeding $10^8$.</p> <p>We will call a positive number a generalised Hamming number of type $n$, if it has no prim...
https://projecteuler.net/problem=204
2944730
205
Peter has nine four-sided (pyramidal) dice, each with faces numbered $1, 2, 3, 4$. Colin has six six-sided (cubic) dice, each with faces numbered $1, 2, 3, 4, 5, 6$. Peter and Colin roll their dice and compare totals: the highest total wins. The result is a draw if the totals are equal. What is the probability that ...
<p>Peter has nine four-sided (pyramidal) dice, each with faces numbered $1, 2, 3, 4$.<br> Colin has six six-sided (cubic) dice, each with faces numbered $1, 2, 3, 4, 5, 6$.</p> <p>Peter and Colin roll their dice and compare totals: the highest total wins. The result is a draw if the totals are equal.</p> <p>What is t...
https://projecteuler.net/problem=205
0.5731441
206
Find the unique positive integer whose square has the form 1_2_3_4_5_6_7_8_9_0, where each “_” is a single digit.
<p>Find the unique positive integer whose square has the form 1_2_3_4_5_6_7_8_9_0,<br> where each “_” is a single digit.</p>
https://projecteuler.net/problem=206
1389019170
207
For some positive integers $k$, there exists an integer partition of the form $4^t = 2^t + k$, where $4^t$, $2^t$, and $k$ are all positive integers and $t$ is a real number. The first two such partitions are $4^1 = 2^1 + 2$ and $4^{1.5849625\cdots} = 2^{1.5849625\cdots} + 6$. Partitions where $t$ is also an integer...
<p>For some positive integers $k$, there exists an integer partition of the form $4^t = 2^t + k$,<br> where $4^t$, $2^t$, and $k$ are all positive integers and $t$ is a real number.</p> <p>The first two such partitions are $4^1 = 2^1 + 2$ and $4^{1.5849625\cdots} = 2^{1.5849625\cdots} + 6$.</p> <p>Partitions where $t...
https://projecteuler.net/problem=207
44043947822
208
A robot moves in a series of one-fifth circular arcs ($72^\circ$), with a free choice of a clockwise or an anticlockwise arc for each step, but no turning on the spot. One of $70932$ possible closed paths of $25$ arcs starting northward is Given that the robot starts facing North, how many journeys of $70$ arcs in le...
<p>A robot moves in a series of one-fifth circular arcs ($72^\circ$), with a free choice of a clockwise or an anticlockwise arc for each step, but no turning on the spot.</p> <p>One of $70932$ possible closed paths of $25$ arcs starting northward is</p> <div class="center"> <img src="resources/images/0208_robotwalk.gi...
https://projecteuler.net/problem=208
331951449665644800
209
A $k$-input binary truth table is a map from $k$ input bits (binary digits, $0$ [false] or $1$ [true]) to $1$ output bit. For example, the $2$-input binary truth tables for the logical $\mathbin{\text{AND}}$ and $\mathbin{\text{XOR}}$ functions are: | $x$ | $y$ | $x \mathbin{\text{AND}} y$ | | --- | --- | --- | | $0$ ...
<p>A $k$-input <strong>binary truth table</strong> is a map from $k$ input bits (binary digits, $0$ [false] or $1$ [true]) to $1$ output bit. For example, the $2$-input binary truth tables for the logical $\mathbin{\text{AND}}$ and $\mathbin{\text{XOR}}$ functions are:</p> <div style="float:left;margin:10px 50px;text-a...
https://projecteuler.net/problem=209
15964587728784
210
Consider the set $S(r)$ of points $(x,y)$ with integer coordinates satisfying $|x| + |y| \le r$. Let $O$ be the point $(0,0)$ and $C$ the point $(r/4,r/4)$. Let $N(r)$ be the number of points $B$ in $S(r)$, so that the triangle $OBC$ has an obtuse angle, i.e. the largest angle $\alpha$ satisfies $90^\circ \lt \alpha ...
Consider the set $S(r)$ of points $(x,y)$ with integer coordinates satisfying $|x| + |y| \le r$.<br> Let $O$ be the point $(0,0)$ and $C$ the point $(r/4,r/4)$. <br> Let $N(r)$ be the number of points $B$ in $S(r)$, so that the triangle $OBC$ has an obtuse angle, i.e. the largest angle $\alpha$ satisfies $90^\circ \lt ...
https://projecteuler.net/problem=210
1598174770174689458
211
For a positive integer $n$, let $\sigma_2(n)$ be the sum of the squares of its divisors. For example, $$\sigma_2(10) = 1 + 4 + 25 + 100 = 130.$$ Find the sum of all $n$, $0 \lt n \lt 64\,000\,000$ such that $\sigma_2(n)$ is a perfect square.
<p>For a positive integer $n$, let $\sigma_2(n)$ be the sum of the squares of its divisors. For example, $$\sigma_2(10) = 1 + 4 + 25 + 100 = 130.$$</p> <p>Find the sum of all $n$, $0 \lt n \lt 64\,000\,000$ such that $\sigma_2(n)$ is a perfect square.</p>
https://projecteuler.net/problem=211
1922364685
212
An axis-aligned cuboid, specified by parameters $\{(x_0, y_0, z_0), (dx, dy, dz)\}$, consists of all points $(X,Y,Z)$ such that $x_0 \le X \le x_0 + dx$, $y_0 \le Y \le y_0 + dy$ and $z_0 \le Z \le z_0 + dz$. The volume of the cuboid is the product, $dx \times dy \times dz$. The combined volume of a collection of cub...
<p>An <dfn>axis-aligned cuboid</dfn>, specified by parameters $\{(x_0, y_0, z_0), (dx, dy, dz)\}$, consists of all points $(X,Y,Z)$ such that $x_0 \le X \le x_0 + dx$, $y_0 \le Y \le y_0 + dy$ and $z_0 \le Z \le z_0 + dz$. The volume of the cuboid is the product, $dx \times dy \times dz$. The <dfn>combined volume</df...
https://projecteuler.net/problem=212
328968937309
213
A $30 \times 30$ grid of squares contains $900$ fleas, initially one flea per square. When a bell is rung, each flea jumps to an adjacent square at random (usually $4$ possibilities, except for fleas on the edge of the grid or at the corners). What is the expected number of unoccupied squares after $50$ rings of the ...
<p>A $30 \times 30$ grid of squares contains $900$ fleas, initially one flea per square.<br> When a bell is rung, each flea jumps to an adjacent square at random (usually $4$ possibilities, except for fleas on the edge of the grid or at the corners).</p> <p>What is the expected number of unoccupied squares after $50$ ...
https://projecteuler.net/problem=213
330.721154
214
Let $\phi$ be Euler's totient function, i.e. for a natural number $n$, $\phi(n)$ is the number of $k$, $1 \le k \le n$, for which $\gcd(k, n) = 1$. By iterating $\phi$, each positive integer generates a decreasing chain of numbers ending in $1$. E.g. if we start with $5$ the sequence $5,4,2,1$ is generated. Here is ...
<p>Let $\phi$ be Euler's totient function, i.e. for a natural number $n$, $\phi(n)$ is the number of $k$, $1 \le k \le n$, for which $\gcd(k, n) = 1$.</p> <p>By iterating $\phi$, each positive integer generates a decreasing chain of numbers ending in $1$.<br> E.g. if we start with $5$ the sequence $5,4,2,1$ is generat...
https://projecteuler.net/problem=214
1677366278943
215
Consider the problem of building a wall out of $2 \times 1$ and $3 \times 1$ bricks ($\text{horizontal} \times \text{vertical}$ dimensions) such that, for extra strength, the gaps between horizontally-adjacent bricks never line up in consecutive layers, i.e. never form a "running crack". For example, the following $9 ...
<p>Consider the problem of building a wall out of $2 \times 1$ and $3 \times 1$ bricks ($\text{horizontal} \times \text{vertical}$ dimensions) such that, for extra strength, the gaps between horizontally-adjacent bricks never line up in consecutive layers, i.e. never form a "running crack".</p> <p>For example, the fol...
https://projecteuler.net/problem=215
806844323190414
216
Consider numbers $t(n)$ of the form $t(n) = 2n^2 - 1$ with $n \gt 1$. The first such numbers are $7, 17, 31, 49, 71, 97, 127$ and $161$. It turns out that only $49 = 7 \cdot 7$ and $161 = 7 \cdot 23$ are not prime. For $n \le 10000$ there are $2202$ numbers $t(n)$ that are prime. How many numbers $t(n)$ are prime f...
<p>Consider numbers $t(n)$ of the form $t(n) = 2n^2 - 1$ with $n \gt 1$.<br> The first such numbers are $7, 17, 31, 49, 71, 97, 127$ and $161$.<br> It turns out that only $49 = 7 \cdot 7$ and $161 = 7 \cdot 23$ are not prime.<br> For $n \le 10000$ there are $2202$ numbers $t(n)$ that are prime.</p> <p>How many numbers...
https://projecteuler.net/problem=216
5437849
217
A positive integer with $k$ (decimal) digits is called balanced if its first $\lceil k/2 \rceil$ digits sum to the same value as its last $\lceil k/2 \rceil$ digits, where $\lceil x \rceil$, pronounced ceiling of $x$, is the smallest integer $\ge x$, thus $\lceil \pi \rceil = 4$ and $\lceil 5 \rceil = 5$. So, for exam...
<p> A positive integer with $k$ (decimal) digits is called balanced if its first $\lceil k/2 \rceil$ digits sum to the same value as its last $\lceil k/2 \rceil$ digits, where $\lceil x \rceil$, pronounced <i>ceiling</i> of $x$, is the smallest integer $\ge x$, thus $\lceil \pi \rceil = 4$ and $\lceil 5 \rceil = 5$.</p...
https://projecteuler.net/problem=217
6273134
218
Consider the right angled triangle with sides $a=7$, $b=24$ and $c=25$. The area of this triangle is $84$, which is divisible by the perfect numbers $6$ and $28$. Moreover it is a primitive right angled triangle as $\gcd(a,b)=1$ and $\gcd(b,c)=1$. Also $c$ is a perfect square. We will call a right angled triangle pe...
<p>Consider the right angled triangle with sides $a=7$, $b=24$ and $c=25$. The area of this triangle is $84$, which is divisible by the perfect numbers $6$ and $28$.<br> Moreover it is a primitive right angled triangle as $\gcd(a,b)=1$ and $\gcd(b,c)=1$.<br> Also $c$ is a perfect square.</p> <p>We will call a right an...
https://projecteuler.net/problem=218
0
219
Let A and B be bit strings (sequences of 0's and 1's). If A is equal to the leftmost length(A) bits of B, then A is said to be a prefix of B. For example, 00110 is a prefix of 001101001, but not of 00111 or 100110. A prefix-free code of size n is a collection of n distinct bit strings such that no string is a prefix...
<p>Let <span style="font-weight:bold;">A</span> and <span style="font-weight:bold;">B</span> be bit strings (sequences of 0's and 1's).<br> If <span style="font-weight:bold;">A</span> is equal to the <span style="text-decoration:underline;">left</span>most length(<span style="font-weight:bold;">A</span>) bits of <span ...
https://projecteuler.net/problem=219
64564225042
220
Let $D_0$ be the two-letter string "Fa". For $n\ge 1$, derive $D_n$ from $D_{n-1}$ by the string-rewriting rules: "a" → "aRbFR" "b" → "LFaLb" Thus, $D_0 = $ "Fa", $D_1 = $ "FaRbFR", $D_2 = $ "FaRbFRRLFaLbFR", and so on. These strings can be interpreted as instructions to a computer graphics program, with "F" meani...
<p>Let $D_0$ be the two-letter string "Fa". For $n\ge 1$, derive $D_n$ from $D_{n-1}$ by the string-rewriting rules:</p> <p style="margin-left:40px;">"a" → "aRbFR"<br> "b" → "LFaLb"</p> <p>Thus, $D_0 = $ "Fa", $D_1 = $ "FaRbFR", $D_2 = $ "FaRbFRRLFaLbFR", and so on.</p> <p>These strings can be interpreted as instru...
https://projecteuler.net/problem=220
139776,963904
221
We shall call a positive integer $A$ an "Alexandrian integer", if there exist integers $p, q, r$ such that: $$A = p \cdot q \cdot r$$ and $$\dfrac{1}{A} = \dfrac{1}{p} + \dfrac{1}{q} + \dfrac{1}{r}.$$ For example, $630$ is an Alexandrian integer ($p = 5, q = -7, r = -18$). In fact, $630$ is the $6$th Alexandrian inte...
<p>We shall call a positive integer $A$ an "Alexandrian integer", if there exist integers $p, q, r$ such that:</p> <p class="center">$$A = p \cdot q \cdot r$$ and $$\dfrac{1}{A} = \dfrac{1}{p} + \dfrac{1}{q} + \dfrac{1}{r}.$$</p> <p>For example, $630$ is an Alexandrian integer ($p = 5, q = -7, r = -18$). In fact, $63...
https://projecteuler.net/problem=221
1884161251122450
222
What is the length of the shortest pipe, of internal radius $\pu{50 mm}$, that can fully contain $21$ balls of radii $\pu{30 mm}, \pu{31 mm}, \dots, \pu{50 mm}$? Give your answer in micrometres ($\pu{10^{-6} m}$) rounded to the nearest integer.
<p>What is the length of the shortest pipe, of internal radius $\pu{50 mm}$, that can fully contain $21$ balls of radii $\pu{30 mm}, \pu{31 mm}, \dots, \pu{50 mm}$?</p> <p>Give your answer in micrometres ($\pu{10^{-6} m}$) rounded to the nearest integer.</p>
https://projecteuler.net/problem=222
1590933
223
Let us call an integer sided triangle with sides $a \le b \le c$ barely acute if the sides satisfy $a^2 + b^2 = c^2 + 1$. How many barely acute triangles are there with perimeter $\le 25\,000\,000$?
<p>Let us call an integer sided triangle with sides $a \le b \le c$ <dfn>barely acute</dfn> if the sides satisfy $a^2 + b^2 = c^2 + 1$.</p> <p>How many barely acute triangles are there with perimeter $\le 25\,000\,000$?</p>
https://projecteuler.net/problem=223
61614848
224
Let us call an integer sided triangle with sides $a \le b \le c$ barely obtuse if the sides satisfy $a^2 + b^2 = c^2 - 1$. How many barely obtuse triangles are there with perimeter $\le 75\,000\,000$?
<p>Let us call an integer sided triangle with sides $a \le b \le c$ <dfn>barely obtuse</dfn> if the sides satisfy <br>$a^2 + b^2 = c^2 - 1$.</p> <p>How many barely obtuse triangles are there with perimeter $\le 75\,000\,000$?</p>
https://projecteuler.net/problem=224
4137330
225
The sequence $1, 1, 1, 3, 5, 9, 17, 31, 57, 105, 193, 355, 653, 1201, \dots$ is defined by $T_1 = T_2 = T_3 = 1$ and $T_n = T_{n - 1} + T_{n - 2} + T_{n - 3}$. It can be shown that $27$ does not divide any terms of this sequence. In fact, $27$ is the first odd number with this property. Find the $124$th odd number t...
<p> The sequence $1, 1, 1, 3, 5, 9, 17, 31, 57, 105, 193, 355, 653, 1201, \dots$<br> is defined by $T_1 = T_2 = T_3 = 1$ and $T_n = T_{n - 1} + T_{n - 2} + T_{n - 3}$. </p> <p> It can be shown that $27$ does not divide any terms of this sequence.<br>In fact, $27$ is the first odd number with this property.</p> <p> Find...
https://projecteuler.net/problem=225
2009
226
The blancmange curve is the set of points $(x, y)$ such that $0 \le x \le 1$ and $y = \sum \limits_{n = 0}^{\infty} {\dfrac{s(2^n x)}{2^n}}$, where $s(x)$ is the distance from $x$ to the nearest integer. The area under the blancmange curve is equal to ½, shown in pink in the diagram below. Let $C$ be the circle with ...
<p>The <strong>blancmange curve</strong> is the set of points $(x, y)$ such that $0 \le x \le 1$ and $y = \sum \limits_{n = 0}^{\infty} {\dfrac{s(2^n x)}{2^n}}$, where $s(x)$ is the distance from $x$ to the nearest integer.</p> <p>The area under the blancmange curve is equal to ½, shown in pink in the diagram below.</...
https://projecteuler.net/problem=226
0.11316017
227
The Chase is a game played with two dice and an even number of players. The players sit around a table and the game begins with two opposite players having one die each. On each turn, the two players with a die roll it. If the player rolls 1, then the die passes to the neighbour on the left. If the player rolls 6, t...
<p><dfn>The Chase</dfn> is a game played with two dice and an even number of players.</p> <p>The players sit around a table and the game begins with two opposite players having one die each. On each turn, the two players with a die roll it.</p> <p>If the player rolls 1, then the die passes to the neighbour on the lef...
https://projecteuler.net/problem=227
3780.618622
228
Let $S_n$ be the regular $n$-sided polygon – or shape – whose vertices $v_k$ ($k = 1, 2, \dots, n$) have coordinates: $$\begin{align} x_k &= \cos((2k - 1)/n \times 180^\circ)\\ y_k &= \sin((2k - 1)/n \times 180^\circ) \end{align}$$ Each $S_n$ is to be interpreted as a filled shape consisting of all points on the per...
<p>Let $S_n$ be the regular $n$-sided polygon – or <dfn>shape</dfn> – whose vertices $v_k$ ($k = 1, 2, \dots, n$) have coordinates:</p> $$\begin{align} x_k &amp;= \cos((2k - 1)/n \times 180^\circ)\\ y_k &amp;= \sin((2k - 1)/n \times 180^\circ) \end{align}$$ <p>Each $S_n$ is to be interpreted as a filled shape consis...
https://projecteuler.net/problem=228
86226
229
Consider the number $3600$. It is very special, because $$\begin{alignat}{2} 3600 &= 48^2 + &&36^2\\ 3600 &= 20^2 + 2 \times &&40^2\\ 3600 &= 30^2 + 3 \times &&30^2\\ 3600 &= 45^2 + 7 \times &&15^2 \end{alignat}$$ Similarly, we find that $88201 = 99^2 + 280^2 = 287^2 + 2 \times 54^2 = 283^2 + 3 \times 52^2 = 197^2 + ...
<p>Consider the number $3600$. It is very special, because</p> $$\begin{alignat}{2} 3600 &amp;= 48^2 + &amp;&amp;36^2\\ 3600 &amp;= 20^2 + 2 \times &amp;&amp;40^2\\ 3600 &amp;= 30^2 + 3 \times &amp;&amp;30^2\\ 3600 &amp;= 45^2 + 7 \times &amp;&amp;15^2 \end{alignat}$$ <p>Similarly, we find that $88201 = 99^2 + 280^2 =...
https://projecteuler.net/problem=229
11325263
230
For any two strings of digits, $A$ and $B$, we define $F_{A, B}$ to be the sequence $(A,B,AB,BAB,ABBAB,\dots)$ in which each term is the concatenation of the previous two. Further, we define $D_{A, B}(n)$ to be the $n$th digit in the first term of $F_{A, B}$ that contains at least $n$ digits. Example: Let $A=1415926...
<p>For any two strings of digits, $A$ and $B$, we define $F_{A, B}$ to be the sequence $(A,B,AB,BAB,ABBAB,\dots)$ in which each term is the concatenation of the previous two.</p> <p>Further, we define $D_{A, B}(n)$ to be the $n$<sup>th</sup> digit in the first term of $F_{A, B}$ that contains at least $n$ digits.</p> ...
https://projecteuler.net/problem=230
850481152593119296
231
The binomial coefficient $\displaystyle \binom {10} 3 = 120$. $120 = 2^3 \times 3 \times 5 = 2 \times 2 \times 2 \times 3 \times 5$, and $2 + 2 + 2 + 3 + 5 = 14$. So the sum of the terms in the prime factorisation of $\displaystyle \binom {10} 3$ is $14$. Find the sum of the terms in the prime factorisation of $\dis...
<p>The binomial coefficient $\displaystyle \binom {10} 3 = 120$.<br> $120 = 2^3 \times 3 \times 5 = 2 \times 2 \times 2 \times 3 \times 5$, and $2 + 2 + 2 + 3 + 5 = 14$.<br> So the sum of the terms in the prime factorisation of $\displaystyle \binom {10} 3$ is $14$. <br><br> Find the sum of the terms in the prime facto...
https://projecteuler.net/problem=231
7526965179680
232
Two players share an unbiased coin and take it in turns to play The Race. On Player 1's turn, the coin is tossed once. If it comes up Heads, then Player 1 scores one point; if it comes up Tails, then no points are scored. On Player 2's turn, a positive integer, $T$, is chosen by Player 2 and the coin is tossed $T$ ti...
<p>Two players share an unbiased coin and take it in turns to play <dfn>The Race</dfn>.</p> <p>On Player 1's turn, the coin is tossed once. If it comes up Heads, then Player 1 scores one point; if it comes up Tails, then no points are scored.</p> <p>On Player 2's turn, a positive integer, $T$, is chosen by Player 2 a...
https://projecteuler.net/problem=232
0.83648556
233
Let $f(N)$ be the number of points with integer coordinates that are on a circle passing through $(0,0)$, $(N,0)$,$(0,N)$, and $(N,N)$. It can be shown that $f(10000) = 36$. What is the sum of all positive integers $N \le 10^{11}$ such that $f(N) = 420$?
<p>Let $f(N)$ be the number of points with integer coordinates that are on a circle passing through $(0,0)$, $(N,0)$,$(0,N)$, and $(N,N)$.</p> <p>It can be shown that $f(10000) = 36$.</p> <p>What is the sum of all positive integers $N \le 10^{11}$ such that $f(N) = 420$?</p>
https://projecteuler.net/problem=233
271204031455541309
234
For an integer $n \ge 4$, we define the lower prime square root of $n$, denoted by $\operatorname{lps}(n)$, as the largest prime $\le \sqrt n$ and the upper prime square root of $n$, $\operatorname{ups}(n)$, as the smallest prime $\ge \sqrt n$. So, for example, $\operatorname{lps}(4) = 2 = \operatorname{ups}(4)$, $\op...
<p>For an integer $n \ge 4$, we define the <dfn>lower prime square root</dfn> of $n$, denoted by $\operatorname{lps}(n)$, as the largest prime $\le \sqrt n$ and the <dfn>upper prime square root</dfn> of $n$, $\operatorname{ups}(n)$, as the smallest prime $\ge \sqrt n$.</p> <p>So, for example, $\operatorname{lps}(4) = 2...
https://projecteuler.net/problem=234
1259187438574927161
235
Given is the arithmetic-geometric sequence $u(k) = (900-3k)r^{k - 1}$. Let $s(n) = \sum_{k = 1}^n u(k)$. Find the value of $r$ for which $s(5000) = -600\,000\,000\,000$. Give your answer rounded to $12$ places behind the decimal point.
<p> Given is the arithmetic-geometric sequence $u(k) = (900-3k)r^{k - 1}$.<br> Let $s(n) = \sum_{k = 1}^n u(k)$. </p> <p> Find the value of $r$ for which $s(5000) = -600\,000\,000\,000$. </p> <p> Give your answer rounded to $12$ places behind the decimal point. </p>
https://projecteuler.net/problem=235
1.002322108633
236
Suppliers 'A' and 'B' provided the following numbers of products for the luxury hamper market: | Product | 'A' | 'B' | | --- | --- | --- | | Beluga Caviar | 5248 | 640 | | Christmas Cake | 1312 | 1888 | | Gammon Joint | 2624 | 3776 | | Vintage Port | 5760 | 3776 | | Champagne Truffles | 3936 | 5664 | Although the sup...
<p>Suppliers 'A' and 'B' provided the following numbers of products for the luxury hamper market:</p> <p></p><center><table class="p236"><tr><th>Product</th><th class="center">'A'</th><th class="center">'B'</th></tr><tr><td>Beluga Caviar</td><td>5248</td><td>640</td></tr><tr><td>Christmas Cake</td><td>1312</td><td>188...
https://projecteuler.net/problem=236
123/59
237
Let $T(n)$ be the number of tours over a $4 \times n$ playing board such that: - The tour starts in the top left corner. - The tour consists of moves that are up, down, left, or right one square. - The tour visits each square exactly once. - The tour ends in the bottom left corner. The diagram shows one tour over ...
<p>Let $T(n)$ be the number of tours over a $4 \times n$ playing board such that:</p> <ul><li>The tour starts in the top left corner.</li> <li>The tour consists of moves that are up, down, left, or right one square.</li> <li>The tour visits each square exactly once.</li> <li>The tour ends in the bottom left corner.</li...
https://projecteuler.net/problem=237
15836928
238
Create a sequence of numbers using the "Blum Blum Shub" pseudo-random number generator: $$\begin{align} s_0 &= 14025256\\ s_{n + 1} &= s_n^2 \bmod 20300713 \end{align}$$ Concatenate these numbers $s_0s_1s_2\cdots$ to create a string $w$ of infinite length. Then, $w = {\color{blue}14025256741014958470038053646\cdots}...
<p>Create a sequence of numbers using the "Blum Blum Shub" pseudo-random number generator:</p> $$\begin{align} s_0 &amp;= 14025256\\ s_{n + 1} &amp;= s_n^2 \bmod 20300713 \end{align}$$ <p>Concatenate these numbers $s_0s_1s_2\cdots$ to create a string $w$ of infinite length.<br> Then, $w = {\color{blue}140252567410149...
https://projecteuler.net/problem=238
9922545104535661
239
A set of disks numbered $1$ through $100$ are placed in a line in random order. What is the probability that we have a partial derangement such that exactly $22$ prime number discs are found away from their natural positions? (Any number of non-prime disks may also be found in or out of their natural positions.) Giv...
<p>A set of disks numbered $1$ through $100$ are placed in a line in random order.</p> <p>What is the probability that we have a partial derangement such that exactly $22$ prime number discs are found away from their natural positions?<br> (Any number of non-prime disks may also be found in or out of their natural pos...
https://projecteuler.net/problem=239
0.001887854841
240
There are $1111$ ways in which five $6$-sided dice (sides numbered $1$ to $6$) can be rolled so that the top three sum to $15$. Some examples are: $D_1,D_2,D_3,D_4,D_5 = 4,3,6,3,5$ $D_1,D_2,D_3,D_4,D_5 = 4,3,3,5,6$ $D_1,D_2,D_3,D_4,D_5 = 3,3,3,6,6$ $D_1,D_2,D_3,D_4,D_5 = 6,6,3,3,3$ In how many ways can twenty $12$...
<p>There are $1111$ ways in which five $6$-sided dice (sides numbered $1$ to $6$) can be rolled so that the top three sum to $15$. Some examples are: <br><br> $D_1,D_2,D_3,D_4,D_5 = 4,3,6,3,5$ <br> $D_1,D_2,D_3,D_4,D_5 = 4,3,3,5,6$ <br> $D_1,D_2,D_3,D_4,D_5 = 3,3,3,6,6$ <br> $D_1,D_2,D_3,D_4,D_5 = 6,6,3,3,3$ <br><br> ...
https://projecteuler.net/problem=240
7448717393364181966
241
For a positive integer $n$, let $\sigma(n)$ be the sum of all divisors of $n$. For example, $\sigma(6) = 1 + 2 + 3 + 6 = 12$. A perfect number, as you probably know, is a number with $\sigma(n) = 2n$. Let us define the perfection quotient of a positive integer as $p(n) = \dfrac{\sigma(n)}{n}$. Find the sum of all po...
<p>For a positive integer $n$, let $\sigma(n)$ be the sum of all divisors of $n$. For example, $\sigma(6) = 1 + 2 + 3 + 6 = 12$.</p> <p>A perfect number, as you probably know, is a number with $\sigma(n) = 2n$.</p> <p>Let us define the <b>perfection quotient</b> of a positive integer as $p(n) = \dfrac{\sigma(n)}{n}$....
https://projecteuler.net/problem=241
482316491800641154
242
Given the set $\{1,2,\dots,n\}$, we define $f(n, k)$ as the number of its $k$-element subsets with an odd sum of elements. For example, $f(5,3) = 4$, since the set $\{1,2,3,4,5\}$ has four $3$-element subsets having an odd sum of elements, i.e.: $\{1,2,4\}$, $\{1,3,5\}$, $\{2,3,4\}$ and $\{2,4,5\}$. When all three val...
<p>Given the set $\{1,2,\dots,n\}$, we define $f(n, k)$ as the number of its $k$-element subsets with an odd sum of elements. For example, $f(5,3) = 4$, since the set $\{1,2,3,4,5\}$ has four $3$-element subsets having an odd sum of elements, i.e.: $\{1,2,4\}$, $\{1,3,5\}$, $\{2,3,4\}$ and $\{2,4,5\}$.</p> <p>When all...
https://projecteuler.net/problem=242
997104142249036713
243
A positive fraction whose numerator is less than its denominator is called a proper fraction. For any denominator, $d$, there will be $d - 1$ proper fractions; for example, with $d = 12$: $1 / 12, 2 / 12, 3 / 12, 4 / 12, 5 / 12, 6 / 12, 7 / 12, 8 / 12, 9 / 12, 10 / 12, 11 / 12$. We shall call a fraction that cannot b...
<p>A positive fraction whose numerator is less than its denominator is called a proper fraction.<br> For any denominator, $d$, there will be $d - 1$ proper fractions; for example, with $d = 12$:<br>$1 / 12, 2 / 12, 3 / 12, 4 / 12, 5 / 12, 6 / 12, 7 / 12, 8 / 12, 9 / 12, 10 / 12, 11 / 12$. </p> <p>We shall call a fract...
https://projecteuler.net/problem=243
892371480
244
You probably know the game Fifteen Puzzle. Here, instead of numbered tiles, we have seven red tiles and eight blue tiles. A move is denoted by the uppercase initial of the direction (Left, Right, Up, Down) in which the tile is slid, e.g. starting from configuration (S), by the sequence LULUR we reach the configuration...
<p>You probably know the game <strong>Fifteen Puzzle</strong>. Here, instead of numbered tiles, we have seven red tiles and eight blue tiles.</p> <p>A move is denoted by the uppercase initial of the direction (Left, Right, Up, Down) in which the tile is slid, e.g. starting from configuration (<b>S</b>), by the sequence...
https://projecteuler.net/problem=244
96356848
245
We shall call a fraction that cannot be cancelled down a resilient fraction. Furthermore we shall define the resilience of a denominator, $R(d)$, to be the ratio of its proper fractions that are resilient; for example, $R(12) = \dfrac{4}{11}$. The resilience of a number $d \gt 1$ is then $\dfrac{\varphi(d)}{d - 1}$, w...
<p>We shall call a fraction that cannot be cancelled down a resilient fraction.<br> Furthermore we shall define the resilience of a denominator, $R(d)$, to be the ratio of its proper fractions that are resilient; for example, $R(12) = \dfrac{4}{11}$.</p> <p>The resilience of a number $d \gt 1$ is then $\dfrac{\varphi(...
https://projecteuler.net/problem=245
288084712410001
246
A definition for an ellipse is: Given a circle $c$ with centre $M$ and radius $r$ and a point $G$ such that $d(G,M) \lt r$, the locus of the points that are equidistant from $c$ and $G$ form an ellipse. The construction of the points of the ellipse is shown below. Given are the points $M(-2000,1500)$ and $G(8000,150...
<p> A definition for an ellipse is:<br> Given a circle $c$ with centre $M$ and radius $r$ and a point $G$ such that $d(G,M) \lt r$, the locus of the points that are equidistant from $c$ and $G$ form an ellipse. </p> The construction of the points of the ellipse is shown below. <div class="center"> <img src="resources/...
https://projecteuler.net/problem=246
810834388
247
Consider the region constrained by $1 \le x$ and $0 \le y \le 1/x$. Let $S_1$ be the largest square that can fit under the curve. Let $S_2$ be the largest square that fits in the remaining area, and so on. Let the index of $S_n$ be the pair $(\text{left}, \text{below})$ indicating the number of squares to the left o...
<p>Consider the region constrained by $1 \le x$ and $0 \le y \le 1/x$. </p><p> Let $S_1$ be the largest square that can fit under the curve.<br> Let $S_2$ be the largest square that fits in the remaining area, and so on. <br> Let the <dfn>index</dfn> of $S_n$ be the pair $(\text{left}, \text{below})$ indicating the num...
https://projecteuler.net/problem=247
782252
248
The first number $n$ for which $\phi(n)=13!$ is $6227180929$. Find the $150\,000$th such number.
<p>The first number $n$ for which $\phi(n)=13!$ is $6227180929$.</p> <p>Find the $150\,000$<sup>th</sup> such number.</p>
https://projecteuler.net/problem=248
23507044290
249
Let $S = \{2, 3, 5, \dots, 4999\}$ be the set of prime numbers less than $5000$. Find the number of subsets of $S$, the sum of whose elements is a prime number. Enter the rightmost $16$ digits as your answer.
<p>Let $S = \{2, 3, 5, \dots, 4999\}$ be the set of prime numbers less than $5000$.</p> <p>Find the number of subsets of $S$, the sum of whose elements is a prime number.<br> Enter the rightmost $16$ digits as your answer.</p>
https://projecteuler.net/problem=249
9275262564250418
250
Find the number of non-empty subsets of $\{1^1, 2^2, 3^3,\dots, 250250^{250250}\}$, the sum of whose elements is divisible by $250$. Enter the rightmost $16$ digits as your answer.
<p>Find the number of non-empty subsets of $\{1^1, 2^2, 3^3,\dots, 250250^{250250}\}$, the sum of whose elements is divisible by $250$. Enter the rightmost $16$ digits as your answer.</p>
https://projecteuler.net/problem=250
1425480602091519
251
A triplet of positive integers $(a, b, c)$ is called a Cardano Triplet if it satisfies the condition: $$\sqrt[3]{a + b \sqrt{c}} + \sqrt[3]{a - b \sqrt{c}} = 1$$ For example, $(2,1,5)$ is a Cardano Triplet. There exist $149$ Cardano Triplets for which $a + b + c \le 1000$. Find how many Cardano Triplets exist such ...
<p> A triplet of positive integers $(a, b, c)$ is called a Cardano Triplet if it satisfies the condition:</p> $$\sqrt[3]{a + b \sqrt{c}} + \sqrt[3]{a - b \sqrt{c}} = 1$$ <p> For example, $(2,1,5)$ is a Cardano Triplet. </p> <p> There exist $149$ Cardano Triplets for which $a + b + c \le 1000$. </p> <p> Find how many C...
https://projecteuler.net/problem=251
18946051
252
Given a set of points on a plane, we define a convex hole to be a convex polygon having as vertices any of the given points and not containing any of the given points in its interior (in addition to the vertices, other given points may lie on the perimeter of the polygon). As an example, the image below shows a set of...
<p> Given a set of points on a plane, we define a convex hole to be a convex polygon having as vertices any of the given points and not containing any of the given points in its interior (in addition to the vertices, other given points may lie on the perimeter of the polygon). </p> <p> As an example, the image below s...
https://projecteuler.net/problem=252
104924.0
253
A small child has a “number caterpillar” consisting of forty jigsaw pieces, each with one number on it, which, when connected together in a line, reveal the numbers $1$ to $40$ in order. Every night, the child's father has to pick up the pieces of the caterpillar that have been scattered across the play room. He picks...
<p>A small child has a “number caterpillar” consisting of forty jigsaw pieces, each with one number on it, which, when connected together in a line, reveal the numbers $1$ to $40$ in order.</p> <p>Every night, the child's father has to pick up the pieces of the caterpillar that have been scattered across the play room...
https://projecteuler.net/problem=253
11.492847
254
Define $f(n)$ as the sum of the factorials of the digits of $n$. For example, $f(342) = 3! + 4! + 2! = 32$. Define $sf(n)$ as the sum of the digits of $f(n)$. So $sf(342) = 3 + 2 = 5$. Define $g(i)$ to be the smallest positive integer $n$ such that $sf(n) = i$. Though $sf(342)$ is $5$, $sf(25)$ is also $5$, and it ca...
<p>Define $f(n)$ as the sum of the factorials of the digits of $n$. For example, $f(342) = 3! + 4! + 2! = 32$.</p> <p>Define $sf(n)$ as the sum of the digits of $f(n)$. So $sf(342) = 3 + 2 = 5$.</p> <p>Define $g(i)$ to be the smallest positive integer $n$ such that $sf(n) = i$. Though $sf(342)$ is $5$, $sf(25)$ is al...
https://projecteuler.net/problem=254
8184523820510
255
We define the rounded-square-root of a positive integer $n$ as the square root of $n$ rounded to the nearest integer. The following procedure (essentially Heron's method adapted to integer arithmetic) finds the rounded-square-root of $n$: Let $d$ be the number of digits of the number $n$. If $d$ is odd, set $x_0 = 2...
<p>We define the <dfn>rounded-square-root</dfn> of a positive integer $n$ as the square root of $n$ rounded to the nearest integer.</p> <p>The following procedure (essentially Heron's method adapted to integer arithmetic) finds the rounded-square-root of $n$:</p> <p>Let $d$ be the number of digits of the number $n$.<b...
https://projecteuler.net/problem=255
4.4474011180
256
Tatami are rectangular mats, used to completely cover the floor of a room, without overlap. Assuming that the only type of available tatami has dimensions $1 \times 2$, there are obviously some limitations for the shape and size of the rooms that can be covered. For this problem, we consider only rectangular rooms wi...
<p>Tatami are rectangular mats, used to completely cover the floor of a room, without overlap.</p> <p>Assuming that the only type of available tatami has dimensions $1 \times 2$, there are obviously some limitations for the shape and size of the rooms that can be covered.</p> <p>For this problem, we consider only rec...
https://projecteuler.net/problem=256
85765680
257
Given is an integer sided triangle $ABC$ with sides $a \le b \le c$. ($AB = c$, $BC = a$ and $AC = b$.) The angular bisectors of the triangle intersect the sides at points $E$, $F$ and $G$ (see picture below). The segments $EF$, $EG$ and $FG$ partition the triangle $ABC$ into four smaller triangles: $AEG$, $BFE$, $CG...
<p>Given is an integer sided triangle $ABC$ with sides $a \le b \le c$. ($AB = c$, $BC = a$ and $AC = b$.)<br> The angular bisectors of the triangle intersect the sides at points $E$, $F$ and $G$ (see picture below). </p> <div align="center"> <img src="resources/images/0257_bisector.gif?1678992056" class="dark_img" al...
https://projecteuler.net/problem=257
139012411
258
A sequence is defined as: - $g_k = 1$, for $0 \le k \le 1999$ - $g_k = g_{k-2000} + g_{k - 1999}$, for $k \ge 2000$. Find $g_k \bmod 20092010$ for $k = 10^{18}$.
<p>A sequence is defined as:</p> <p> </p><ul><li>$g_k = 1$, for $0 \le k \le 1999$</li> <li>$g_k = g_{k-2000} + g_{k - 1999}$, for $k \ge 2000$. </li></ul><p>Find $g_k \bmod 20092010$ for $k = 10^{18}$.</p>
https://projecteuler.net/problem=258
12747994
259
A positive integer will be called reachable if it can result from an arithmetic expression obeying the following rules: - Uses the digits $1$ through $9$, in that order and exactly once each. - Any successive digits can be concatenated (for example, using the digits $2$, $3$ and $4$ we obtain the number $234$). - On...
<p>A positive integer will be called <dfn>reachable</dfn> if it can result from an arithmetic expression obeying the following rules:</p> <ul><li>Uses the digits $1$ through $9$, in that order and exactly once each.</li> <li>Any successive digits can be concatenated (for example, using the digits $2$, $3$ and $4$ we o...
https://projecteuler.net/problem=259
20101196798
260
A game is played with three piles of stones and two players. On each player's turn, the player may remove one or more stones from the piles. However, if the player takes stones from more than one pile, then the same number of stones must be removed from each of the selected piles. In other words, the player chooses s...
<p>A game is played with three piles of stones and two players.<br> On each player's turn, the player may remove one or more stones from the piles. However, if the player takes stones from more than one pile, then the same number of stones must be removed from each of the selected piles.</p> <p>In other words, the pla...
https://projecteuler.net/problem=260
167542057
261
Let us call a positive integer $k$ a square-pivot, if there is a pair of integers $m \gt 0$ and $n \ge k$, such that the sum of the $(m+1)$ consecutive squares up to $k$ equals the sum of the $m$ consecutive squares from $(n+1)$ on: $$(k - m)^2 + \cdots + k^2 = (n + 1)^2 + \cdots + (n + m)^2.$$ Some small square-pivo...
<p>Let us call a positive integer $k$ a <dfn>square-pivot</dfn>, if there is a pair of integers $m \gt 0$ and $n \ge k$, such that the sum of the $(m+1)$ consecutive squares up to $k$ equals the sum of the $m$ consecutive squares from $(n+1)$ on:</p> $$(k - m)^2 + \cdots + k^2 = (n + 1)^2 + \cdots + (n + m)^2.$$ <p>So...
https://projecteuler.net/problem=261
238890850232021
262
The following equation represents the continuous topography of a mountainous region, giving the elevationheight above sea level $h$ at any point $(x, y)$: $$h = \left(5000 - \frac{x^2 + y^2 + xy}{200} + \frac{25(x + y)}2\right) \cdot e^{-\left|\frac{x^2 + y^2}{1000000} - \frac{3(x + y)}{2000} + \frac 7 {10}\right|}.$$ ...
<p>The following equation represents the <i>continuous</i> topography of a mountainous region, giving the <strong class="tooltip">elevation<span class="tooltiptext">height above sea level</span></strong> $h$ at any point $(x, y)$: $$h = \left(5000 - \frac{x^2 + y^2 + xy}{200} + \frac{25(x + y)}2\right) \cdot e^{-\left|...
https://projecteuler.net/problem=262
2531.205
263
Consider the number $6$. The divisors of $6$ are: $1,2,3$ and $6$. Every number from $1$ up to and including $6$ can be written as a sum of distinct divisors of $6$: $1=1$, $2=2$, $3=1+2$, $4=1+3$, $5=2+3$, $6=6$. A number $n$ is called a practical number if every number from $1$ up to and including $n$ can be expre...
<p> Consider the number $6$. The divisors of $6$ are: $1,2,3$ and $6$.<br> Every number from $1$ up to and including $6$ can be written as a sum of distinct divisors of $6$:<br> $1=1$, $2=2$, $3=1+2$, $4=1+3$, $5=2+3$, $6=6$.<br> A number $n$ is called a practical number if every number from $1$ up to and including $n$...
https://projecteuler.net/problem=263
2039506520
264
Consider all the triangles having: - All their vertices on lattice pointsInteger coordinates. - CircumcentreCentre of the circumscribed circle at the origin $O$. - OrthocentrePoint where the three altitudes meet at the point $H(5, 0)$. There are nine such triangles having a perimeter $\le 50$. Listed and shown in ...
<p>Consider all the triangles having: </p><ul><li>All their vertices on <strong class="tooltip">lattice points<span class="tooltiptext">Integer coordinates</span></strong>.</li> <li><strong class="tooltip">Circumcentre<span class="tooltiptext">Centre of the circumscribed circle</span></strong> at the origin $O$.</li> <...
https://projecteuler.net/problem=264
2816417.1055
265
$2^N$ binary digits can be placed in a circle so that all the $N$-digit clockwise subsequences are distinct. For $N=3$, two such circular arrangements are possible, ignoring rotations: For the first arrangement, the $3$-digit subsequences, in clockwise order, are: $000$, $001$, $010$, $101$, $011$, $111$, $110$ and $...
<p>$2^N$ binary digits can be placed in a circle so that all the $N$-digit clockwise subsequences are distinct.</p> <p>For $N=3$, two such circular arrangements are possible, ignoring rotations:</p> <div align="center"><img src="resources/images/0265_BinaryCircles.gif?1678992056" class="dark_img" alt="0265_BinaryCircl...
https://projecteuler.net/problem=265
209110240768
266
The divisors of $12$ are: $1,2,3,4,6$ and $12$. The largest divisor of $12$ that does not exceed the square root of $12$ is $3$. We shall call the largest divisor of an integer $n$ that does not exceed the square root of $n$ the pseudo square root ($\operatorname{PSR}$) of $n$. It can be seen that $\operatorname{PSR...
<p> The divisors of $12$ are: $1,2,3,4,6$ and $12$.<br> The largest divisor of $12$ that does not exceed the square root of $12$ is $3$.<br> We shall call the largest divisor of an integer $n$ that does not exceed the square root of $n$ the pseudo square root ($\operatorname{PSR}$) of $n$.<br> It can be seen that $\ope...
https://projecteuler.net/problem=266
1096883702440585
267
You are given a unique investment opportunity. Starting with £1 of capital, you can choose a fixed proportion, f, of your capital to bet on a fair coin toss repeatedly for 1000 tosses. Your return is double your bet for heads and you lose your bet for tails. For example, if f = 1/4, for the first toss you bet £0.25...
<p>You are given a unique investment opportunity.</p> <p>Starting with £1 of capital, you can choose a fixed proportion, <var>f</var>, of your capital to bet on a fair coin toss repeatedly for 1000 tosses.</p> <p>Your return is double your bet for heads and you lose your bet for tails.</p> <p>For example, if <var>f</va...
https://projecteuler.net/problem=267
0.999992836187
268
It can be verified that there are $23$ positive integers less than $1000$ that are divisible by at least four distinct primes less than $100$. Find how many positive integers less than $10^{16}$ are divisible by at least four distinct primes less than $100$.
<p>It can be verified that there are $23$ positive integers less than $1000$ that are divisible by at least four distinct primes less than $100$.</p> <p>Find how many positive integers less than $10^{16}$ are divisible by at least four distinct primes less than $100$.</p>
https://projecteuler.net/problem=268
785478606870985
269
A root or zero of a polynomial $P(x)$ is a solution to the equation $P(x) = 0$. Define $P_n$ as the polynomial whose coefficients are the digits of $n$. For example, $P_{5703}(x) = 5x^3 + 7x^2 + 3$. We can see that: - $P_n(0)$ is the last digit of $n$, - $P_n(1)$ is the sum of the digits of $n$, - $P_n(10)$ is $n...
<p>A root or zero of a polynomial $P(x)$ is a solution to the equation $P(x) = 0$. <br> Define $P_n$ as the polynomial whose coefficients are the digits of $n$.<br> For example, $P_{5703}(x) = 5x^3 + 7x^2 + 3$.</p> <p>We can see that:</p><ul><li>$P_n(0)$ is the last digit of $n$,</li> <li>$P_n(1)$ is the sum of the di...
https://projecteuler.net/problem=269
1311109198529286
270
A square piece of paper with integer dimensions $N \times N$ is placed with a corner at the origin and two of its sides along the $x$- and $y$-axes. Then, we cut it up respecting the following rules: - We only make straight cuts between two points lying on different sides of the square, and having integer coordinates....
<p>A square piece of paper with integer dimensions $N \times N$ is placed with a corner at the origin and two of its sides along the $x$- and $y$-axes. Then, we cut it up respecting the following rules: </p><ul><li>We only make straight cuts between two points lying on different sides of the square, and having integer ...
https://projecteuler.net/problem=270
82282080
271
For a positive number $n$, define $S(n)$ as the sum of the integers $x$, for which $1 \lt x \lt n$ and $x^3 \equiv 1 \bmod n$. When $n=91$, there are $8$ possible values for $x$, namely: $9, 16, 22, 29, 53, 74, 79, 81$. Thus, $S(91)=9+16+22+29+53+74+79+81=363$. Find $S(13082761331670030)$.
<p> For a positive number $n$, define $S(n)$ as the sum of the integers $x$, for which $1 \lt x \lt n$ and<br>$x^3 \equiv 1 \bmod n$. </p> <p> When $n=91$, there are $8$ possible values for $x$, namely: $9, 16, 22, 29, 53, 74, 79, 81$.<br> Thus, $S(91)=9+16+22+29+53+74+79+81=363$.</p> <p> Find $S(13082761331670030)$. <...
https://projecteuler.net/problem=271
4617456485273129588
272
For a positive number $n$, define $C(n)$ as the number of the integers $x$, for which $1 \lt x \lt n$ and $x^3 \equiv 1 \bmod n$. When $n=91$, there are $8$ possible values for $x$, namely: $9, 16, 22, 29, 53, 74, 79, 81$. Thus, $C(91)=8$. Find the sum of the positive numbers $n \le 10^{11}$ for which $C(n)=242$.
<p> For a positive number $n$, define $C(n)$ as the number of the integers $x$, for which $1 \lt x \lt n$ and<br>$x^3 \equiv 1 \bmod n$. </p> <p> When $n=91$, there are $8$ possible values for $x$, namely: $9, 16, 22, 29, 53, 74, 79, 81$.<br> Thus, $C(91)=8$.</p> <p> Find the sum of the positive numbers $n \le 10^{11}$...
https://projecteuler.net/problem=272
8495585919506151122
273
Consider equations of the form: $a^2 + b^2 = N$, $0 \le a \le b$, $a$, $b$ and $N$ integer. For $N=65$ there are two solutions: $a=1$, $b=8$ and $a=4$, $b=7$. We call $S(N)$ the sum of the values of $a$ of all solutions of $a^2 + b^2 = N$, $0 \le a \le b$, $a$, $b$ and $N$ integer. Thus $S(65) = 1 + 4 = 5$. Find $...
<p>Consider equations of the form: $a^2 + b^2 = N$, $0 \le a \le b$, $a$, $b$ and $N$ integer.</p> <p>For $N=65$ there are two solutions:</p> <p>$a=1$, $b=8$ and $a=4$, $b=7$.</p> <p>We call $S(N)$ the sum of the values of $a$ of all solutions of $a^2 + b^2 = N$, $0 \le a \le b$, $a$, $b$ and $N$ integer.</p> <p>Thus ...
https://projecteuler.net/problem=273
2032447591196869022
274
For each integer $p \gt 1$ coprime to $10$ there is a positive divisibility multiplier $m \lt p$ which preserves divisibility by $p$ for the following function on any positive integer, $n$: $f(n) = (\text{all but the last digit of }n) + (\text{the last digit of }n) \cdot m$. That is, if $m$ is the divisibility multip...
<p>For each integer $p \gt 1$ coprime to $10$ there is a positive <dfn>divisibility multiplier</dfn> $m \lt p$ which preserves divisibility by $p$ for the following function on any positive integer, $n$:</p> <p>$f(n) = (\text{all but the last digit of }n) + (\text{the last digit of }n) \cdot m$.</p> <p>That is, if $m...
https://projecteuler.net/problem=274
1601912348822
275
Let us define a balanced sculpture of order $n$ as follows: - A polyominoAn arrangement of identical squares connected through shared edges; holes are allowed. made up of $n + 1$ tiles known as the blocks ($n$ tiles) and the plinth (remaining tile); - the plinth has its centre at position ($x = 0, y = 0$); - the blo...
<p>Let us define a <dfn>balanced sculpture</dfn> of order $n$ as follows: </p><ul><li>A <strong class="tooltip">polyomino<span class="tooltiptext">An arrangement of identical squares connected through shared edges; holes are allowed.</span></strong> made up of $n + 1$ tiles known as the <dfn>blocks</dfn> ($n$ tiles)<br...
https://projecteuler.net/problem=275
15030564
276
Consider the triangles with integer sides $a$, $b$ and $c$ with $a \le b \le c$. An integer sided triangle $(a,b,c)$ is called primitive if $\gcd(a, b, c)$$\gcd(a,b,c)=\gcd(a,\gcd(b,c))$$=1$. How many primitive integer sided triangles exist with a perimeter not exceeding $10\,000\,000$?
<p>Consider the triangles with integer sides $a$, $b$ and $c$ with $a \le b \le c$.<br> An integer sided triangle $(a,b,c)$ is called primitive if <strong class="tooltip">$\gcd(a, b, c)$<span class="tooltiptext">$\gcd(a,b,c)=\gcd(a,\gcd(b,c))$</span></strong>$=1$. <br> How many primitive integer sided triangles exist w...
https://projecteuler.net/problem=276
5777137137739632912
277
A modified Collatz sequence of integers is obtained from a starting value $a_1$ in the following way: $a_{n+1} = \, \,\, \frac {a_n} 3 \quad$ if $a_n$ is divisible by $3$. We shall denote this as a large downward step, "D". $a_{n+1} = \frac {4 a_n+2} 3 \, \,$ if $a_n$ divided by $3$ gives a remainder of $1$. We shall...
<p> A modified Collatz sequence of integers is obtained from a starting value $a_1$ in the following way:</p> <p> $a_{n+1} = \, \,\, \frac {a_n} 3 \quad$ if $a_n$ is divisible by $3$. We shall denote this as a large downward step, "D".</p> <p> $a_{n+1} = \frac {4 a_n+2} 3 \, \,$ if $a_n$ divided by $3$ gives a remainde...
https://projecteuler.net/problem=277
1125977393124310
278
Given the values of integers $1 < a_1 < a_2 < \dots < a_n$, consider the linear combination $q_1 a_1+q_2 a_2 + \dots + q_n a_n=b$, using only integer values $q_k \ge 0$. Note that for a given set of $a_k$, it may be that not all values of $b$ are possible. For instance, if $a_1=5$ and $a_2=7$, there are no $q_1 \ge ...
<p> Given the values of integers $1 &lt; a_1 &lt; a_2 &lt; \dots &lt; a_n$, consider the linear combination<br> $q_1 a_1+q_2 a_2 + \dots + q_n a_n=b$, using only integer values $q_k \ge 0$. </p> <p> Note that for a given set of $a_k$, it may be that not all values of $b$ are possible.<br> For instance, if $a_1=5$ and ...
https://projecteuler.net/problem=278
1228215747273908452
279
How many triangles are there with integral sides, at least one integral angle (measured in degrees), and a perimeter that does not exceed $10^8$?
<p> How many triangles are there with integral sides, at least one integral angle (measured in degrees), and a perimeter that does not exceed $10^8$? </p>
https://projecteuler.net/problem=279
416577688
280
A laborious ant walks randomly on a $5 \times 5$ grid. The walk starts from the central square. At each step, the ant moves to an adjacent square at random, without leaving the grid; thus there are $2$, $3$ or $4$ possible moves at each step depending on the ant's position. At the start of the walk, a seed is placed o...
<p>A laborious ant walks randomly on a $5 \times 5$ grid. The walk starts from the central square. At each step, the ant moves to an adjacent square at random, without leaving the grid; thus there are $2$, $3$ or $4$ possible moves at each step depending on the ant's position.</p> <p>At the start of the walk, a seed i...
https://projecteuler.net/problem=280
430.088247
281
You are given a pizza (perfect circle) that has been cut into $m \cdot n$ equal pieces and you want to have exactly one topping on each slice. Let $f(m, n)$ denote the number of ways you can have toppings on the pizza with $m$ different toppings ($m \ge 2$), using each topping on exactly $n$ slices ($n \ge 1$). Reflec...
<p>You are given a pizza (perfect circle) that has been cut into $m \cdot n$ equal pieces and you want to have exactly one topping on each slice.</p> <p>Let $f(m, n)$ denote the number of ways you can have toppings on the pizza with $m$ different toppings ($m \ge 2$), using each topping on exactly $n$ slices ($n \ge 1...
https://projecteuler.net/problem=281
1485776387445623
282
$\def\htmltext#1{\style{font-family:inherit;}{\text{#1}}}$ For non-negative integers $m$, $n$, the Ackermann function $A(m,n)$ is defined as follows: $$ A(m,n) = \cases{ n+1 &$\htmltext{ if }m=0$\cr A(m-1,1) &$\htmltext{ if }m>0 \htmltext{ and } n=0$\cr A(m-1,A(m,n-1)) &$\htmltext{ if }m>0 \htmltext{ and } n...
$\def\htmltext#1{\style{font-family:inherit;}{\text{#1}}}$ <p> For non-negative integers $m$, $n$, the Ackermann function $A(m,n)$ is defined as follows: $$ A(m,n) = \cases{ n+1 &amp;$\htmltext{ if }m=0$\cr A(m-1,1) &amp;$\htmltext{ if }m&gt;0 \htmltext{ and } n=0$\cr A(m-1,A(m,n-1)) &amp;$\htmltext{ if }m&gt;0...
https://projecteuler.net/problem=282
1098988351
283
Consider the triangle with sides $6$, $8$, and $10$. It can be seen that the perimeter and the area are both equal to $24$. So the area/perimeter ratio is equal to $1$. Consider also the triangle with sides $13$, $14$ and $15$. The perimeter equals $42$ while the area is equal to $84$. So for this triangle the area/pe...
<p> Consider the triangle with sides $6$, $8$, and $10$. It can be seen that the perimeter and the area are both equal to $24$. So the area/perimeter ratio is equal to $1$.<br> Consider also the triangle with sides $13$, $14$ and $15$. The perimeter equals $42$ while the area is equal to $84$. So for this triangle th...
https://projecteuler.net/problem=283
28038042525570324
284
The 3-digit number 376 in the decimal numbering system is an example of numbers with the special property that its square ends with the same digits: 3762 = 141376. Let's call a number with this property a steady square. Steady squares can also be observed in other numbering systems. In the base 14 numbering system, th...
<p>The 3-digit number 376 in the decimal numbering system is an example of numbers with the special property that its square ends with the same digits: 376<sup>2</sup> = 141376. Let's call a number with this property a steady square.</p> <p>Steady squares can also be observed in other numbering systems. In the base 14...
https://projecteuler.net/problem=284
5a411d7b
285
Albert chooses a positive integer $k$, then two real numbers $a, b$ are randomly chosen in the interval $[0,1]$ with uniform distribution. The square root of the sum $(k \cdot a + 1)^2 + (k \cdot b + 1)^2$ is then computed and rounded to the nearest integer. If the result is equal to $k$, he scores $k$ points; otherwi...
<p>Albert chooses a positive integer $k$, then two real numbers $a, b$ are randomly chosen in the interval $[0,1]$ with uniform distribution.<br> The square root of the sum $(k \cdot a + 1)^2 + (k \cdot b + 1)^2$ is then computed and rounded to the nearest integer. If the result is equal to $k$, he scores $k$ points; o...
https://projecteuler.net/problem=285
157055.80999
286
Barbara is a mathematician and a basketball player. She has found that the probability of scoring a point when shooting from a distance $x$ is exactly $(1 - x / q)$, where $q$ is a real constant greater than $50$. During each practice run, she takes shots from distances $x = 1, x = 2, \dots, x = 50$ and, according to ...
<p>Barbara is a mathematician and a basketball player. She has found that the probability of scoring a point when shooting from a distance $x$ is exactly $(1 - x / q)$, where $q$ is a real constant greater than $50$.</p> <p>During each practice run, she takes shots from distances $x = 1, x = 2, \dots, x = 50$ and, acc...
https://projecteuler.net/problem=286
52.6494571953
287
The quadtree encoding allows us to describe a $2^N \times 2^N$ black and white image as a sequence of bits (0 and 1). Those sequences are to be read from left to right like this: - the first bit deals with the complete $2^N \times 2^N$ region; - "0" denotes a split: the current $2^n \times 2^n$ region is divided in...
<p>The quadtree encoding allows us to describe a $2^N \times 2^N$ black and white image as a sequence of bits (0 and 1). Those sequences are to be read from left to right like this: </p><ul><li>the first bit deals with the complete $2^N \times 2^N$ region;</li> <li>"0" denotes a split: <br>the current $2^n \times 2^n$...
https://projecteuler.net/problem=287
313135496
288
For any prime $p$ the number $N(p, q)$ is defined by $N(p, q) = \sum_{n = 0}^q T_n \cdot p^n$ with $T_n$ generated by the following random number generator: $S_0 = 290797$ $S_{n + 1} = S_n^2 \bmod 50515093$ $T_n = S_n \bmod p$ Let $\operatorname{Nfac}(p, q)$ be the factorial of $N(p, q)$. Let $\operatorname{NF}(p...
<p> For any prime $p$ the number $N(p, q)$ is defined by $N(p, q) = \sum_{n = 0}^q T_n \cdot p^n$<br> with $T_n$ generated by the following random number generator:</p> <p> $S_0 = 290797$<br> $S_{n + 1} = S_n^2 \bmod 50515093$<br> $T_n = S_n \bmod p$ </p> <p> Let $\operatorname{Nfac}(p, q)$ be the factorial of $N(p, q)...
https://projecteuler.net/problem=288
605857431263981935
289
Let $C(x, y)$ be a circle passing through the points $(x, y)$, $(x, y + 1)$, $(x + 1, y)$ and $(x + 1, y + 1)$. For positive integers $m$ and $n$, let $E(m, n)$ be a configuration which consists of the $m \cdot n$ circles: $\{ C(x, y): 0 \le x \lt m, 0 \le y \lt n, x \text{ and } y \text{ are integers} \}$. An Euler...
<p>Let $C(x, y)$ be a circle passing through the points $(x, y)$, $(x, y + 1)$, $(x + 1, y)$ and $(x + 1, y + 1)$.</p> <p>For positive integers $m$ and $n$, let $E(m, n)$ be a configuration which consists of the $m \cdot n$ circles:<br> $\{ C(x, y): 0 \le x \lt m, 0 \le y \lt n, x \text{ and } y \text{ are integers} \...
https://projecteuler.net/problem=289
6567944538
290
How many integers $0 \le n \lt 10^{18}$ have the property that the sum of the digits of $n$ equals the sum of digits of $137n$?
<p> How many integers $0 \le n \lt 10^{18}$ have the property that the sum of the digits of $n$ equals the sum of digits of $137n$? </p>
https://projecteuler.net/problem=290
20444710234716473
291
A prime number $p$ is called a Panaitopol prime if $p = \dfrac{x^4 - y^4}{x^3 + y^3}$ for some positive integers $x$ and $y$. Find how many Panaitopol primes are less than $5 \times 10^{15}$.
<p> A prime number $p$ is called a Panaitopol prime if $p = \dfrac{x^4 - y^4}{x^3 + y^3}$ for some positive integers $x$ and $y$.</p> <p> Find how many Panaitopol primes are less than $5 \times 10^{15}$. </p>
https://projecteuler.net/problem=291
4037526
292
We shall define a pythagorean polygon to be a convex polygon with the following properties: - there are at least three vertices, - no three vertices are aligned, - each vertex has integer coordinates, - each edge has integer length. For a given integer $n$, define $P(n)$ as the number of distinct pythagorean poly...
<p>We shall define a <dfn>pythagorean polygon</dfn> to be a <strong>convex polygon</strong> with the following properties:<br></p><ul><li>there are at least three vertices,</li> <li>no three vertices are aligned,</li> <li>each vertex has <b>integer coordinates</b>,</li> <li>each edge has <b>integer length</b>.</li></u...
https://projecteuler.net/problem=292
3600060866
293
An even positive integer $N$ will be called admissible, if it is a power of $2$ or its distinct prime factors are consecutive primes. The first twelve admissible numbers are $2,4,6,8,12,16,18,24,30,32,36,48$. If $N$ is admissible, the smallest integer $M \gt 1$ such that $N+M$ is prime, will be called the pseudo-Fort...
<p> An even positive integer $N$ will be called admissible, if it is a power of $2$ or its distinct prime factors are consecutive primes.<br> The first twelve admissible numbers are $2,4,6,8,12,16,18,24,30,32,36,48$. </p> <p> If $N$ is admissible, the smallest integer $M \gt 1$ such that $N+M$ is prime, will be called ...
https://projecteuler.net/problem=293
2209
294
For a positive integer $k$, define $d(k)$ as the sum of the digits of $k$ in its usual decimal representation. Thus $d(42) = 4+2 = 6$. For a positive integer $n$, define $S(n)$ as the number of positive integers $k \lt 10^n$ with the following properties : - $k$ is divisible by $23$ and - $d(k) = 23$. You are given...
<p> For a positive integer $k$, define $d(k)$ as the sum of the digits of $k$ in its usual decimal representation. Thus $d(42) = 4+2 = 6$. </p> <p> For a positive integer $n$, define $S(n)$ as the number of positive integers $k \lt 10^n$ with the following properties : </p><ul><li>$k$ is divisible by $23$ and </li><li>...
https://projecteuler.net/problem=294
789184709
295
We call the convex area enclosed by two circles a lenticular hole if: - The centres of both circles are on lattice points. - The two circles intersect at two distinct lattice points. - The interior of the convex area enclosed by both circles does not contain any lattice points. Consider the circles: $C_0$: $x^2 + ...
<p>We call the convex area enclosed by two circles a <dfn>lenticular hole</dfn> if: </p><ul><li>The centres of both circles are on lattice points.</li> <li>The two circles intersect at two distinct lattice points.</li> <li>The interior of the convex area enclosed by both circles does not contain any lattice points. </l...
https://projecteuler.net/problem=295
4884650818
296
Given is an integer sided triangle $ABC$ with $BC \le AC \le AB$. $k$ is the angular bisector of angle $ACB$. $m$ is the tangent at $C$ to the circumscribed circle of $ABC$. $n$ is a line parallel to $m$ through $B$. The intersection of $n$ and $k$ is called $E$. How many triangles $ABC$ with a perimeter not exceedin...
<p> Given is an integer sided triangle $ABC$ with $BC \le AC \le AB$.<br>$k$ is the angular bisector of angle $ACB$.<br>$m$ is the tangent at $C$ to the circumscribed circle of $ABC$.<br>$n$ is a line parallel to $m$ through $B$.<br> The intersection of $n$ and $k$ is called $E$. </p> <div align="center"><img src="reso...
https://projecteuler.net/problem=296
1137208419
297
Each new term in the Fibonacci sequence is generated by adding the previous two terms. Starting with $1$ and $2$, the first $10$ terms will be: $1, 2, 3, 5, 8, 13, 21, 34, 55, 89$. Every positive integer can be uniquely written as a sum of nonconsecutive terms of the Fibonacci sequence. For example, $100 = 3 + 8 + 89...
<p>Each new term in the Fibonacci sequence is generated by adding the previous two terms.<br> Starting with $1$ and $2$, the first $10$ terms will be: $1, 2, 3, 5, 8, 13, 21, 34, 55, 89$.</p> <p>Every positive integer can be uniquely written as a sum of nonconsecutive terms of the Fibonacci sequence. For example, $100...
https://projecteuler.net/problem=297
2252639041804718029
298
Larry and Robin play a memory game involving a sequence of random numbers between 1 and 10, inclusive, that are called out one at a time. Each player can remember up to 5 previous numbers. When the called number is in a player's memory, that player is awarded a point. If it's not, the player adds the called number to h...
<p>Larry and Robin play a memory game involving a sequence of random numbers between 1 and 10, inclusive, that are called out one at a time. Each player can remember up to 5 previous numbers. When the called number is in a player's memory, that player is awarded a point. If it's not, the player adds the called number t...
https://projecteuler.net/problem=298
1.76882294
299
Four points with integer coordinates are selected: $A(a, 0)$, $B(b, 0)$, $C(0, c)$ and $D(0, d)$, with $0 \lt a \lt b$ and $0 \lt c \lt d$. Point $P$, also with integer coordinates, is chosen on the line $AC$ so that the three triangles $ABP$, $CDP$ and $BDP$ are all similarHave equal angles. It is easy to prove that...
<p>Four points with integer coordinates are selected:<br>$A(a, 0)$, $B(b, 0)$, $C(0, c)$ and $D(0, d)$, with $0 \lt a \lt b$ and $0 \lt c \lt d$.<br> Point $P$, also with integer coordinates, is chosen on the line $AC$ so that the three triangles $ABP$, $CDP$ and $BDP$ are all <dfn class="tooltip">similar<span class="t...
https://projecteuler.net/problem=299
549936643
300
In a very simplified form, we can consider proteins as strings consisting of hydrophobic (H) and polar (P) elements, e.g. HHPPHHHPHHPH. For this problem, the orientation of a protein is important; e.g. HPP is considered distinct from PPH. Thus, there are $2^n$ distinct proteins consisting of $n$ elements. When one en...
<p>In a very simplified form, we can consider proteins as strings consisting of hydrophobic (H) and polar (P) elements, e.g. HHPPHHHPHHPH. <br> For this problem, the orientation of a protein is important; e.g. HPP is considered distinct from PPH. Thus, there are $2^n$ distinct proteins consisting of $n$ elements.</p> ...
https://projecteuler.net/problem=300
8.0540771484375