Problem 273

A place to air possible concerns or difficulties in understanding ProjectEuler problems. This forum is not meant to publish solutions. This forum is NOT meant to discuss solution methods or giving hints how a problem can be solved.
Forum rules
As your posts will be visible to the general public you are requested to be thoughtful in not posting anything that might explicitly give away how to solve a particular problem.

This forum is NOT meant to discuss solution methods for a problem.

In particular don't post any code fragments or results.

Don't start begging others to give partial answers to problems

Don't ask for hints how to solve a problem

Don't start a new topic for a problem if there already exists one


See also the topics:
Don't post any spoilers
Comments, questions and clarifications about PE problems.
User avatar
Jochen_P
Posts: 55
Joined: Mon Oct 05, 2009 10:47 am
Location: Stuttgart, Germany

Re: Problem 273

Post by Jochen_P »

Thank you,

hmm, let's take 5*13*17 : the proper divisors are [1, 5, 13, 17, 65, 85, 221]
And now take the sentence "Find S(N), for all squarefree N only divisible by primes of the form 4k+1 with 4k+1 150."

That would disqualify 5*13*17 and all above... ehm, ... oh well, it would also disqualify all other products as 1 is always a divisor and definetly not prime. So the sentence should be read like "Find S(N), for all squarefree N only divisible by primes of the form 4k+1 with 4k+1 150."

All right, all clear now, I rest my case :)
Image
Smaug
Posts: 15
Joined: Thu Aug 06, 2009 5:08 pm

Re: Problem 273

Post by Smaug »

That is a good point IMO - the wording should be changed from
... for all squarefree N only divisible by primes of the form ...
to: '... for all squarefree N whose only prime factors are of the form... '
Slartibartfast
Posts: 1
Joined: Mon Jan 18, 2010 9:18 pm

Re: Problem 273

Post by Slartibartfast »

Thanks for the clarification Jochen_P. I was doing the same as quilan until you pointed out that the product of more than two primes is divisible by a non-prime (doh!).
I got the 16 primes, that's easy. Was initially checking 120 numbers 'til I realised that the additional 16 were the individual primes (doh!^duh!: that's a very big number -- almost as large as the product of all 16 primes).
So, now I have all 136 numbers but I think they are all square free. Am I right?
I am assuming a square free number can not be divided by a square number. e.g. 10 is square free, 18 is not (can be divided by a square number: 9).
Program runs in a second or two but gets wrong answer.
I would like to suggest a slight change to Smaug's wording:
... for all squarefree N whose only factors are primes of the form 4k+1 where 4k+1 < 150.
TripleM
Posts: 384
Joined: Fri Sep 12, 2008 3:31 am

Re: Problem 273

Post by TripleM »

Slartibartfast wrote:Thanks for the clarification Jochen_P.
Jochen_P was not making a clarification on the problem statement; it was on a wrong interpretation of the problem statement!

Smaug's wording is correct; yours leads to the wrong assumption that numbers like 5*13*17 are invalid. They are valid.
User avatar
Jochen_P
Posts: 55
Joined: Mon Oct 05, 2009 10:47 am
Location: Stuttgart, Germany

Re: Problem 273

Post by Jochen_P »

Yep,

sorry for the confusion...
I'm afraid that you'll have to work with 2^16-1 figures :)
Image
quilan
Posts: 182
Joined: Fri Aug 03, 2007 11:08 pm

Re: Problem 273

Post by quilan »

So it's been ages since I picked up this problem, and I've got what SHOULD be a water-tight solution written but... as is wont to be the case, it's no-go. Can I get a ninja quick confirmation that the process (as discussed above) for say... all primes 4k+1 [le] 20, we'd be solving for:

answer = S(5) + S(5*13) + S(5*13*17) + S(5*17) + S(13) + S(13*17) + S(17)
= S(5) + S(65) + S(1105) + S(85) + S(13) + S(221) + S(17)

