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!)
A054271 Difference between prime(n)^2 and the previous prime. 11
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
From Jean-Christophe Hervé, Oct 22 2013: (Start)
Contains only even numbers, except the first term.
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.
Conjecture: every other even integer appears in the sequence an infinite number of times. (End)
LINKS
FORMULA
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]
EXAMPLE
From Zak Seidov, Feb 20 2012: (Start)
n=4 and prime(4)^2=49, preceded by prime(15)=47, so a(4)=49-47=2;
n=97 and prime(97)^2=509^2=259081, preceded by prime(22765)=259033, so a(97)=259081-259033=48. (End)
MATHEMATICA
f[n_]:=Module[{n2=n^2}, n2-NextPrime[n2, -1]]; f/@Prime[Range[90]] (* Harvey P. Dale, Oct 19 2011 *)
PROG
(PARI) a(n) = my(p=prime(n)); p^2 - precprime(p^2); \\ Michel Marcus, Feb 27 2023
CROSSREFS
Sequence in context: A055921 A029605 A367189 * A278245 A321026 A240284
KEYWORD
nonn,easy
AUTHOR
Labos Elemer, May 05 2000
STATUS
approved

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 25 01:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)