Project Euler Solutions

Project Euler — Problem 66 Solution

Prob­lem Con­sid­er qua­drat­ic Dio­phan­tine equa­tions of the form: x2 – Dy2 = 1 For exam­ple, when D=13, the min­i­mal solu­tion in x is 6492 – 13x1802 = 1. It can be assumed that there are no solu­tions in pos­i­tive inte­gers when D is square. By find­ing min­i­mal solu­tions in x for D = {2, 3, …

Project Euler — Prob­lem 66 Solu­tionRead More »

Project Euler — Problem 78 Solution

Prob­lem Let p(n) rep­re­sent the num­ber of dif­fer­ent ways in which n coins can be sep­a­rat­ed into piles. For exam­ple, five coins can sep­a­rat­ed into piles in exact­ly sev­en dif­fer­ent ways, so p(5)=7. OOOOO OOOO   O OOO   OO OOO   O   O OO   OO   O OO   O   O   O O   O   O   O   O Find the …

Project Euler — Prob­lem 78 Solu­tionRead More »

Project Euler — Problem 62 Solution

Prob­lem The cube, 41063625 (3453), can be per­mut­ed to pro­duce two oth­er cubes: 56623104 (3843) and 66430125 (4053). In fact, 41063625 is the small­est cube which has exact­ly three per­mu­ta­tions of its dig­its which are also cube. Find the small­est cube for which exact­ly five per­mu­ta­tions of its dig­its are cube. Solu­tion

Project Euler — Problem 112 Solution

Prob­lem Work­ing from left-to-right if no dig­it is exceed­ed by the dig­it to its left it is called an increas­ing num­ber; for exam­ple, 134468. Sim­i­lar­ly if no dig­it is exceed­ed by the dig­it to its right it is called a decreas­ing num­ber; for exam­ple, 66420. We shall call a pos­i­tive inte­ger that is nei­ther increas­ing …

Project Euler — Prob­lem 112 Solu­tionRead More »

Project Euler — Problem 51 Solution

Prob­lem By replac­ing the 1st dig­it of *3, it turns out that six of the nine pos­si­ble val­ues: 13, 23, 43, 53, 73, and 83, are all prime. By replac­ing the 3rd and 4th dig­its of 56**3 with the same dig­it, this 5-dig­it num­ber is the first exam­ple hav­ing sev­en primes among the ten gen­er­at­ed …

Project Euler — Prob­lem 51 Solu­tionRead More »

Project Euler — Problem 31 Solution

Prob­lem In Eng­land the cur­ren­cy is made up of pound, £, and pence, p, and there are eight coins in gen­er­al cir­cu­la­tion: 1p, 2p, 5p, 10p, 20p, 50p, £1 (100p) and £2 (200p). It is pos­si­ble to make £2 in the fol­low­ing way: 1x£1 + 1x50p + 2x20p + 1x5p + 1x2p + 3x1p How …

Project Euler — Prob­lem 31 Solu­tionRead More »

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.