OFFSET
2,3
FORMULA
MATHEMATICA
Table[T=n(n+1)/2; T-If[PrimeQ[T], T, NextPrime[T, -1]], {n, 2, 86}] (* James C. McMahon, Sep 27 2024 *)
PROG
(PARI) a(n) = my(t=n*(n+1)/2); t - precprime(t)
(Python)
from sympy import prevprime
def A375752(n): return (t:=n*(n+1)//2) - prevprime(t) # Karl-Heinz Hofmann, Aug 27 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Hugo Pfoertner, Aug 26 2024
STATUS
approved