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!)
A058055 a(n) is the smallest positive number m such that m^2 + n is the next prime > m^2. 5
1, 3, 8, 5, 12, 11, 18, 51, 82, 49, 234, 23, 42, 75, 86, 231, 174, 107, 288, 63, 80, 69, 102, 325, 166, 765, 128, 143, 822, 727, 276, 597, 226, 835, 702, 461, 254, 693, 592, 797, 1284, 349, 370, 2337, 596, 645, 3012, 1033, 590, 4083, 1490, 757, 882, 833, 1668 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

The primes are in A058056.

LINKS

T. D. Noe and Zak Seidov, Table of n, a(n) for n = 1..500 (first 400 terms from T. D. Noe)

FORMULA

a(n) = Min{ m > 0 | m^2 + n is the next prime after m^2}.

A053000(a(n)) = n. - Zak Seidov, Apr 12 2013

EXAMPLE

n=6: a(6)=11 and 11^2+6 is 127, a prime; n=97: a(97) = 2144 and 2144^2+97 = 4596833, the least prime of the form m^2+97.

MAPLE

for m from 1 to 10^5 do

   r:= nextprime(m^2)-m^2;

   if not assigned(R[r]) then R[r]:= m end if;

end do:

J:= map(op, {indices(R)}):

N:= min({$1..J[-1]} minus J)-1:

[seq(R[j], j=1..N)]; # Robert Israel, Aug 10 2012

MATHEMATICA

nn = 100; t = Table[0, {nn}]; found = 0; m = 0; While[found < nn, m++; k = NextPrime[m^2] - m^2; If[k <= nn && t[[k]] == 0, t[[k]] = m; found++]]; t (* T. D. Noe, Aug 10 2012 *)

PROG

(Sage)

R = {}   # After Robert Israel's Maple script.

for m in (1..2^12) :

    r = next_prime(m^2) - m^2

    if r not in R : R[r] = m

L = sorted(R.keys())

for i in (1..len(L)-1) :

    if L[i] != L[i-1]+1 : break

[R[k] for k in (1..i)]  # Peter Luschny, Aug 11, 2012

CROSSREFS

Cf. A053000, A070316, A070317.

See A085099, A215249 for other versions.

Sequence in context: A323707 A291186 A347942 * A229598 A078356 A050093

Adjacent sequences:  A058052 A058053 A058054 * A058056 A058057 A058058

KEYWORD

nonn

AUTHOR

Labos Elemer, Nov 20 2000

EXTENSIONS

Definition corrected by Zak Seidov, Mar 03 2008, and again by Franklin T. Adams-Watters, Aug 10 2012

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 August 13 14:01 EDT 2022. Contains 356091 sequences. (Running on oeis4.)