Python Forum
3rd problem from project Euler
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
3rd problem from project Euler
#7
I think you forget, that for each call, the iterations are summed up.
This is interesting for big numbers.

If you check for example the number 179424673, the sum of total iterations is in the range of:
sum(int(math.sqrt(i)) + 1 for i in range(3, 179424673))
# one minute later....
Output:
1602346003985
Of course you won't hit the maximum possible iterations, because some values are sorted out
by dividing with already known primes.
Calling the same function very often, causes the problem.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
3rd problem from project Euler - by Richard_SS - Jun-05-2019, 09:57 AM
RE: 3rd problem from project Euler - by DeaD_EyE - Jun-05-2019, 10:06 AM
RE: 3rd problem from project Euler - by Richard_SS - Jun-05-2019, 10:51 AM
RE: 3rd problem from project Euler - by perfringo - Jun-05-2019, 10:56 AM
RE: 3rd problem from project Euler - by Richard_SS - Jun-05-2019, 12:13 PM
RE: 3rd problem from project Euler - by heiner55 - Jun-05-2019, 01:55 PM
RE: 3rd problem from project Euler - by DeaD_EyE - Jun-05-2019, 02:06 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  dynamic variable name declaration in OOP style project problem jacksfrustration 3 824 Oct-22-2023, 10:05 PM
Last Post: deanhystad
  Problem with importing python-telegram library into the project gandonio 1 1,612 Nov-01-2022, 02:19 AM
Last Post: deanhystad
  Calculate the Euler Number with more decimal places Pedroski55 10 4,567 Oct-31-2021, 04:45 AM
Last Post: Pedroski55
  IndexError in Project Euler attempt CRISPRmetoopls 3 2,342 Aug-10-2020, 10:00 AM
Last Post: perfringo
  graphing euler method rondo 1 2,524 May-03-2019, 01:03 AM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020