login
Numbers n such that prime(n+1) - prime(n) = phi(n).
0

%I #12 Sep 09 2022 13:15:57

%S 1,3,8,9,12,18,24

%N Numbers n such that prime(n+1) - prime(n) = phi(n).

%C After 24, there are no more terms < 10^6. Are there any more terms?

%C This sequence is certainly finite and very likely complete; phi(n) is bounded below asymptotically by n/log log n * e^{-gamma}, while prime gaps are known to be bounded asymptotically above by p^{1/3} ~ (n log n)^(1/3). - _Franklin T. Adams-Watters_, Jul 27 2006

%e Prime(13) - prime(12) = 41 - 37 = 4 = phi(12), so 12 belongs to the sequence.

%t f[n_] := Prime[n + 1] - Prime[n]; Select[Range[1, 10^6], f[ # ] == EulerPhi[ # ] &]

%t PrimePi[#]&/@Select[Partition[Prime[Range[25]],2,1],#[[2]]-#[[1]]==EulerPhi[ PrimePi[ #[[1]]]]&][[All,1]] (* _Harvey P. Dale_, Sep 09 2022 *)

%K more,nonn,fini

%O 1,2

%A _Joseph L. Pe_, Jan 03 2002