Math Is Fun Forum

  Discussion about math, puzzles, games and fun.   Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °

You are not logged in.

#1 2024-05-12 23:30:19

Keep_Relentless
Member
From: Queensland, Australia
Registered: 2024-05-05
Posts: 61

Project Euler Problems 4-6

The first three problems were able to be solved on Excel without any coding. I'm going to keep going until I get stuck. The next three:

4. A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 * 99. Find the largest palindrome made from the product of two 3-digit numbers.

5. 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?

6. The sum of the squares of the first ten natural numbers is, 1^2 + 2^2 + ... + 10^2 = 385. The square of the sum of the first ten natural numbers is, (1 + 2 + ... + 10)^2 = 55^2 = 3025. Hence the difference between the sum of the squares of the first ten natural numbers and the square of the sum is 3025 - 385 = 2640. Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.

Problem 6 looked really easy so I solved it first.

By the way the website asks you not to post the answers. I'm just posting the problems here for extra motivation.


"The most incomprehensible thing about the world is that it is comprehensible." -Albert Einstein.

Offline

#2 2024-05-13 01:03:53

Keep_Relentless
Member
From: Queensland, Australia
Registered: 2024-05-05
Posts: 61

Re: Project Euler Problems 4-6

I did problem 5 with Excel too

Edit: Problem 4 as well.

Last edited by Keep_Relentless (2024-05-13 01:23:09)


"The most incomprehensible thing about the world is that it is comprehensible." -Albert Einstein.

Offline

#3 2024-05-13 23:57:43

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,884

Re: Project Euler Problems 4-6

Hi Keep_Relentless;

Sorry...I wasn't thinking and replied in the 1-3 thread instead of here. So here's what we said over there:

phrontister wrote:
Keep_Relentless wrote:

I found problem 5 to be the hardest to do on Excel.

I just used a calculator for #5 (product of all primes 2 to 19, multiplied by 2³ and 3 for the missing 4, 8, 9, 16 & 20). That could also be done in Excel somehow.

Keep_Relentless wrote:

Wow, you just used a calculator for #5? I made columns checking divisibility by every number up to 20 and searched for a good while. Found 46512 is divisible by 16-19, checked its multiples. Found a multiple divisible by every number 1-20 except for 11. Found the smallest one that fits 11 too.

But it was not as quick and easy as using a calculator!

I don't really know what I'm doing, but I made it this far. smile

And you had much more fun! big_smile

I went the LCM route...

Also solved it in M later.

Last edited by phrontister (2024-09-28 01:52:35)


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#4 2024-05-17 16:19:50

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,884

Re: Project Euler Problems 4-6

Keep_Relentless wrote:

By the way the website asks you not to post the answers.

I'd overlooked what you said there. I haven't posted any answers as such, just code...but running the codes will give the answers.

Shall I continue posting the way I have, or change somehow?

From their website:
"Who are the problems aimed at?
The intended audience include students for whom the basic curriculum is not feeding their hunger to learn, adults whose background was not primarily mathematics but had an interest in things mathematical, and professionals who want to keep their problem solving and mathematics on the cutting edge."

I fit into the italicised category. smile

Edit 28/9/2024: I didn't feel right about posting code, so I've now deleted them.

Last edited by phrontister (2024-09-28 01:59:40)


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#5 2024-05-17 21:06:52

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,884

Re: Project Euler Problems 4-6

Keep_Relentless wrote:

I did problem 5 with Excel too

Edit: Problem 4 as well.

I couldn't think of an easy enough way in Excel, so went with M.

Last edited by phrontister (2024-09-28 01:53:12)


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

#6 2024-05-17 21:45:54

phrontister
Real Member
From: The Land of Tomorrow
Registered: 2009-07-12
Posts: 4,884

Re: Project Euler Problems 4-6

Keep_Relentless wrote:

Problem 6 looked really easy so I solved it first.

Yes, that fell into place quite quickly in Excel.

M took me a bit longer to suss out, though.

Last edited by phrontister (2024-09-28 01:53:56)


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." - Ted Nelson

Offline

Board footer

Powered by FluxBB