OFFSET
1,1
EXAMPLE
a(1) = 2, as 2 and 2+1 = 3 both are primes.
a(2) = 18, 18 and 18+2 = 20 have the prime signature p^2*q.
a(4) = 66 as 66 + 4 = 70, both have prime signature p*q*r which has not occurred earlier.
a(19) = 8 as 8+19 = 27 and 8 and 27 have the same prime signature p^3.
PROG
(PARI) used = vector(42); ps(n) = local(f); f = factor(n); vecsort(f[, 2]);
a(n) = local(P, m, v, found, j); P = vector(n, i, ps(i)); m = 1; while (1, for (i = 1, n, v = ps(m*n + i); if (v == P[i], found = 0; j = 1; while (!found && j < n, if (v == used[j], found = 1, j++)); if (!found, used[n] = v; return((m - 1)*n + i))); P[i] = v); m++);
for (i = 1, 42, print1(a(i), ", ")); \\ David Wasserman, Jul 19 2005
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Jul 07 2003
EXTENSIONS
More terms from Ray Chandler, Jul 11 2003
More terms from Ray Chandler, Jul 13 2003
More terms from Michel Marcus, Sep 23 2023
STATUS
approved