Python Forum
how do I show 12 numbers from a huge number?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how do I show 12 numbers from a huge number?
#6
(Sep-01-2019, 02:15 AM)jefsummers Wrote: So I understand the problem, is it (2**2)**34 or 2**(2**34)? The way written it would be the former which would be 4**34 as a first step

It's 2**(2**34)

(Sep-01-2019, 03:41 AM)ichabod801 Wrote: If it was as easy as calculating the number and converting it to a string, I expect your professor would not have given you until December to solve it. Especially not if it's crashing Pycharm. Note that if you only care about the last 12 digits, you only need to keep the last 12 digits. You could keep trimming off the extra digits, and use a loop to calculate the right number of multiplications. You will probably need to break down the number to keep the number of loops you need to do down.

The higher end would be trickier, since the lower digits still multiply and can thus bleed up into the higher digits. I would look at the higher powers of 2 that you can calculate and see if there are any patterns you can use to solve the problem.

I need the first 12 digits and the last 12 digits. How would you solve this problem with code?
Reply


Messages In This Thread
RE: how do I show 12 numbers from a huge number? - by anabeatriz - Sep-01-2019, 12:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Random Generator: From Word to Numbers, from Numbers to n possibles Words Yamiyozx 2 2,256 Jan-02-2023, 05:08 PM
Last Post: deanhystad
  Convert list of numbers to string of numbers kam_uk 5 4,093 Nov-21-2020, 03:10 PM
Last Post: deanhystad
  Divide a number - Multiple levels - Sum of all numbers equal to input number pythoneer 17 11,522 Apr-20-2018, 04:07 AM
Last Post: pythoneer
  Trying to get the week number from a string of numbers fad3r 2 4,188 Apr-15-2018, 06:52 PM
Last Post: ljmetzger
  Regular Expressions in Files (find all phone numbers and credit card numbers) Amirsalar 2 4,997 Dec-05-2017, 09:48 AM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

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