OFFSET
1,2
LINKS
M. F. Hasler, Table of n, a(n) for n = 1..10000
FORMULA
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
KEYWORD
nonn
AUTHOR
Henry Bottomley, Jul 05 2000
STATUS
approved