Skip to content

Commit

Permalink
refreshing
Browse files Browse the repository at this point in the history
  • Loading branch information
josd committed Mar 2, 2025
1 parent 037e86a commit 6f8de0b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions reasoning/kaprekar-constant/kaprekar-constant.pl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
% Kaprekar's constant

% recursive case till 6174 is reached
'<https://eyereasoner.github.io/ns#kaprekar-constant>'(A, B, C) :-
'<https://eyereasoner.github.io/ns#kaprekar-constant>'(A, [B, C]) :-
A =\= 0,
'<https://eyereasoner.github.io/ns#numberToDigits>'(A, D),
keysort(D, E),
Expand All @@ -12,7 +12,7 @@
J is B+1,
( I =:= 6174
-> C = J
; '<https://eyereasoner.github.io/ns#kaprekar-constant>'(I, J, C)
; '<https://eyereasoner.github.io/ns#kaprekar-constant>'(I, [J, C])
).

% convert 4 digit number to digits
Expand All @@ -30,4 +30,4 @@

% recursion count
'<https://eyereasoner.github.io/ns#recursionCount>'(I, J) :-
'<https://eyereasoner.github.io/ns#kaprekar-constant>'(I, 0, J).
'<https://eyereasoner.github.io/ns#kaprekar-constant>'(I, [0, J]).

0 comments on commit 6f8de0b

Please sign in to comment.