login
With p = prime(n), a(n) is the least composite k such that A001414(k) = p and k+p is prime, or 0 if there is no such k.
1

%I #14 Jul 23 2021 09:02:27

%S 0,0,6,10,48,90,210,34,416,570,58,2652,930,1984,1184,1376,2820,118,

%T 1062,1830,3660,4020,2190,2370,1602,5340,9006,12702,6208,3090,8502,

%U 12198,3810,7620,4448,298,21372,17880,4710,15386,7014,21376,22836,11584,11946,394,16548,40596,13926,454,7136,6870

%N With p = prime(n), a(n) is the least composite k such that A001414(k) = p and k+p is prime, or 0 if there is no such k.

%C All terms are even.

%C Conjecture: a(n) > 0 for n >= 3.

%H Robert Israel, <a href="/A346501/b346501.txt">Table of n, a(n) for n = 1..10000</a>

%e a(5) = 48 because A001414(48) = 11 = prime(5) and 48+11 = 59 is prime, and 48 is the least composite that works for this prime.

%p spf:= proc(n) local t;

%p add(t[1]*t[2],t=ifactors(n)[2])

%p end proc:

%p N:= 500: # for a(1)..a(N)

%p count:= 2:

%p V:= Vector(N):

%p for k from 4 by 2 while count < N do

%p if isprime(k) then next fi;

%p p:= spf(k);

%p if isprime(p) then

%p m:= numtheory:-pi(p);

%p if m <= N and V[m] = 0 and isprime(p+k) then

%p V[m]:= k; count:= count+1;

%p fi

%p fi

%p od:

%p convert(V,list);

%t sopfr[1] = 0; sopfr[n_] := Plus @@ Times @@@ FactorInteger[n]; seq[max_] := Module[{s = Table[0, {max}], c = 2, k = 3, p, ip}, While[c < max, k++; If[CompositeQ[k] && PrimeQ[(p = sopfr[k])] && PrimeQ[k + p] && (ip = PrimePi[p]) <= max && s[[ip]] == 0, c++; s[[ip]] = k]]; s]; seq[50] (* _Amiram Eldar_, Jul 22 2021 *)

%o (PARI) sopfr(n) = (n=factor(n))[, 1]~*n[, 2]; \\ A001414

%o a(n) = if (n<=2, return(0)); my(p=prime(n)); forcomposite(k=2,, if ((sopfr(k)==p) && isprime(k+p), return (k))); \\ _Michel Marcus_, Jul 22 2021

%Y Cf. A001414.

%K nonn,look

%O 1,3

%A _J. M. Bergot_ and _Robert Israel_, Jul 20 2021