OFFSET
2,2
COMMENTS
From David W. Wilson, Jan 08 2017: (Start)
a(n)^2 = A076956(n).
A014085(a(n)) = n.
Conjecturally, a(n) is undefined for n = 1 and defined for all n >= 2. (End)
LINKS
T. D. Noe and David W. Wilson, Table of n, a(n) for n = 2..10000 (a(n) for n = 2..1000 from T. D. Noe).
MAPLE
a := proc(n) local k, h, SEARCHLIMIT; SEARCHLIMIT := 10000; h := proc(k) option remember; nops(select(j->isprime(j), [$k^2+1..(k+1)^2])) end: k := 1; while h(k) <> n and k < SEARCHLIMIT do k := k+1 od; `if`(k=SEARCHLIMIT, print("Search limit reached!"), k) end: seq(a(n), n=2..56); # Peter Luschny, Jan 10 2017
MATHEMATICA
Table[k = 1; While[Count[Map[PrimeQ, Range[k^2 + 1, (k + 1)^2]], True] != n, k++]; k, {n, 2, 56}] (* Michael De Vlieger, Jan 10 2017 *)
With[{pp=Table[Count[Range[n^2+1, (n+1)^2-1], _?(PrimeQ[#]&)], {n, 500}]}, Table[ Position[pp, k, 1, 1], {k, 60}]]//Flatten (* Harvey P. Dale, Aug 01 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Oct 20 2002
EXTENSIONS
More terms from Ralf Stephan, Oct 31 2002
STATUS
approved