/* Two identical strings (Rosetta code) in Picat. http://rosettacode.org/wiki/Two_identical_strings """ Task Find and display (here on this page) positive integers, n, whose base 2 representation is the concatenation of two identical binary strings, where n < 1,000_base(10) (one thousand). For each such integer, show its decimal and binary forms. """ This program was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ main => go. go ?=> bp.length(_L,I), I > 0, B = to_binary_string(I), BB = B++B, parse_radix_string(BB,2) = Dec, ( Dec < 1000 -> printf("%4w %10w\n",Dec,BB), fail ; true), nl. go => true.