%I #26 Sep 08 2021 08:10:30
%S 8,11,7,20,28,19,37,51,53,47,101,116,58,63,99,81,136,146,159,153,115,
%T 213,176,197,302,151,215,223,169,230,276,274,255,188,233,318,440,341,
%U 347,359,369,282,386,396,405,520,638,460,472,698,357,492,507,514,529,535,558,702
%N Index of prime(n) in A347113, or -1 if that prime never appears.
%C Conjecture: every prime appears in A347113 (every number, in fact).
%C The graph shows three three strong lines (and many other points). Can the primes on the three lines be described in a simple way?
%H Alois P. Heinz, <a href="/A347313/b347313.txt">Table of n, a(n) for n = 1..10000</a>
%o (Python)
%o from math import gcd
%o from sympy import prime
%o def A347313(n):
%o p = prime(n)
%o i, j, nset, m = 1, 2, {1}, 2
%o while True:
%o k = m
%o i += 1
%o while k == j or gcd(k,j) == 1 or k in nset:
%o k += 1
%o if k == p:
%o return i
%o j = k+1
%o nset.add(k)
%o while m in nset:
%o m += 1 # _Chai Wah Wu_, Sep 06 2021
%Y Cf. A347113.
%K nonn
%O 1,1
%A _N. J. A. Sloane_, Sep 06 2021