/////////////////////////////////////////////////////////////////////////////// // // Enigma Number 1615 // /////////////////////////////////////////////////////////////////////////////// // // Enigma 1615, Gwyn Owen, New Scientist magazine, 29 September 2010 // /////////////////////////////////////////////////////////////////////////////// // // ENIGMA represents a six-digit number in which the digits are // all different and non-zero. // // When EN slides from the front to the back, the resulting six-digit // number, IGMAEN, is 20 per cent larger than ENIGMA. // // What is ENIGMA? // /////////////////////////////////////////////////////////////////////////////// // // Solve the problem by running the query: // // all Enigma1615(enigma) // /////////////////////////////////////////////////////////////////////////////// // // Results: // // enigma = 384615 // ___ Solution: 1 ___ [00:00:00] __ [Backtracks: 465] ____ // // Number of solutions: 1 Number of backtracks: 495 // Elapsed time: 00:00:00 // /////////////////////////////////////////////////////////////////////////////// pred Enigma1615(enigma::L) iff letters :: [0..]->>L[1..9] & letters = [e,n,i,g,m,a] & enigma = e*100000 + n*10000 + i*1000 + g*100 + m*10 + a & igmaen = i*100000 + g*10000 + m*1000 + a*100 + e*10 + n & 10*igmaen = 12*enigma
This page was created by F1toHTML