|
|
A056895
|
|
If the smallest prime with a square excess of n is p then a(n)^2 = p - n.
|
|
3
|
|
|
1, 1, 2, 3, 6, 5, 4, 9, 8, 7, 6, 7, 10, 15, 8, 9, 24, 11, 12, 21, 16, 13, 12, 13, 16, 15, 14, 17, 18, 31, 20, 27, 20, 23, 18, 19, 22, 21, 20, 23, 24, 23, 24, 27, 28, 29, 30, 25, 38, 39, 26, 31, 30, 35, 28, 45, 34, 31, 42, 31, 34, 33, 32, 33, 36, 35, 34, 75, 40, 37, 36, 41, 48, 45
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
a(4)=3 because the smallest prime with a square excess of 4 is 13 and 13 - 4 = 3^2.
|
|
MATHEMATICA
|
a = {}; Do[p = 2; While[n != p - (r = Floor@Sqrt[p])^2, p = NextPrime[p]]; AppendTo[a, r], {n, 74}]; a (* Ivan Neretin, May 02 2019 *)
|
|
PROG
|
(PARI) a(n) = {my(p=2); while(n != p-sqrtint(p)^2, p = nextprime(p+1)); sqrtint(p - n); } \\ Michel Marcus, May 05 2019
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|