- 2,163
- 191
I am writing and I am thinking about it. Just when I write the codes things happen.Vanadium 50 said:Your refusal to write pseudocode is a mistake. Just sayin'.
The discussion revolves around finding the largest prime factor of the number 600851475143, with participants sharing their coding attempts and challenges related to implementing algorithms for prime factorization. The scope includes programming, algorithm development, and debugging.
Participants express various approaches and suggestions, but there is no consensus on a single method for solving the problem. Multiple competing views on coding strategies and debugging techniques remain present throughout the discussion.
Limitations include unresolved issues with code efficiency, the handling of data types across different Python versions, and the need for clearer logic flow in the programming attempts.
I am writing and I am thinking about it. Just when I write the codes things happen.Vanadium 50 said:Your refusal to write pseudocode is a mistake. Just sayin'.
N=600851475143
b=1
while True:
if N%b==0:
t=N//b
b=b+1
print (t)
else:
b=b+1
Sorry you're having such a time, but thanks for sharing the website,Arman777 said:Another sad thing is this is the 3rd problem in the project euler site
Or a flowchart, perhaps.Vanadium 50 said:Your refusal to write pseudocode is a mistake. Just sayin'.
Yes and I actually come here to thank @StoneTemplePython for introducing me to the site, but I saw your post so your welcome somehow :)scottdave said:Sorry you're having such a time, but thanks for sharing the website,
https://projecteuler.net
I think that's just what I need for some practice problems.
I'm on my phone and I did the 1st one on my phone using Google Sheets while my kid is at swim practice .
[emoji2] not everything has to be done in Python
Well, I guess that's a good approach, the interesting thing is 4th, 5th or 6th problems are much easier than the 3rd one somehow (at least for me).scottdave said:Or a flowchart, perhaps.
I used a spreadsheet to solve this. Maybe I'll go try to write some code. I'm taking an online Python right now, so I think the extra practice will be good. But often you can use other tools.
My approach was to go along till I hit a factor, check to see if that number is prime. Take the original number 600851475143 and divide by that factor. Now I have a somewhat smaller number to find factors of. The next number that turns up to be a factor, divide by that one and I have a smaller number.
If you keep track of the product of these factors you've been saving, then you will know when to stop.
scottdave said:.
I'm on my phone and I did the 1st one on my phone using Google Sheets while my kid is at swim practice .
scottdave said:I'm taking an online Python right now, so I think the extra practice will be good. But often you can use other tools.
I haven't gone exactly in order. I'll work on one for a little while, then move on to another if I feel I'm stuck, then come back to revisit. These are the ones that I've solved so far: 1 thru 3, 5 thru 11, 13, 16, 19, 20, 22, 26, and 29Arman777 said:I come to the 9th problem ( I solved the earlier ones as well) and I'll try to do more and more, Its really great indeed.
Well, I guess that's a good approach, the interesting thing is 4th, 5th or 6th problems are much easier than the 3rd one somehow (at least for me).
7th took some time to solve but I manage to do it.
8th is really nice :)
Thars great :) Sure you canscottdave said:I haven't gone exactly in order. I'll work on one for a little while, then move on to another if I feel I'm stuck, then come back to revisit. These are the ones that I've solved so far: 1 thru 3, 5 thru 11, 13, 16, 19, 20, 22, 26, and 29
I haven't seen any problem where those are necessary. I found a 450-line version of the quadratic sieve online.Fred Wright said: