login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A056892
a(n) = square excess of the n-th prime.
20
1, 2, 1, 3, 2, 4, 1, 3, 7, 4, 6, 1, 5, 7, 11, 4, 10, 12, 3, 7, 9, 15, 2, 8, 16, 1, 3, 7, 9, 13, 6, 10, 16, 18, 5, 7, 13, 19, 23, 4, 10, 12, 22, 24, 1, 3, 15, 27, 2, 4, 8, 14, 16, 26, 1, 7, 13, 15, 21, 25, 27, 4, 18, 22, 24, 28, 7, 13, 23, 25, 29, 35, 6, 12, 18, 22, 28, 36, 1, 9, 19, 21
OFFSET
1,2
LINKS
FORMULA
a(n) = A053186(A000040(n)).
a(n) = A000040(n) - A000006(n)^2. - M. F. Hasler, Oct 04 2009
EXAMPLE
a(5) = 2 since the 5th prime is 11 = 3^2 + 2.
From M. F. Hasler, Oct 19 2018: (Start)
Written as a table, starting a new row when a square is reached, the sequence reads:
1, 2, // = 2 - 1, 3 - 1 = {primes between 1^2 = 1 and 2^2 = 4} - 1
1, 3, // = 5 - 4, 7 - 4 = {primes between 2^2 = 4 and 3^2 = 9} - 4
2, 4, // = 11 - 9, 13 - 9 = {primes between 3^2 = 9 and 4^2 = 16} - 9
1, 3, 7, // = 17 - 16, 19 - 16, 23 - 16 = {primes between 16 and 25} - 16
4, 6, // = 29 - 25, 31 - 25 = {primes between 5^2 = 25 and 6^2 = 36} - 25
1, 5, 7, 11, // = {37, 41, 43, 47: primes between 6^2 = 36 and 7^2 = 49} - 36
4, 10, 12, // = {53, 59, 61: primes between 7^2 = 49 and 8^2 = 64} - 49
3, 7, 9, 15, // = {67, 71, 73, 79: primes between 8^2 = 64 and 9^2 = 81} - 64
2, 8, 16, // = {83, 89, 97: primes between 9^2 = 81 and 10^2 = 100} - 81
etc. (End)
MATHEMATICA
lst={}; Do[p=Prime[n]; s=p^(1/2); f=Floor[s]; a=f^2; d=p-a; AppendTo[lst, d], {n, 6!}]; lst (* Vladimir Joseph Stephan Orlovsky, Mar 11 2009 *)
#-Floor[Sqrt[#]]^2&/@Prime[Range[90]] (* Harvey P. Dale, Jul 06 2014 *)
PROG
(PARI) A056892(n)={my(p=prime(n)); p-sqrtint(p)^2} \\ M. F. Hasler, Oct 04 2009
CROSSREFS
When written as a table, row lengths are A014085, and row sums are A108314 - A014085 * A000290 = A320688.
Sequence in context: A023129 A007337 A167430 * A136523 A319855 A228731
KEYWORD
nonn
AUTHOR
Henry Bottomley, Jul 05 2000
STATUS
approved