login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A196874 Smallest prime(k) such that prime(k+n) - prime(k) is a perfect square. 3
2, 3, 43, 2, 7, 3, 61, 23, 17, 5, 109, 73, 67, 37, 19, 7, 3, 127, 73, 67, 31, 2, 277, 7, 3, 79, 89, 47, 53, 19, 13, 5, 151, 157, 1033, 73, 61, 31, 37, 307, 397, 1129, 163, 3, 103, 97, 613, 2, 587, 37, 13, 7, 197, 1009, 107, 137, 73, 613, 43, 23, 29, 13, 7, 193 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
COMMENTS
The corresponding indices k are in A196815.
LINKS
EXAMPLE
a(3) = 43 is the smallest initial prime of a subset of 4 consecutive primes {43, 47, 53, 59} such that 59 - 43 = 16 = 4^2.
MAPLE
A196874:= proc(n)
for k from 1 do
if issqr(ithprime(k+n)-ithprime(k)) then
return ithprime(k);
end if;
end do:
end proc:
seq(A196874(n), n=1..80) ; # (see A196815) R. J. Mathar, Oct 06 2011
MATHEMATICA
spk[n_]:=Module[{k=1}, While[!IntegerQ[Sqrt[Prime[n+k]-Prime[k]]], k++]; Prime[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++); prime(k); } \\ Michel Marcus, Dec 28 2015
CROSSREFS
Sequence in context: A101821 A121475 A334533 * A087571 A126018 A257467
KEYWORD
nonn
AUTHOR
Michel Lagneau, Oct 07 2011
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 9 18:10 EDT 2024. Contains 372354 sequences. (Running on oeis4.)