OFFSET
1,2
COMMENTS
The corresponding primes are in A196874.
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(1) = 1 because prime(1) = 2 is the initial prime of a subset of 2 consecutive primes {2, 3} such that 3 - 2 = 1 = 1^2;
a(3) = 14 because prime(14) = 43 is the initial prime of a subset of 4 consecutive primes {43, 47, 53, 59} such that 59 - 43 = 16 = 4^2.
MAPLE
A196815 := proc(n)
for k from 1 do
if issqr(ithprime(k+n)-ithprime(k)) then
return k;
end if;
end do:
end proc:
seq(A196815(n), n=1..80) ; # R. J. Mathar, Oct 06 2011
MATHEMATICA
spk[n_]:=Module[{k=1}, While[!IntegerQ[Sqrt[Prime[n+k]-Prime[k]]], k++]; k]; Array[spk, 70] (* Harvey P. Dale, Jul 23 2012 *)
PROG
(PARI) a(n) = {my(k=1); while (! issquare(prime(k+n)- prime(k)), k++); k; } \\ Michel Marcus, Dec 28 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Michel Lagneau, Oct 06 2011
STATUS
approved