Displaying 1-10 of 19 results found.
Number of primes between n^2 and (n+1)^2.
+10
114
0, 2, 2, 2, 3, 2, 4, 3, 4, 3, 5, 4, 5, 5, 4, 6, 7, 5, 6, 6, 7, 7, 7, 6, 9, 8, 7, 8, 9, 8, 8, 10, 9, 10, 9, 10, 9, 9, 12, 11, 12, 11, 9, 12, 11, 13, 10, 13, 15, 10, 11, 15, 16, 12, 13, 11, 12, 17, 13, 16, 16, 13, 17, 15, 14, 16, 15, 15, 17, 13, 21, 15, 15, 17, 17, 18, 22, 14, 18, 23, 13
COMMENTS
Suggested by Legendre's conjecture (still open) that for n > 0 there is always a prime between n^2 and (n+1)^2.
Legendre's conjecture may be written pi((n+1)^2) - pi(n^2) > 0 for all positive n, where pi(n) = A000720(n), [the prime counting function]. - Jonathan Vos Post, Jul 30 2008 [Comment corrected by Jonathan Sondow, Aug 15 2008]
Legendre's conjecture can be generalized as follows: for all integers n > 0 and all real numbers k > K, there is a prime in the range n^k to (n+1)^k. The constant K is conjectured to be log(127)/log(16). See A143935. - T. D. Noe, Sep 05 2008
REFERENCES
J. R. Goldman, The Queen of Mathematics, 1998, p. 82.
FORMULA
Conjecture: for all n>1, abs(a(n)-(n/log(n))) < sqrt(n). - Alain Rocchelli, Sep 20 2023
EXAMPLE
a(17) = 5 because between 17^2 and 18^2, i.e., 289 and 324, there are 5 primes (which are 293, 307, 311, 313, 317).
MATHEMATICA
Table[PrimePi[(n + 1)^2] - PrimePi[n^2], {n, 0, 80}] (* Lei Zhou, Dec 01 2005 *)
Differences[PrimePi[Range[0, 90]^2]] (* Harvey P. Dale, Nov 25 2015 *)
PROG
(Haskell)
a014085 n = sum $ map a010051 [n^2..(n+1)^2]
(Python)
from sympy import primepi
def a(n): return primepi((n+1)**2) - primepi(n**2)
CROSSREFS
Cf. A000006, A053000, A053001, A007491, A077766, A077767, A108954, A000720, A060715, A104272, A143223, A143224, A143225, A143226, A143227.
Smallest prime > n^2.
(Formerly M1389)
+10
32
2, 5, 11, 17, 29, 37, 53, 67, 83, 101, 127, 149, 173, 197, 227, 257, 293, 331, 367, 401, 443, 487, 541, 577, 631, 677, 733, 787, 853, 907, 967, 1031, 1091, 1163, 1229, 1297, 1373, 1447, 1523, 1601, 1693, 1777, 1861, 1949, 2027, 2129, 2213, 2309, 2411, 2503
COMMENTS
Suggested by Legendre's conjecture (still open) that there is always a prime between n^2 and (n+1)^2.
Conjectures:
1) There is always a prime p between n^2 and n^2+n (verified up to 13*10^6).
2) a(n) is the smallest prime p such that n^2 < p < n^2+n; a(n) < n^2+n.
3) For all numbers k >= 1 there is the smallest number m > 2*(k+1) such that for all numbers n >= m there is always a prime p between n^2 and n^2 + n - 2k. Sequence of numbers m for k >= 1: 6, 8, 12, 13, 14, 24, 24, 24, 30, 30, 30, 31, 33, 35, 43, ...; lim_{k->oo} m/2k = 1. Example: k=2; for all numbers n >= 8 there is always a prime p between n^2 and n^2 + n - 4. (End)
REFERENCES
Archimedeans Problems Drive, Eureka, 24 (1961), 20.
J. R. Goldman, The Queen of Mathematics, 1998, p. 82.
G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 19.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
MAPLE
[seq(nextprime(i^2), i=1..100)];
PROG
(PARI) vector(100, i, nextprime(i^2))
(Haskell)
(Python)
from sympy import nextprime
def a(n): return nextprime(n**2)
3, 7, 13, 23, 31, 47, 61, 79, 97, 113, 139, 167, 193, 223, 251, 283, 317, 359, 397, 439, 479, 523, 571, 619, 673, 727, 773, 839, 887, 953, 1021, 1087, 1153, 1223, 1291, 1367, 1439, 1511, 1597, 1669, 1759, 1847, 1933, 2017, 2113, 2207, 2297, 2399, 2477, 2593
COMMENTS
Suggested by Legendre's conjecture (still open) that there is always a prime between n^2 and (n+1)^2.
Legendre's conjecture is equivalent to a(n) > (n-1)^2. - John W. Nicholson, Dec 11 2013
REFERENCES
J. R. Goldman, The Queen of Mathematics, 1998, p. 82.
MAPLE
[seq(prevprime(i^2), i=2..100)];
PROG
(Haskell)
(Python)
from sympy import prevprime
def a(n): return prevprime(n*n)
Smallest integer d such that n^2 + d^2 is a prime number.
+10
19
1, 1, 2, 1, 2, 1, 2, 3, 4, 1, 4, 7, 2, 1, 2, 1, 2, 5, 6, 1, 4, 5, 8, 1, 4, 1, 2, 5, 4, 11, 4, 3, 2, 5, 2, 1, 2, 3, 10, 1, 4, 5, 8, 9, 2, 5, 2, 13, 4, 7, 4, 3, 10, 1, 4, 1, 2, 3, 6, 13, 10, 3, 32, 9, 2, 1, 2, 5, 10, 3, 6, 5, 2, 1, 4, 5, 10, 7, 4, 7, 4, 3, 18, 1, 2, 9, 2, 3, 4, 1, 4, 7, 8, 1, 2, 5, 2, 3, 4, 3
COMMENTS
With i being the imaginary unit, n + di is the smallest Gaussian prime with real part n and a positive imaginary part. Likewise for n - di. See A002145 for Gaussian primes with imaginary part 0. - Alonso del Arte, Feb 07 2011
Conjecture: a(n) does not exceed 4*sqrt(n+1) for any positive integer n. - Zhi-Wei Sun, Apr 15 2013
Conjecture holds for the first 15*10^6 terms. - Joerg Arndt, Aug 19 2014
Infinitely many d exist such that n^2 + d^2 is prime, under Schinzel's Hypothesis H; see Sierpinski (1988), p. 221. - Jonathan Sondow, Nov 09 2015
REFERENCES
W. Sierpinski, Elementary Theory of Numbers, 2nd English edition, revised and enlarged by A. Schinzel, Elsevier, 1988.
EXAMPLE
a(5)=2 because 2 is the smallest integer d such that 5^2+d^2 is a prime number.
MAPLE
f:= proc(n) local d;
for d from 1+(n mod 2) by 2 do
if isprime(n^2+d^2) then return d fi
od
end proc:
f(1):= 1:
MATHEMATICA
imP4P[n_] := Module[{k = 1}, While[Not[PrimeQ[n^2 + k^2]], k++]; k]; Table[imP4P[n], {n, 50}] (* Alonso del Arte, Feb 07 2011 *)
CROSSREFS
Cf. A068486 (lists the prime numbers n^2 + d^2).
Least natural number k such that k^2 + n is prime.
+10
13
1, 1, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 2, 1, 6, 1, 2, 3, 4, 1, 6, 7, 2, 9, 2, 1, 12, 1, 4, 3, 2, 3, 6, 1, 2, 3, 2, 1, 24, 1, 2, 3, 4, 1, 6, 5, 2, 3, 4, 1, 6, 5, 2, 9, 2, 1, 18, 1, 6, 3, 2, 3, 6, 1, 2, 9, 2, 1, 6, 1, 4, 3, 2, 5, 6, 1, 2, 3, 4, 1, 12, 5, 2
COMMENTS
First values of k and n such that k > 100 are: k=114, n=6041; for k > 200: k=210, n=26171; for k > 300: k=357, n=218084; for k > 400: k=402, n=576239.
Additionally, for k > 500: k=585, n=3569114; for k > 600: k=630, n=3802301; for k > 700: k=744, n=24307841; for k > 800: k=855, n=25051934; for k > 900: k=1008, n=54168539. Other cases k > 900: k=945, n=74380946, k=915, n=89992964, k=939, n=118991066. - Zak Seidov, May 23 2007
MAPLE
a:= proc(n) local d, t; d, t:= 1, n+1; while not
isprime(t) do d:= d+2; t:= t+d od; (d+1)/2
end:
MATHEMATICA
Table[i = 1; While[! PrimeQ[i^2 + n], i++]; i, {n, 85}] (* Jayanta Basu, Apr 24 2013 *)
Difference between n^2 and average of smallest prime greater than n^2 and largest prime less than n^2.
+10
7
0, 0, 1, -1, 2, -1, 0, 0, 1, 1, 0, -1, 1, 0, 2, 1, 0, -2, 1, 0, 1, -3, 2, 0, 1, -1, 4, -5, 3, 1, -2, 0, -2, -1, 2, -1, 1, 4, 1, 0, -4, -5, -5, 3, -5, -1, 1, -4, 10, 0, 1, -2, 3, -5, 7, 9, -2, 1, 0, -2, 4, -9, 0, 1, 3, 1, -5, -10, 4, -4, 0, 1, 2, -6, 12, -4, 0, 3, -9, 3, -2, -2, 6, 1, -6, 2, -3
COMMENTS
Conjecture: the most frequent value will be 1 (including sequence variants with any even power n^2k). - Bill McEachen, Dec 12 2022
EXAMPLE
a(4)=1 because smallest prime greater than 4^2 is 17, largest prime less than 4^2 is 13, average of 17 and 13 is 15 and 16-15=1.
MAPLE
with(numtheory): A056929 := n-> n^2-(prevprime(n^2)+nextprime(n^2))/2);
MATHEMATICA
Array[# - Mean@ {NextPrime[#], NextPrime[#, -1]} &[#^2] &, 87, 2] (* Michael De Vlieger, May 20 2018 *)
PROG
(PARI) a(n) = n^2 - (nextprime(n^2) + precprime(n^2))/2; \\ Michel Marcus, May 20 2018
Difference between n-th oblong (promic) number, n(n+1), and the average of the smallest prime greater than n^2 and the largest prime less than (n+1)^2.
+10
5
0, 0, 0, 0, 0, -1, -1, 0, 3, -1, -2, -1, 0, 1, 2, 1, -3, -2, 0, 1, 1, -4, 2, -2, 0, 3, -1, 0, 0, -2, -3, 0, -3, 0, 0, 0, 3, 0, 5, -4, -6, -5, -3, 0, -6, 1, -2, 6, 2, -2, 1, -2, 0, 1, 9, 0, 2, -2, -3, 2, -1, -9, 1, 1, 2, -1, -6, -6, -1, -3, 0, 0, 0, 6, -1, -3, 3, -2, -7, 1, -2, 1, 2, -1, -4
COMMENTS
a(1)=-0.5 which is not an integer
EXAMPLE
a(4)=0 because smallest prime greater than 4^2 is 17, largest prime less than 5^2 is 23, average of 17 and 23 is 20 and 4*5-20=0
MAPLE
with(numtheory): A056931 := n-> n*(n+1)-(prevprime((n+1)^2)+nextprime(n^2))/2);
a(n) is the smallest positive number m such that m^2 + n is the next prime > m^2.
+10
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
FORMULA
a(n) = Min{ m > 0 | m^2 + n is the next prime after m^2}.
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:
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)
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
Distance from n^2 to closest prime.
+10
5
1, 1, 2, 1, 2, 1, 2, 3, 2, 1, 6, 5, 2, 1, 2, 1, 4, 7, 2, 1, 2, 3, 6, 1, 6, 1, 2, 3, 2, 7, 6, 3, 2, 3, 2, 1, 2, 3, 2, 1, 12, 5, 2, 3, 2, 3, 2, 5, 2, 3, 8, 3, 6, 1, 2, 1, 2, 3, 10, 7, 2, 3, 2, 3, 4, 1, 4, 3, 2, 3, 2, 5, 4, 1, 2, 3, 2, 5, 6, 3, 2, 5, 6, 1, 4, 3, 4, 3, 2, 1, 6, 3, 2, 1, 4, 5, 4, 3, 2, 7, 8, 5, 2
EXAMPLE
n=1: n^2=1 has next prime 2, so a(1)=1;
n=11: n^2=121 is between primes {113,127} and closer to 127, thus a(11)=6.
MAPLE
seq((s-> min(nextprime(s)-s, `if`(s>2, s-prevprime(s), [][])))(n^2), n=1..256); # edited by Alois P. Heinz, Jul 16 2017
MATHEMATICA
Table[Function[k, Min[k - #, NextPrime@ # - k] &@ If[n == 1, 0, Prime@ PrimePi@ k]][n^2], {n, 103}] (* Michael De Vlieger, Jul 15 2017 *)
Min[#-NextPrime[#, -1], NextPrime[#]-#]&/@(Range[110]^2) (* Harvey P. Dale, Jun 26 2021 *)
PROG
(PARI) a(n) = if (n==1, nextprime(n^2) - n^2, min(n^2 - precprime(n^2), nextprime(n^2) - n^2)); \\ Michel Marcus, Jul 16 2017
Average of the smallest prime greater than n^2 and the largest prime less than n^2.
+10
4
4, 9, 15, 26, 34, 50, 64, 81, 99, 120, 144, 170, 195, 225, 254, 288, 324, 363, 399, 441, 483, 532, 574, 625, 675, 730, 780, 846, 897, 960, 1026, 1089, 1158, 1226, 1294, 1370, 1443, 1517, 1599, 1681, 1768, 1854, 1941, 2022, 2121, 2210, 2303, 2405, 2490
EXAMPLE
a(4)=15 because the smallest prime greater than 4^2 is 17, the largest prime less than 4^2 is 13, and the average of 17 and 13 is 15.
PROG
(PARI) a(n) = (nextprime(n^2) + precprime(n^2))/2; \\ Michel Marcus, May 20 2018
Search completed in 0.011 seconds
|