Robert, I agree, but does Iouri want {k} to be a sequence of primes? His definition is a bit confusing (two different formulas). Ed Jeffery >But sequences like this usually give k: {2, 3, 4, 5, 12, 13, 14, 23, 57, 106, 226, 227, 311, 373, 1046, 1298, 1787, 1952, 2130, 2285, 2670, 3254, 3642, 4369} (A077375).