^6000 -> grep {|n| [-1, 3, 5].all {|k| n + k -> is_prime } }.say
[8, 14, 38, 68, 98, 104, 194, 224, 278, 308, 458, 614, 824, 854, 878, 1088, 1298, 1424, 1448, 1484, 1664, 1694, 1784, 1868, 1874, 1994, 2084, 2138, 2378, 2684, 2708, 2798, 3164, 3254, 3458, 3464, 3848, 4154, 4514, 4784, 5228, 5414, 5438, 5648, 5654, 5738]