|
|
A196815
|
|
Smallest index k such that prime(k+n) - prime(k) is a perfect square.
|
|
3
|
|
|
1, 2, 14, 1, 4, 2, 18, 9, 7, 3, 29, 21, 19, 12, 8, 4, 2, 31, 21, 19, 11, 1, 59, 4, 2, 22, 24, 15, 16, 8, 6, 3, 36, 37, 174, 21, 18, 11, 12, 63, 78, 189, 38, 2, 27, 25, 112, 1, 107, 12, 6, 4, 45, 169, 28, 33, 21, 112, 14, 9, 10, 6, 4, 44, 37, 153, 151, 29, 27
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,2
|
|
COMMENTS
|
The corresponding primes are in A196874.
|
|
LINKS
|
|
|
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
|
for k from 1 do
if issqr(ithprime(k+n)-ithprime(k)) then
return k;
end if;
end do:
end proc:
|
|
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
|
|
|
STATUS
|
approved
|
|
|
|