/* Powert concatenation in Picat. http://www.cbarker.net/thoughts/power-concatenation """ 16 and 9 are each square numbers, and putting them together, 169, gives another square. Other examples? """ This Picat model was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ main => go. go => Powers = new_map([I**2=1 : I in 1..1_000]), foreach(P1 in Powers.keys(), P2 in Powers.keys()) P = P1.to_string() ++ P2.to_string(), if Powers.has_key(P.to_int()) then printf("%w %w = %w\n", P1,P2,P) end end, nl.