OFFSET
1,2
COMMENTS
If a(n) + prime(n) is a prime p, then a(n+1) is the smallest multiple (>1) of p that has not occurred earlier. Conjectured to be a permutation of the positive integers.
LINKS
Michael De Vlieger, Log log scatterplot of a(n), n = 1..2^14, labeling maxima in red and local minima in blue, highlighting primes in green and other prime powers in gold.
EXAMPLE
a(1)=1; 1 + prime(1)=3, so a(2) = 6, the smallest unused number sharing a divisor with 3.
MATHEMATICA
nn = 65; c[_] = False; u = 2; a[1] = j = 1; c[1] = True; Do[m = j + Prime[n - 1]; If[PrimeQ[m], k = 2; While[c[k m], k++]; k *= m, k = u; While[Or[c[k], k == m, CoprimeQ[k, m]], k++]]; Set[{a[n], c[k], j}, {k, True, k}]; If[k == u, While[c[u], u++]], {n, 2, nn}]; Array[a, nn] (* Michael De Vlieger, Oct 06 2022 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
David James Sycamore, Oct 06 2022
STATUS
approved