My First Cryptarithm!

Logic Level 3

J E E P × J E E P B E E B E E P \begin{array}{ccccccc} & & & & J & E & E & P\\ \times & & & & J & E & E& P\\ \hline & B & E & E & B & E & E& P \end{array}

The above shows a cryptarithm such that each letter represents a distinct single non-negative integer with J , B J, B being non-zero. Find the sum of all the possible values of the 4 4 -digit number J E E P \overline{JEEP} .


The answer is 2001.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Satyajit Mohanty
Jul 24, 2015

So we have P 2 = P + 10 k P^2 = P + 10k for some integer k , 0 k 8 k, \quad 0 \leq k \leq 8 , we see that P P is one of 0 , 1 , 5 0,1,5 or 6 6 . Now by considering the last two digits of each factor and the product we have ( 10 E + P ) 2 = 100 n + 10 E + P (10E + P)^2 = 100n + 10E + P for some integer n < 100 n < 100 .

This means that 20 P E + P 2 10 E P = 10 E ( 2 P 1 ) + P ( P 1 ) 20PE+P^2-10E-P = 10E(2P-1)+P(P-1) is a multiple of 100 100 . Let us consider P = 6 P = 6 . Then 110 E + 30 110E+30 is a multiple of 100 100 , implying that E = 7 E = 7 . This means that 77 6 2 776^2 must end in the digits 776 776 , but 77 6 2 776^2 actually ends in the digits 176 176 . Thus, P 6 P \neq 6 .

Next try P = 5 P = 5 . Then 90 E + 20 90E + 20 is a multiple of 100 100 , implying that E = 2 E = 2 . This means that 22 5 2 225^2 must end in the digits 225 225 , but 22 5 2 225^2 actually ends in the digits 625 625 . Thus P 5 P \neq 5 . Therefore, P = 0 P = 0 or 1 1 .

In either case we have P ( P 1 ) = 0 P(P-1) = 0 , which means that 10 E ( 2 P 1 ) 10E(2P-1) is a multiple of 100 100 . Since 2 P 1 = ± 1 2P - 1 = \pm 1 , we conclude that E = 0 E=0 implying that P = 1 P=1 , since it must be different from E E . Thus we have P = 1 , E = 0 P=1, E=0 . Then we have B = J 2 B = J^2 and B = 2 J B = 2J , since ( J 001 ) 2 = ( J ) 2 00 ( 2 J ) 001 = B 00 B 001 (J001)^2 = (J)^200(2J)001 = B00B001 . Since J 2 = 2 J J^2 = 2J and J 0 J \neq 0 , we conclude that J = 2 J = 2 , whence J E E P = 2001 \overline{JEEP} = \boxed{2001} .


If you've entered this problem via this wiki: Cryptogram , and if you're looking for a solution involving Chinese-Remainder Theorem , please check in the comments to this post for @PiHanGoh 's solution.

The multiplication shows the last three digits of a square of a number is the same as the last three digits of the very number itself. So we have x 2 x ( m o d 1000 ) x^2 \equiv x \pmod{1000} or x ( x 1 ) 0 ( m o d 1000 ) x(x-1) \equiv 0 \pmod{1000} . Since x x and x 1 x-1 are consecutive integers, then they are coprime. Because 1000 = 2 3 5 3 1000 = 2^3 \cdot 5^3 , then one of x , x 1 x,x-1 is divisible by 8 and the other is divisible by 125. Solve via Chinese Remainder Theorem gives x 001 , 376 , 625 ( m o d 1000 ) x \equiv 001,376,625 \pmod{1000} but since the last three digits is of the form of E E P \overline{EEP} , then x 001 x\equiv 001 only. So E = 0 , P = 1 E=0, P = 1 . And we are left to check for the squares of 1001 , 2001 , 3001 , , 9001 1001,2001,3001,\ldots, 9001 . But since 400 1 2 4001^2 is already a 7-digit number, we are then reduce to check for the squares of 1001 , 2001 , 3001 1001,2001,3001 . Inspection shows that J = 2 J = 2 only.

Pi Han Goh - 5 years, 10 months ago

Log in to reply

Nicely Done! Why don't you post this as a solution instead of a comment?

Satyajit Mohanty - 5 years, 10 months ago

Log in to reply

I promise myself I only post solutions on Mondays

Pi Han Goh - 5 years, 10 months ago

Log in to reply

@Pi Han Goh Superstitious! :D ... OK! You post this comment as a solution on Monday!

Satyajit Mohanty - 5 years, 10 months ago

Log in to reply

@Satyajit Mohanty SLACK SLACK SLACK SLACK NOW NOW NOW

Pi Han Goh - 5 years, 10 months ago

Log in to reply

Problems might be similar, but approaches to all would be different! :P

Satyajit Mohanty - 5 years, 10 months ago

Log in to reply

That's right @Satyajit Mohanty , you follow the way in your solution, and I follow the brute force! Lol, the 'same way' for all is programming, right?

1
2
3
4
5
6
7
from itertools import permutations
li=[]
for i in permutations('012345678'):
    k=''.join(i)
    [J,E,P,B]=list(k)[:4]
    if int(J+E+E+P)*int(J+E+E+P)==int(B+E+E+B+E+E+P):
        li.append(int(J+E+E+P))

Though in your question a faster way than permutations is actually appending all the 1 0 4 10^4 possible quadruples in a list before, but see? The above algorithm can be typed in, in all the similar problems ;) Btw very nice 'non-bash' solution of yours, really liked it.

Aditya Raut - 5 years, 10 months ago

Log in to reply

@Aditya Raut You're an Olympian Right! Programming never suits you. :P

Satyajit Mohanty - 5 years, 10 months ago

I found the solution of Pi Han Goh, and I wrote 6003. Am I wrong? and if I am right why I can't point?

Guillermo Templado - 5 years, 8 months ago

Log in to reply

6003^2 is an 8 digit integer, not a 7-digit integer, so it didn't satisfy the criteria, so it's a not a solution.

Pi Han Goh - 5 years, 8 months ago

Log in to reply

I meant I wrote 1001 + 2001 +3001=6003.

Guillermo Templado - 5 years, 8 months ago

Log in to reply

@Guillermo Templado Answer is 2001, not 6003. Check your arithmetic again.

Pi Han Goh - 5 years, 8 months ago

@Guillermo Templado Ok, I saw my mistake

Guillermo Templado - 5 years, 8 months ago
Mike Sull
Aug 15, 2015

\sqrt{10000000} = around 3162 so Jeep is less than that because BEEBEEP is only 7 digits long. Unless P = 1, BEEBEEP won't make sense (5 and 6 would mess it up). E is obviously 0. Try 1001^2 in calculator, doesn't work. Try 2001^2 in calculator, works, Try 3001^2 in calculator, doesn't work. Answer is 2001.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...