Created
November 5, 2016 23:50
-
-
Save shintakezou/4b3f4a11bf830ffbd8a918ad133e196d to your computer and use it in GitHub Desktop.
solve A problem with Susi 937 from Italian magazine "La Settimana Enigmistica"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-module(solve937). | |
-export([solve/0]). | |
% This solve the following problem: | |
% find that number X < 54, so X^2 = A + B, | |
% where A is the number made of the first | |
% 2 digits of X^2 and B is the number made | |
% of the last 2 digits of X^2. | |
check(X) -> | |
X2 = X * X, | |
A = X2 div 100, | |
B = X2 rem 100, | |
(A+B) == X. | |
solve() -> | |
L = [X || X <- lists:seq(32, 54), | |
check(X)], | |
io:fwrite("~w~n", [L]). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment