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!)
A196815 Smallest index k such that prime(k+n) - prime(k) is a perfect square. 3

%I #20 Dec 28 2015 16:58:31

%S 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,

%T 15,16,8,6,3,36,37,174,21,18,11,12,63,78,189,38,2,27,25,112,1,107,12,

%U 6,4,45,169,28,33,21,112,14,9,10,6,4,44,37,153,151,29,27

%N Smallest index k such that prime(k+n) - prime(k) is a perfect square.

%C The corresponding primes are in A196874.

%H Robert Israel, <a href="/A196815/b196815.txt">Table of n, a(n) for n = 1..10000</a>

%e 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;

%e 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.

%p A196815 := proc(n)

%p for k from 1 do

%p if issqr(ithprime(k+n)-ithprime(k)) then

%p return k;

%p end if;

%p end do:

%p end proc:

%p seq(A196815(n),n=1..80) ; # _R. J. Mathar_, Oct 06 2011

%t spk[n_]:=Module[{k=1},While[!IntegerQ[Sqrt[Prime[n+k]-Prime[k]]],k++];k]; Array[spk, 70] (* _Harvey P. Dale_, Jul 23 2012 *)

%o (PARI) a(n) = {my(k=1); while (! issquare(prime(k+n)- prime(k)), k++); k;} \\ _Michel Marcus_, Dec 28 2015

%Y Cf. A000040.

%K nonn

%O 1,2

%A _Michel Lagneau_, Oct 06 2011

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 April 25 03:15 EDT 2024. Contains 371964 sequences. (Running on oeis4.)