05AB1E, 4 bytes
All of the following programs work:
ÅTθQ
ÅTI¢
ÅTIå
ÅTs¢
ÅTså
ÅT¹¢
ÅT¹å
Try eachTry and every singleevery onesingle ofone theseof programsthese online!programs online!
ÅT
is all triangular numbers \$≤\$ implicit input, θ
is last element (a[-1]
), Q
is equality (a==b
), I
and ¹
are input (input()
), ¢
is occurrences (a.count(b)
), and å
is membership (b in a
).