Skip to main content
added 123 characters in body
Source Link
Giuseppe
  • 29.4k
  • 3
  • 33
  • 106

R, 32 31 29 bytes

function(n)n%in%choose(3:n,3) 

Try it online!

Based on the observation on wiki or OEIS that \$Te_n={{n+2}\choose{3}}\$; : ranges downwards for the case of \$n=1\$.

R, 32 31 29 bytes

function(n)n%in%choose(3:n,3) 

Try it online!

R, 32 31 29 bytes

function(n)n%in%choose(3:n,3) 

Try it online!

Based on the observation on wiki or OEIS that \$Te_n={{n+2}\choose{3}}\$; : ranges downwards for the case of \$n=1\$.

added 1 character in body
Source Link
Giuseppe
  • 29.4k
  • 3
  • 33
  • 106

R, 32 3131 29 bytes

function(n)n%in%choose(13:n+2n,3) 

Try it online!Try it online!

R, 32 31 bytes

function(n)n%in%choose(1:n+2,3) 

Try it online!

R, 32 31 29 bytes

function(n)n%in%choose(3:n,3) 

Try it online!

deleted 29 characters in body
Source Link
Giuseppe
  • 29.4k
  • 3
  • 33
  • 106

R, 3232 31 bytes

function(n,`?`=cumsum)n%in%??n%in%choose(1:nn+2,3) 

Try it online!

Double cumsum from the Lyxal answers.Try it online!

R, 32 bytes

function(n,`?`=cumsum)n%in%??1:n 

Try it online!

Double cumsum from the Lyxal answers.

R, 32 31 bytes

function(n)n%in%choose(1:n+2,3) 

Try it online!

Source Link
Giuseppe
  • 29.4k
  • 3
  • 33
  • 106
Loading