# An easy trillionth power

Hardy was revisiting Ramanujan and this time arrived in taxicab number 1792. He remarked that this number seemed rather dull.

Ramanujan replied, "It is very interesting, it is the product of the first six digits of a trillionth power."

Please find a whole number such that, when raised to the power 1 000 000 000 000, its first six digits (from left to right) multiply to give 1792.

• I think Ramanujan would've called that number "billion". Dec 29, 2021 at 16:45
• Even I would have once have called this number a billion. It's safer for this question to have a higher power and a lakh crore should do.
– Tom
Dec 29, 2021 at 17:00
• This isn't a very interesting property. You can pick any sequence of 6 digits where the first digit isn't 0 and have those 6 digits be the first 6 digits of a trillionth power, so any product of 6 single-digit integers is the product of the first 6 digits of a trillionth power. Dec 30, 2021 at 6:02
• @Tom Is the accepted solution the intended solution? Or did you have something else in mind? Dec 30, 2021 at 14:31
• @Peter: The story is completely made up for the puzzle. Note how the number is 1792, not 1729. It's presented as a sequel to the story of the actual Hardy-Ramanujan number. Jan 1, 2022 at 21:54

First observe that the first $$6$$ digits of

$$e = \mathbf{2.71828}\ 18284 \ldots$$

happen to multiply to $$1792$$. Now all we need is to remember the bounds

$$(1+\frac 1 n)^n < e < (1+\frac 1 n)^{n+1}$$ (for positive $$n$$)

to find that the number

$$1\ 000\ 000\ 000\ 001$$

does the trick.

Indeed, setting $$n = 1\ 000\ 000\ 000\ 000$$ we get

$$e > 1.000\ 000\ 000\ 001^{1\ 000\ 000\ 000\ 000} > \frac e {1.000\ 000\ 000\ 001}$$.

Multiplying through with $$1\ 000\ 000\ 000\ 000^{1\ 000\ 000\ 000\ 000}$$ we confirm that the first $$10$$ or so digits of the $$1\ 000\ 000\ 000\ 000$$th power and of

$$e$$

are the same as desired.

• OK, that is clever. Dec 29, 2021 at 22:33
• Indeed the first 12 digits are the same (the 13th differs). Oct 31, 2023 at 18:56

The smallest natural number that fits the bill is

1931

but

that's 11 years after his death

so I guess the other answer is better...

Code to find that number, computing not the exact powers but only their first 100 digits but computing lower and upper bound and checking that their first six digits are the same so we know they're exact:

import math

i = 0
while True:
b = B = i
e = 10**12
p = P = 1
while e:
if e % 2:
p *= b
P *= B
while p > 10**100:
p //= 10
P = -(P // -10)
e //= 2
b *= b
B *= B
while b > 10**100:
b //= 10
B = -(B // -10)
p = str(p)
P = str(P)
assert len(p) == len(P)
assert p[:6] == P[:6]
if math.prod(map(int, p[:6])) == 1792:
print(i)
break
i += 1


Attempt This Online!