OFFSET
1,10
COMMENTS
This sequence studies the special case of Bertrand's postulate where n is a square and p of the form k^2+1.
Conjecture: Except for n = 7, between the square of an integer n > 1 and the double of its square there is always at least one prime number of the form k^2+1.
The following table shows the first 15 cases, with p prime of the form k^2+1.
+----+-------+-------+-----------------------------+------+
| n | n^2 | 2*n^2 | p such that n^2 < p < 2*n^2 | a(n) |
+----+-------+-------+-----------------------------+------+
| 1 | 1 | 2 | --------------------------- | 0 |
| 2 | 4 | 8 | 5 | 1 |
| 3 | 9 | 18 | 17 | 1 |
| 4 | 16 | 32 | 17 | 1 |
| 5 | 25 | 50 | 37 | 1 |
| 6 | 36 | 72 | 37 | 1 |
| 7 | 49 | 98 | --------------------------- | 0 |
| 8 | 64 | 128 | 101 | 1 |
| 9 | 81 | 162 | 101 | 1 |
| 10 | 100 | 200 | 101, 197 | 2 |
| 11 | 121 | 242 | 197 | 1 |
| 12 | 144 | 288 | 197, 257 | 2 |
| 13 | 169 | 338 | 197, 257 | 2 |
| 14 | 196 | 392 | 197, 257 | 2 |
| 15 | 225 | 450 | 257, 401 | 2 |
LINKS
Michel Lagneau, Table of n, a(n) for n = 1..1000
EXAMPLE
a(20) = 3 because there are 3 prime numbers of the form k^2+1 between 20^2 and 2*20^2. We obtain 400 < 401, 577, 677 < 800.
MAPLE
nn:=90:
for n
from 1 to nn do:
n1:=n^2:n2:=2*n^2:it:=0:
for p from n1+1 to n2-1 do:
p1:=sqrt(p-1):p2:=floor(p1):
if isprime(p) and p1=p2
then
it:=it+1:
else
fi:
od:
printf(`%d, `, it):
od:
PROG
(PARI) a(n) = my(nb=0); forprime(p=n^2+1, 2*n^2-1, if (issquare(p-1), nb++)); nb; \\ Michel Marcus, Feb 22 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Feb 21 2023
STATUS
approved
