login
If the smallest prime with a square excess of n is p then a(n)^2 = p - n.
3

%I #14 May 05 2019 09:10:26

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

%T 17,18,31,20,27,20,23,18,19,22,21,20,23,24,23,24,27,28,29,30,25,38,39,

%U 26,31,30,35,28,45,34,31,42,31,34,33,32,33,36,35,34,75,40,37,36,41,48,45

%N If the smallest prime with a square excess of n is p then a(n)^2 = p - n.

%H Ivan Neretin, <a href="/A056895/b056895.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) = sqrt(A056893(n)-n) = A000196(A056893(n)) = sqrt(A056894(n)).

%e a(4)=3 because the smallest prime with a square excess of 4 is 13 and 13 - 4 = 3^2.

%t 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 *)

%o (PARI) a(n) = {my(p=2); while(n != p-sqrtint(p)^2, p = nextprime(p+1)); sqrtint(p - n);} \\ _Michel Marcus_, May 05 2019

%Y Cf. A000040, A000196, A002496, A048760, A053186.

%Y Cf. A056892, A056893, A056894, A056896, A056897, A056898.

%K nonn

%O 1,3

%A _Henry Bottomley_, Jul 05 2000