Is dealing with large numbers as formula a thing? and how is it done?

Click For Summary

Discussion Overview

The discussion revolves around the methods for extracting specific digits from large numbers represented in formulaic forms, particularly focusing on the number 2^(82589933) - 1, which is a known large prime. Participants explore various mathematical techniques and computational approaches to handle such large numbers without directly calculating them in their entirety.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning

Main Points Raised

  • One participant expresses a desire to extract specific digits from large numbers stored in formulaic forms, citing the example of 2^(82589933) - 1.
  • Another participant argues that 2^(82589933) - 1 is manageable in size, suggesting it can fit in about 10 Megabytes and discusses the time complexity of arithmetic operations on such numbers.
  • A different participant suggests using modular arithmetic to find last digits, providing a method for calculating the last digit of powers of 2 and explaining how to derive the last digit of 2^(82589933) - 1.
  • Further, approximations for the first digits are discussed, with a calculation involving logarithms to estimate the leading digits of the number.
  • One participant proposes the possibility of using SQL string functions to manipulate large numbers, inviting input from another participant who may have expertise in that area.

Areas of Agreement / Disagreement

Participants present various methods and perspectives on handling large numbers, with no consensus reached on a single approach. Multiple competing views and techniques are discussed, indicating an unresolved nature of the topic.

Contextual Notes

Limitations include the absence of a universally applicable method for all cases and the reliance on specific mathematical properties and computational techniques that may not be straightforward for all participants.

AtlasSniperma
Messages
22
Reaction score
0
TL;DR
Arithmetic using numbers in equation form?
Hi everyone.
I haven't been here in years, I'm surprised the account still works.

Anyway. I have a mathematic thought/question that I really want to learn about. I realize this isn't going to be the easiest thing to explain if it is even possible, so please forgive me.

So, What I want to do is be able to extract a specific digit from a number when that number is stored in some formulaic form.

An easy example: 111^2, digit 1(leftmost, 10,000s column, whatever) = 1. digit 3 = 3, digit 4 = 2 etc.

A more understandable example is the number 2^(82589933) - 1 which is one of the largest known primes.
My computer will never be able to process that number as a standard number, so I'd love to be able to do arithmetic on it while it's in this more easily maneuvered form.

ultimately, in this case, I'd love to be able to incorporate this methodology into an iterative function that prints the number one digit at a time so as to not attempt to choke on it's sizeable girth.

I do remember hearing about something like this being used with Pi, but I do realize that's not necessarily related to the field I'm asking about.I hope that makes sense. Thanks for any advice anyone can give.
 
Mathematics news on Phys.org
Actually 2^(82589933) - 1 isn't all that big. It will fit in about 10 Megabytes. Adding 2 numbers of that size will be about a millisecond. Multiplying two numbers of that size would take a computer about an hour using the elementary school method, that uses a number of operations that is proportional to the square of the input size, but can still be done in under a second by using a fast Fourier transform method.
 
There is no single general method that will always work.

What often works for the last digits is modular arithmetic. If you just care about the last digit, only calculate the remainder when divided by 10, if you are interested in the last two take the remainder mod 100 and so on. As an example for powers of 2 (subtracting 1 is trivial):
20 = 1
21 = 2
22 = 4
23 = 8 = 8 (mod 10)
24 = 16 = 6 (mod 10)
25 = 32 = 2 (mod 10)
26 = 64 = 4 (mod 10)
from here on it is always the cycle 2,4,8,6, ... That means we can subtract a multiple of 4 from the exponent without changing the last digit.

282589933 = 282589932+1 = 21 = 2 mod 10
Therefore 282589933-1 ends in a 1.

I didn't use a calculator anywhere. With a bit more work you can get the next to last digit as well, and a computer will quickly produce the last 10 digits that way.

Approximations can work for the first digits. ##\log(2^{82589933}) = 82589933 \log(2) \approx 24862047.17288##. Therefore ##2^{82589933} \approx 10^{24862047+0.17288} = 10^{0.17288} \cdot 10^{24862047} = 1.4889 \cdot 10^{24862047}##. And indeed, the prime starts with 14889 and has 24862048 decimal digits.
 
I wonder if you can use some SQL string function for this. Maybe @sqljunkey knows?
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K