/* https://medium.com/@themahfujur/31-can-you-solve-this-math-problem-3a88655ee706 """ If 4 + 2 = 26, 8 + 1 = 79, 6 + 5 = 111, then what is 7 + 3 = ? """ I.e. 4 + 2 = 26 8 + 1 = 79 6 + 5 = 111 7 + 3 = ? The "natural" solution is 410, but it's not found by this program: 4-2 = 2, 4+2 = 6 -> 26 8-1 = 7, 8+1 = 9 -> 79 6-5 = 1, 6+5 = 11 -> 1 11 -> 111 7-3 = 4, 7+3 = 10 -> 4 10 -> 410 Note that the trick with "truncated unknown" that works with symbolic_function_induction.pi does not work with symbolic_regression.pi. Cf http://hakank.org/jgap/equation4.conf */ data(equation4,Data,Vars,Unknown,Ops,Constants,MaxSize,Params) :- % Data = [ [[4,2],26], % [[8,1],79], % [[6,5],111] % ], Data = [ [[4,2,2],6], [[8,1,7],9], [[6,5,1],11] ], Ops = [+,-,*,/], Constants = 1..10, Vars = ['A','B','C'], Unknown = [7,3,_], % This does not work MaxSize = 21, Params = new_map().