fork download
  1. q=lambda l,d=2:d>len(l)or q(l,d+1)&(len({v%d for v in l})<d)
  2. truthy=[[0,2],[-1,1],[-100,-200],[0,2,6],[0,2,6,8],[0,2,6,8,12],[0,4,6,10,12],[-60,0,60,120,180],[0,2,6,8,12,26],[11,13,17,19,23,29,31],[-11,-13,-17,-19,-23,-29,-31]]
  3. falsey=[[0,1],[-1,4],[-100,-201],[0,2,4],[0,2,6,10],[0,2,6,8,14],[7,11,13,17,19,23,29],[-60,0,60,120,180,240,300]]
  4. for l in truthy: print('{0} Truthy test case, {1}'.format(q(l), l))
  5. for l in falsey: print('{0} Falsey test case, {1}'.format(q(l), l))
Success #stdin #stdout 0.02s 44680KB
stdin
Standard input is empty
stdout
True Truthy test case, [0, 2]
True Truthy test case, [-1, 1]
True Truthy test case, [-100, -200]
True Truthy test case, [0, 2, 6]
True Truthy test case, [0, 2, 6, 8]
True Truthy test case, [0, 2, 6, 8, 12]
True Truthy test case, [0, 4, 6, 10, 12]
True Truthy test case, [-60, 0, 60, 120, 180]
True Truthy test case, [0, 2, 6, 8, 12, 26]
True Truthy test case, [11, 13, 17, 19, 23, 29, 31]
True Truthy test case, [-11, -13, -17, -19, -23, -29, -31]
False Falsey test case, [0, 1]
False Falsey test case, [-1, 4]
False Falsey test case, [-100, -201]
False Falsey test case, [0, 2, 4]
False Falsey test case, [0, 2, 6, 10]
False Falsey test case, [0, 2, 6, 8, 14]
False Falsey test case, [7, 11, 13, 17, 19, 23, 29]
False Falsey test case, [-60, 0, 60, 120, 180, 240, 300]