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

%I #48 Nov 02 2023 05:45:38

%S 1,3,8,5,12,11,18,51,82,49,234,23,42,75,86,231,174,107,288,63,80,69,

%T 102,325,166,765,128,143,822,727,276,597,226,835,702,461,254,693,592,

%U 797,1284,349,370,2337,596,645,3012,1033,590,4083,1490,757,882,833,1668

%N a(n) is the smallest positive number m such that m^2 + n is the next prime > m^2.

%C The primes are in A058056.

%H Zak Seidov, <a href="/A058055/b058055.txt">Table of n, a(n) for n = 1..500</a> (first 400 terms from T. D. Noe)

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

%F A053000(a(n)) = n. - _Zak Seidov_, Apr 12 2013

%e 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.

%p for m from 1 to 10^5 do

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

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

%p end do:

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

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

%p [seq(R[j],j=1..N)]; # _Robert Israel_, Aug 10 2012

%t 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 *)

%o (Sage)

%o R = {} # After _Robert Israel_'s Maple script.

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

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

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

%o L = sorted(R.keys())

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

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

%o [R[k] for k in (1..i)] # _Peter Luschny_, Aug 11 2012

%Y Cf. A053000, A070316, A070317.

%Y See A085099, A215249 for other versions.

%K nonn

%O 1,2

%A _Labos Elemer_, Nov 20 2000

%E Definition corrected by _Zak Seidov_, Mar 03 2008, and again by _Franklin T. Adams-Watters_, Aug 10 2012

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