A237710 Least prime p < n with pi(n-p) a square, or 0 if such a prime p does not exist.
0, 0, 2, 2, 3, 5, 5, 7, 2, 2, 2, 2, 3, 5, 5, 7, 7, 11, 11, 11, 11, 13, 13, 17, 2, 2, 2, 2, 2, 2, 3, 5, 5, 7, 7, 11, 11, 11, 11, 13, 13, 17, 17, 17, 17, 19, 19, 23, 23, 23, 23, 29, 29, 29, 2, 2, 2, 2, 2, 2, 3, 5, 5, 7, 7, 11, 11, 11, 11, 13
Offset: 1
Keywords
Examples
a(5) = 3 since pi(5-3) = 1^2, but pi(5-2) = 2 is not a square.
Links
- Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
- Z.-W. Sun, Problems on combinatorial properties of primes, arXiv:1402.6641, 2014
Programs
-
Mathematica
SQ[n_]:=IntegerQ[Sqrt[n]] q[n_]:=SQ[PrimePi[n]] Do[Do[If[q[n-Prime[k]],Print[n," ",Prime[k]];Goto[aa]],{k,1,PrimePi[n-1]}]; Print[n," ",0];Label[aa];Continue,{n,1,100}] lp[n_]:=Module[{p=2},While[!IntegerQ[Sqrt[PrimePi[n-p]]],p=NextPrime[p]];p]; Join[{0,0},Array[ lp,80,3]] (* Harvey P. Dale, Jan 28 2024 *)
Comments