Skip to main content
added 343 characters in body
Source Link
Jörg Hülsermann
  • 13.3k
  • 3
  • 15
  • 36

PHP, 30 Bytes

Prints 1 for true and nothing for false

<?=fmod(sqrt(8*$argn+1),2)==1;

Try it online!

fmod

PHP, 37 Bytes

Prints 1 for true and nothing for false

<?=($x=sqrt($q=2*$argn)^0)*$x+$x==$q;

Try it online!

PHP, 37 Bytes

Prints 1 for true and nothing for false

<?=($x=sqrt($q=2*$argn)^0)*$x+$x==$q;

Try it online!

PHP, 30 Bytes

Prints 1 for true and nothing for false

<?=fmod(sqrt(8*$argn+1),2)==1;

Try it online!

fmod

PHP, 37 Bytes

Prints 1 for true and nothing for false

<?=($x=sqrt($q=2*$argn)^0)*$x+$x==$q;

Try it online!

edited body
Source Link
Jörg Hülsermann
  • 13.3k
  • 3
  • 15
  • 36

PHP, 4037 Bytes

Prints 1 for true and nothing for false

echo$argn*2==<?=($x=sqrt(2*$argn$q=2*$argn)^0)*$x+$x;*$x+$x==$q;

Try it online!Try it online!

PHP, 40 Bytes

Prints 1 for true and nothing for false

echo$argn*2==($x=sqrt(2*$argn)^0)*$x+$x;

Try it online!

PHP, 37 Bytes

Prints 1 for true and nothing for false

<?=($x=sqrt($q=2*$argn)^0)*$x+$x==$q;

Try it online!

Source Link
Jörg Hülsermann
  • 13.3k
  • 3
  • 15
  • 36

PHP, 40 Bytes

Prints 1 for true and nothing for false

echo$argn*2==($x=sqrt(2*$argn)^0)*$x+$x;

Try it online!