login
A345350
Even triangular numbers such that the next integer is nonprime.
1
0, 120, 300, 406, 496, 528, 666, 780, 1176, 1378, 1540, 1770, 2278, 2628, 3160, 3240, 3486, 3828, 4186, 4278, 5356, 5460, 5886, 6670, 6786, 7140, 7260, 7626, 7750, 8128, 8256, 9316, 9730, 10296, 10440, 10878, 11476, 11628, 12090, 12246, 12880, 13530, 14706, 15576
OFFSET
1,2
COMMENTS
Subsequence of A000217 (triangular numbers) and A014494 (even triangular numbers).
EXAMPLE
Even triangular numbers 6, 10, 28, 36, 66, and 78 are all followed by a prime number. Even triangular number 120 is followed by a composite number 121. Thus, a(1) = 120.
MATHEMATICA
Select[Table[n (n + 1)/2, {n, 0, 200}], EvenQ[#] && ! PrimeQ[# + 1] &]
PROG
(Python)
from sympy import isprime
def A014494(n): return (2*n+1)*(2*n+1-(-1)**n)//2
def ok(et): return not isprime(et+1)
print(list(filter(ok, (A014494(n) for n in range(90))))) # Michael S. Branicky, Jun 15 2021
(PARI) lista(nn) = for (n=1, nn, my(t=n*(n+1)/2); if (!(t%2) && !isprime(t+1), print1(t, ", "))) \\ Michel Marcus, Jun 16 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Tanya Khovanova, Jun 15 2021
STATUS
approved