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.

A054271 Difference between prime(n)^2 and the previous prime.

This page as a plain text file.
%I A054271 #25 Feb 27 2023 13:37:57
%S A054271 1,2,2,2,8,2,6,2,6,2,8,2,12,2,2,6,12,2,6,2,6,12,6,2,6,8,2,2,14,6,2,2,
%T A054271 12,2,8,14,18,8,6,2,12,12,2,6,6,20,2,2,8,8,2,2,8,12,2,6,8,8,12,20,12,
%U A054271 2,20,18,2,6,14,2,8,12,8,2,6,6,12,6,18,30,12,12,18,2,8,12,24,2,2,6,14,6
%N A054271 Difference between prime(n)^2 and the previous prime.
%C A054271 From _Jean-Christophe Hervé_, Oct 22 2013: (Start)
%C A054271 Contains only even numbers, except the first term.
%C A054271 Even integers of the form 3*k+1 (or equivalently integers of form 6*k+4) never appear because prime(n)^2 = 3*k+1 = 1 (mod 3), and prime(n)^2 - (3*k+1) is multiple of 3.
%C A054271 Conjecture: every other even integer appears in the sequence an infinite number of times. (End)
%H A054271 Harvey P. Dale, <a href="/A054271/b054271.txt">Table of n, a(n) for n = 1..1000</a>
%F A054271 a(n) = prime(n)^2 - precprime(prime(n)^2), where precprime(x) is the largest prime less than x. [Corrected by _Jean-Christophe Hervé_, Oct 21 2013]
%e A054271 From _Zak Seidov_, Feb 20 2012: (Start)
%e A054271 n=4 and prime(4)^2=49, preceded by prime(15)=47, so a(4)=49-47=2;
%e A054271 n=97 and prime(97)^2=509^2=259081, preceded by prime(22765)=259033, so a(97)=259081-259033=48. (End)
%t A054271 f[n_]:=Module[{n2=n^2},n2-NextPrime[n2,-1]]; f/@Prime[Range[90]] (* _Harvey P. Dale_, Oct 19 2011 *)
%o A054271 (PARI) a(n) = my(p=prime(n)); p^2 - precprime(p^2); \\ _Michel Marcus_, Feb 27 2023
%Y A054271 Cf. A001248, A054270, A091666, A133517, A133518, A133519, A133520, A133521, A133522, A001223.
%K A054271 nonn,easy
%O A054271 1,2
%A A054271 _Labos Elemer_, May 05 2000