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!)
A106044 Difference between n-th prime and next larger perfect square. 11

%I #26 Jan 25 2024 07:53:32

%S 2,1,4,2,5,3,8,6,2,7,5,12,8,6,2,11,5,3,14,10,8,2,17,11,3,20,18,14,12,

%T 8,17,13,7,5,20,18,12,6,2,23,17,15,5,3,28,26,14,2,29,27,23,17,15,5,32,

%U 26,20,18,12,8,6,31,17,13,11,7,30,24,14,12,8,2,33,27,21,17,11,3,40,32,22

%N Difference between n-th prime and next larger perfect square.

%C Can be read as a table, since there are always several primes between two squares, although this is the yet unproved Legendre's conjecture, cf. A014085. Whenever a(n+1) > a(n), the n-th prime is the largest one below a given square and prime(n+1) is the smallest prime larger than that square. For n > 1, these are also the indices where the parity of the terms changes. - _M. F. Hasler_, Oct 19 2018

%H Harvey P. Dale, <a href="/A106044/b106044.txt">Table of n, a(n) for n = 1..1000</a>

%e From _M. F. Hasler_, Oct 19 2018: (Start)

%e Written as a table, starting a new row when a square is reached, the sequence reads:

%e 2, 1, // 4 - {2, 3: primes between 1^2 = 1 and 2^2 = 4}

%e 4, 2, // 9 - {5, 7: primes between 2^2 = 4 and 3^2 = 9}

%e 5, 3, // 16 - {11, 13: primes between 3^2 = 9 and 4^2 = 16}

%e 8, 6, 2, // 25 - {17, 19, 23: primes between 4^2 = 16 and 5^2 = 25}

%e 7, 5, // 36 - {29, 31: primes between 5^2 = 25 and 6^2 = 36}

%e 12, 8, 6, 2,// 49 - {37, 41, 43, 47: primes between 6^2 = 36 and 7^2 = 49}

%e 11, 5, 3, // 64 - {53, 59, 61: primes between 7^2 = 49 and 8^2 = 64}

%e 14, 10, 8, 2, // 81 - {67, 71, 73, 79: primes between 8^2 = 64 and 9^2 = 81}

%e 17, 11, 3, // 100 - {83, 89, 97: primes between 9^2 = 81 and 10^2 = 100}

%e etc. (End)

%t lst={};Do[p=Prime[n];s=p^(1/2);f=Floor[s];a=(f+1)^2;d=a-p;AppendTo[lst,d],{n,6!}];lst (* _Vladimir Joseph Stephan Orlovsky_, Mar 11 2009 *)

%t (Floor[Sqrt[#]]+1)^2-#&/@Prime[Range[90]] (* _Harvey P. Dale_, Feb 08 2013 *)

%o (PARI) A106044(n)=(sqrtint(n=prime(n))+1)^2-n \\ _M. F. Hasler_, Oct 19 2018

%Y Cf. A158038 (analog for cubes).

%Y Read as a table, row lengths are A014085 (number of primes between squares).

%Y Row sums are A014085 * A000290(.+1) - A108314.

%K nonn,easy,tabf

%O 1,1

%A _Zak Seidov_, May 06 2005

%E Edited by _M. F. Hasler_, Oct 19 2018

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 01:35 EDT 2024. Contains 371964 sequences. (Running on oeis4.)