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.
%I A096501 #27 Jul 31 2025 07:18:38 %S A096501 0,4,1,0,2,0,2,0,0,0,4,0,2,0,0,0,4,0,2,0,0,0,4,0,0,0,0,0,6,0,2,0,0,0, %T A096501 0,0,6,0,0,0,4,0,2,0,0,0,4,0,0,0,0,0,6,0,0,0,0,0,6,0,2,0,0,0,0,0,6,0, %U A096501 0,0,4,0,2,0,0,0,0,0,6,0,0,0,4,0,0,0,0,0,6,0,0,0,0,0,0,0,8,0,0,0,4,0,2,0,0 %N A096501 Difference between primes preceding n+1 and n. %C A096501 Values a(1) = 0 and a(2) = 4 are based on convention in Mathematica-language that PreviousPrime(1) = PreviousPrime(2) = -2. - _Antti Karttunen_, Jan 03 2019 %H A096501 Antti Karttunen, <a href="/A096501/b096501.txt">Table of n, a(n) for n = 1..20000</a> %H A096501 Antti Karttunen, <a href="/A096501/a096501.txt">Data supplement: n, a(n) computed for n = 1..100000</a> %F A096501 For n > 2, a(n) = A010051(n) * A001223(A000720(n)-1) = A136548(1+n)-A136548(n). - _Antti Karttunen_, Jan 03 2019 %F A096501 a(n) = A007917(n) - A007917(n-1), for n > 2. - _Ridouane Oudra_, Oct 05 2024 %p A096501 0,4,seq(prevprime(n+1)-prevprime(n),n=3..150); # _Muniru A Asiru_, Jan 03 2019 %t A096501 Table[NextPrime[n+1, -1] - NextPrime[n, -1], {n, 1, 256}] %t A096501 Differences[NextPrime[Range[110],-1]] (* _Harvey P. Dale_, Jul 09 2017 *) %o A096501 (PARI) %o A096501 A136548(n) = if(n<3,1,precprime(n-1)); %o A096501 A096501(n) = if(2==n,4,A136548(1+n)-A136548(n)); \\ _Antti Karttunen_, Jan 03 2019 %Y A096501 Cf. A000720, A001223, A010051, A096500, A136548, A151799, A175851, A007917. %K A096501 nonn %O A096501 1,2 %A A096501 _Labos Elemer_, Jul 09 2004