OFFSET
1,1
COMMENTS
Will every prime appear, so that this sequence is a permutation of the primes?
The answer is yes if A071256(n) exists for every n. - Robert Israel, Aug 25 2025
EXAMPLE
a(1) = 2 because 2 appeared first as a prime factor of the average of a twin prime pair, namely of 4 = 2*2 = 2^2, the average of 3 and 5, the first twin prime pair.
a(2) = 3 because 3 appeared next as a prime factor of the average of a twin prime pair, here 6 = 2*3, of the twin primes 5 and 7.
a(3) = 5 because 5 appeared next as a prime factor of the average of a twin prime pair, this time of 30 = 2*3*5, between 29 and 30. The averages 12 and 18 are skipped as their factors, 2 and 3, already appeared.
a(5) = 17 following a(4) = 7, skipping the primes 11 and 13 in the order of appearances.
MAPLE
P:= select(isprime, {seq(i, i=3..10^4, 2)}):
TPA:= map(`+`, P intersect map(`-`, P, 2), 1):
TPA:= sort(convert(TPA, list)):
R:= NULL: S:= {}:
for t in TPA do
V:= numtheory:-factorset(t) minus S;
if nops(V) > 1 then printf("t = %d: %a\n", t, V) fi;
R:= R, op(sort(convert(V, list)));
S:= S union V;
od:
R; # Robert Israel, Aug 25 2025
MATHEMATICA
With[{m = Select[Prime[Range[1000]], PrimeQ[# + 2] &] + 1}, DeleteDuplicates[Flatten[FactorInteger[#][[;; , 1]] & /@ m]]] (* Amiram Eldar, Aug 25 2025 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Tamas Sandor Nagy, Aug 25 2025
STATUS
approved