If not, what would I be solving for? If so... I've got a nightmare of a debugging session ahead of me.
ex ~100%'er... until the gf came along.
Image
User avatar
elendiastarman
Posts: 410
Joined: Sat Dec 22, 2007 8:15 pm

Re: Problem 273

Post by elendiastarman »

That seems to me to be correct.
Want some
3.14159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679...?
Image
quilan
Posts: 182
Joined: Fri Aug 03, 2007 11:08 pm

Re: Problem 273

Post by quilan »

Haha! Just kidding! I've had the correct algorithm for... oh, a month & a half now. Just had the dumbest bug ever. I love life.
ex ~100%'er... until the gf came along.
Image
User avatar
elendiastarman
Posts: 410
Joined: Sat Dec 22, 2007 8:15 pm

Re: Problem 273

Post by elendiastarman »

The stupidest bugs are always the hardest ones to find... :evil:
Want some
3.14159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679...?
Image
pain
Posts: 1
Joined: Sun Jun 06, 2010 8:16 am

Re: Problem 273

Post by pain »

First I misunderstood the question and solve it for only 5 , 13 , 17.... and 5*13, 5*17...
but now how to handle the numbers like 5*13*17...*149... i am stucked.... in c++ as the order of the number is quite large...
Please Help...
mrain
Posts: 1
Joined: Thu Oct 06, 2011 10:46 am

Re: Problem 273

Post by mrain »

with the description "all squarefree N only divisible by primes of the form 4k+1 with 4k+1 < 150
N is going to be unbounded. because for every integer i, 5^i is a valid squarefree number.
TripleM
Posts: 384
Joined: Fri Sep 12, 2008 3:31 am

Re: Problem 273

Post by TripleM »

User avatar
Oliver1978
Posts: 166
Joined: Sat Nov 22, 2014 9:13 pm
Location: Erfurt, Germany

Re: Problem 273

Post by Oliver1978 »

I suspect these are elements 1 to 5 of N ... [1, 5, 13, 17, 29]?
49.157.5694.1125
User avatar
PhilLeTaxi
Posts: 20
Joined: Wed Mar 05, 2014 12:54 pm
Location: Paris, France

Re: Problem 273

Post by PhilLeTaxi »

I agree with you for these elements.
As said above, there are 65535 number N for primes below 150.
I wonder how to speed up the process.
Image
User avatar
Oliver1978
Posts: 166
Joined: Sat Nov 22, 2014 9:13 pm
Location: Erfurt, Germany

Re: Problem 273

Post by Oliver1978 »

@PhilLeTaxi: I'm trying to avoid big integers, which may not be necessary at all. Some old Indian certainly knew the answer ;) I'm sticking with his way right now.
49.157.5694.1125
User avatar
PhilLeTaxi
Posts: 20
Joined: Wed Mar 05, 2014 12:54 pm
Location: Paris, France

Re: Problem 273

Post by PhilLeTaxi »

Thanks Olivier for your response.
I solved the problem yesterday.
:D
I coded it in Python.
May be in another langage like Java, you will need BigInteger
as the greatest possible N has 28 digits.
Image
Junglemath
Posts: 72
Joined: Fri Sep 20, 2019 1:25 pm
Location: Minsk

Re: Problem 273

Post by Junglemath »

There's an 's' missing in 'integer' in the first line of the problem statement.

And the same missing 's' in the same word on line 4.
User avatar
jaap
Posts: 588
Joined: Tue Mar 25, 2008 3:57 pm
Contact:

Re: Problem 273

Post by jaap »

Junglemath wrote: Sun Nov 29, 2020 7:14 am There's an 's' missing in 'integer' in the first line of the problem statement.

And the same missing 's' in the same word on line 4.
You could add an s, but it is also correct as is, since integer is being used here as an adjective rather than a noun (like "whole" instead of "whole number").
Post Reply