login
Difference between n-th prime squared and n-th perfect square.
2

%I #15 Sep 08 2022 08:45:18

%S 3,5,16,33,96,133,240,297,448,741,840,1225,1512,1653,1984,2553,3192,

%T 3397,4128,4641,4888,5757,6360,7345,8784,9525,9880,10665,11040,11869,

%U 15168,16137,17680,18165,20976,21505,23280,25125,26368,28329,30360

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

%H G. C. Greubel, <a href="/A106588/b106588.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = prime(n)^2 - n^2.

%e a(5) = 96 because 121 (fifth prime^2) - 25 (fifth square) = 96.

%t Table[Prime[n]^2 - n^2, {n, 50}]

%o (Magma) [NthPrime(n)^2 - n^2: n in [1..50]]; // _G. C. Greubel_, Sep 07 2021

%o (Sage) [nth_prime(n)^2 - n^2 for n in (1..50)] # _G. C. Greubel_, Sep 07 2021

%o (PARI) a(n) = prime(n)^2 - n^2; \\ _Michel Marcus_, Sep 08 2021

%Y Cf. A000290, A001248, A014688, A075526, A076368.

%K easy,nonn

%O 1,1

%A _Alexandre Wajnberg_, May 10 2005

%E Extended by _Ray Chandler_, May 13 2005