/* From https://www.themathdoctors.org/pattern-and-sequence-puzzles/ """ 9, 5, 45, 8, 6, 48, 6, 7, ? """ I would say that ? = 6*7=42 but is there some other pattern? The program doesn't find anything... */ data(puzzle4_alt,Data,Vars,Unknown,Ops,Constants,MaxSize,Params) :- Seq = [9, 5, 45, 8, 6, 48, 6, 7], % make_point_seq(Seq,Data,Unknown,Vars), % no solution % member(N,1..3), make_seq(Seq,2,Data,Unknown,Vars), Ops = [+,-,*,/], Constants = -10..10, MaxSize = 11, Params = new_map(). /* Another representation, index + expanded. But still no solution... */ /* data(puzzle4_alt,Data,Vars,Unknown,Ops,Constants,MaxSize,Params) :- Data = [ [[1, 9,5],45], [[2, 5,45],8], [[3, 45,8],6], [[4, 8, 6],48], [[5, 6,48],6], [[6, 48,6],7] ], Vars = ['A','B','C'], Unknown = [7,6,7], Ops = [+,-,*,/], Constants = -10..10, MaxSize = 11, Params = new_map(). */