Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,13 +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).
|
||||
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).
|
||||
|
||||
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]).
|
||||
once(babbage_(1, Num, Square)),
|
||||
format('lowest number is ~p which squared becomes ~p~n', [Num, Square]).
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
babbage :-
|
||||
Start is ceil(sqrt(269696)),
|
||||
between(Start, inf, N),
|
||||
Square is N * N,
|
||||
Square mod 100 =:= 96, % speed up
|
||||
Square mod 1000000 =:= 269696,!, % break after first true
|
||||
format('lowest number is ~d which squared becomes ~d~n', [N, Square]).
|
||||
Start is ceil(sqrt(269696)),
|
||||
between(Start, inf, N),
|
||||
Square is N * N,
|
||||
Square mod 100 =:= 96, % speed up
|
||||
Square mod 1000000 =:= 269696,!, % break after first true
|
||||
format('lowest number is ~d which squared becomes ~d~n', [N, Square]).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue