Message Boards Message Boards

0
|
3303 Views
|
3 Replies
|
1 Total Likes
View groups...
Share
Share this post:
GROUPS:

How to print a large integer as entered?

Posted 10 years ago

I'm currently taking a class in number theory and that means working with large integers. Often these numbers are entered in a short notation, like: x = 52! or y=10^61-1. Mathematica immediately expands these short notations, but that means impractical large integers for printing or making tables.

I was wondering if there is a way to maintain the format the number was originally entered in. I couldn't find anything about it in the documentation.

For example:

x = 10!

Table[ . . . something with x . . . . ]

would result in x being printed as 10! instead of 3 628 800

Many thanks for your help.

POSTED BY: H FR
3 Replies

Hi,

not sure whether these are the droids your looking for, but HoldForm and ReleaseHold might work:

x = HoldForm[10!]

and

x-1

and

x-1//ReleaseHold

There are related functions like Hold, HoldComplete, Unevaluated, and Defer.

Cheers,

Marco

POSTED BY: Marco Thiel
Posted 10 years ago

That's it!

Thanks very much. Spent nearly an hour reading the documentation and didn't find it.

POSTED BY: H FR

Also there is Inactive. Which to use will depend on specific needs. My guess is Defer might best suit them though.

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract