Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Displaying large prime numbers as 10^a + x?

I just started using SAGE and I wanted to display my large prime numbers as 10^a + x, rather than it having it spit out a ton of zeros.

So far my code looks like

a=100;

P= next_prime(10^a); next_prime(P) next_prime(P)- next_prime(10^a);

With this, it outputs the very large number and while I know how to write it down as 10^a + x (in this case, 10^100 + 949), how do I add that to the code so it would display it like that?

Displaying large prime numbers as 10^a + x?

I just started using SAGE and I wanted to display my large prime numbers as 10^a + x, rather than it having it spit out a ton of zeros.

So far my code looks like

 a=100;

P= next_prime(10^a); next_prime(P) next_prime(P)- next_prime(10^a);

next_prime(10^a);

With this, it outputs the very large number and while I know how to write it down as 10^a + x (in this case, 10^100 + 949), how do I add that to the code so it would display it like that?