login
A375754
a(n) is the difference between the next greater square of a prime and n*(n+1)/2.
3
4, 3, 1, 3, 15, 10, 4, 21, 13, 4, 66, 55, 43, 30, 16, 1, 33, 16, 118, 99, 79, 58, 36, 13, 61, 36, 10, 151, 123, 94, 64, 33, 1, 280, 246, 211, 175, 138, 100, 61, 21, 100, 58, 15, 379, 334, 288, 241, 193, 144, 94, 43, 303, 250, 196, 141, 85, 28, 138, 79, 19, 318, 256
OFFSET
0,1
EXAMPLE
a(0) = A001248(1) - A000217(0) = 2^2 - 0 = 4,
a(1) = A001248(1) - A000217(1) = 2^2 - 1 = 3,
a(2) = A001248(1) - A000217(2) = 2^2 - 3 = 1,
a(3) = A001248(2) - A000217(3) = 3^2 - 6 = 3.
PROG
(PARI) a375754(n) = my(t=n*(n+1)/2, s=sqrtint(t), p=nextprime(s)); if(p^2-t < 0, p=nextprime(p+1)); p^2-t
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Hugo Pfoertner, Aug 26 2024
STATUS
approved