[go: up one dir, main page]

login
A220095
n such that there are no primes between n - sqrt(n) and n.
0
1, 2, 11, 29, 125, 126, 127
OFFSET
1,2
COMMENTS
Conjecture: This sequence is complete.
MATHEMATICA
Select[Range[1000], PrimePi[# - 1] == PrimePi[# - Sqrt[#]] &] (* Alonso del Arte, Dec 04 2012 *)
PROG
(JavaScript)
function isprime(i) {
var i, j;
if (i == 1) return false;
if (i == 2) return true;
if (i % 2 == 0) return false;
for (j = 3; j <= Math.floor(Math.sqrt(i)); j += 2)
if (i % j == 0) return false;
return true;
}
for (n = 1; n < 100000; n++) {
for (k = Math.ceil(n - Math.sqrt(n)); k < n; k++) {
ip = false;
if (isprime(k)) {ip = true; break; }
}
if (!ip) document.write(n + ", ");
}
CROSSREFS
Cf. A035250.
Sequence in context: A295841 A086252 A106926 * A133558 A285812 A140745
KEYWORD
nonn,fini
AUTHOR
Jon Perry, Dec 04 2012
STATUS
approved