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!)
A168152 a(n) = prime(prime(n)) - prime(n). 3

%I #21 Nov 16 2022 11:50:00

%S 1,2,6,10,20,28,42,48,60,80,96,120,138,148,164,188,218,222,264,282,

%T 294,322,348,372,412,446,460,480,490,504,582,608,636,658,710,726,762,

%U 804,824,858,884,906,962,978,1004,1018,1086,1186,1206,1218,1238,1260,1282

%N a(n) = prime(prime(n)) - prime(n).

%H G. C. Greubel, <a href="/A168152/b168152.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = A006450(n) - A000040(n).

%F a(n) ~ n (log n)^2. -_Charles R Greathouse IV_, May 25 2011

%p A168152 := proc(n) local p; p := ithprime(n) ; ithprime(p)-p ; end proc: seq(A168152(n),n=1..120) ; # _R. J. Mathar_, Nov 19 2009

%t Table[Prime[Prime[n]] - Prime[n], {n, 1, 100}] (* _G. C. Greubel_, Jul 14 2016 *)

%t Prime[#]-#&/@Prime[Range[100]] (* _Harvey P. Dale_, Nov 16 2022 *)

%o (Magma) [NthPrime(NthPrime(n))-NthPrime(n): n in [1..60]]; // _Vincenzo Librandi_, Jul 15 2016

%o (PARI) a(n) = my(p=prime(n)); prime(p) - p; \\ _Michel Marcus_, Mar 08 2022

%Y Cf. A000040, A006450.

%K nonn

%O 1,2

%A _Juri-Stepan Gerasimov_, Nov 19 2009

%E a(10) corrected by _R. J. Mathar_, Nov 19 2009

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 April 23 22:36 EDT 2024. Contains 371917 sequences. (Running on oeis4.)