Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
13
Task/Babbage-problem/Prolog/babbage-problem-1.pro
Normal file
13
Task/Babbage-problem/Prolog/babbage-problem-1.pro
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
:- use_module(library(clpfd)).
|
||||
|
||||
babbage_(B, B, Sq) :-
|
||||
B * B #= Sq,
|
||||
number_chars(Sq, R),
|
||||
append(_, ['2','6','9','6','9','6'], R).
|
||||
babbage_(B, R, Sq) :-
|
||||
N #= B + 1,
|
||||
babbage_(N, R, Sq).
|
||||
|
||||
babbage :-
|
||||
once(babbage_(1, Num, Square)),
|
||||
format('lowest number is ~p which squared becomes ~p~n', [Num, Square]).
|
||||
Loading…
Add table
Add a link
Reference in a new issue