The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A072917 a(n) = p(n) - phi(n), where p(n) is the least prime greater than phi(n). 2

%I #10 Aug 23 2017 06:07:47

%S 1,1,1,1,1,1,1,1,1,1,1,1,1,1,3,3,1,1,1,3,1,1,1,3,3,1,1,1,1,3,1,1,3,1,

%T 5,1,1,1,5,1,1,1,1,3,5,1,1,1,1,3,5,5,1,1,1,5,1,1,1,1,1,1,1,5,5,3,1,5,

%U 3,5,1,5,1,1,1,1,1,5,1,5,5,1,1,5,3,1,3,1,1,5,1,3,1,1,1,5,1,1,1,1

%N a(n) = p(n) - phi(n), where p(n) is the least prime greater than phi(n).

%H Antti Karttunen, <a href="/A072917/b072917.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = A013632(A000010(n)). - _Antti Karttunen_, Aug 22 2017

%e phi(15) = 8 and the least prime > 8 is 11; hence a(15) = 11 - 8 = 3.

%t a[n_] := Module[{r, p}, p = EulerPhi[n]; r = p + 1; While[ ! PrimeQ[r], r = r + 1]; r - p]; Table[a[i], {i, 1, 100}]

%t lpg[n_]:=Module[{ep=EulerPhi[n]},NextPrime[ep]-ep]; Array[lpg,200] (* _Harvey P. Dale_, May 29 2017 *)

%o (PARI) A072917(n) = (nextprime(1+eulerphi(n)) - eulerphi(n)); \\ _Antti Karttunen_, Aug 22 2017

%Y Cf. A000010, A013632, A072344.

%K easy,nonn

%O 1,15

%A _Joseph L. Pe_, Aug 11 2002

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 11 01:41 EDT 2024. Contains 373283 sequences. (Running on oeis4.)