cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A105161 Difference between n and the second-smallest prime larger than n.

This page as a plain text file.
%I A105161 #14 Mar 02 2021 15:54:45
%S A105161 3,2,3,4,3,6,5,6,5,4,3,6,5,6,5,4,3,6,5,10,9,8,7,8,7,6,5,4,3,8,7,10,9,
%T A105161 8,7,6,5,6,5,4,3,6,5,10,9,8,7,12,11,10,9,8,7,8,7,6,5,4,3,8,7,10,9,8,7,
%U A105161 6,5,6,5,4,3,8,7,10,9,8,7,6,5,10,9,8,7,14,13,12,11,10,9,12,11,10,9,8,7,6,5
%N A105161 Difference between n and the second-smallest prime larger than n.
%H A105161 Charles R Greathouse IV, <a href="/A105161/b105161.txt">Table of n, a(n) for n = 0..10000</a>
%F A105161 a(n) = prime(pi(n)+2) - n.
%p A105161 with(numtheory); A105161:=n->ithprime(pi(n) + 2); seq(A105161(n), n=0..100); # _Wesley Ivan Hurt_, Feb 26 2014
%t A105161 Table[Prime[PrimePi[n] + 2], {n, 0, 100}] (* _Wesley Ivan Hurt_, Feb 26 2014 *)
%o A105161 (PARI) a(n) = prime(primepi(n)+2) - n; \\ _Michel Marcus_, Oct 09 2013
%o A105161 (PARI) a(n)=nextprime(nextprime(n+1)+1)-n \\ _Charles R Greathouse IV_, Oct 09 2013
%o A105161 (Python)
%o A105161 from sympy import nextprime
%o A105161 def a(n): return nextprime(nextprime(n)) - n
%o A105161 print([a(n) for n in range(97)]) # _Michael S. Branicky_, Mar 02 2021
%Y A105161 Cf. A101300.
%K A105161 nonn,easy
%O A105161 0,1
%A A105161 _Zak Seidov_, Apr 29 2005