Skip to main content
-1 Byte, yay for mathematical insight!
Source Link

J, 1010 9 Bytes

Triangular number of bytes as well :)Triangular number of bytes as well :)

-1 Byte thanks to @FrownyFrog

0=1|%:>:8*0=1|2!inv

Explanation:

    2!    8*   | Multiply by 8
      >:    n |choose Increment2
    %:   inv    | Square rootInverse
0=1|         | Test if it's an integer

Could have been 87 bytes if the truthy/falsy values didn't have to be constant.

Works since n choose 2 is n!/2!(n-2)! = n*(n-1)/2

I don't know of any shorter ways to test for integers, previously I had been using (=<.)

J, 10 Bytes

Triangular number of bytes as well :)

0=1|%:>:8*

Explanation:

        8*   | Multiply by 8
      >:     | Increment
    %:       | Square root
0=1|         | Test if it's an integer

Could have been 8 bytes if the truthy/falsy values didn't have to be constant.

I don't know of any shorter ways to test for integers, previously I had been using (=<.)

J, 10 9 Bytes

Triangular number of bytes as well :)

-1 Byte thanks to @FrownyFrog

0=1|2!inv

Explanation:

    2!       | n choose 2
      inv    | Inverse
0=1|         | Test if it's an integer

Could have been 7 bytes if the truthy/falsy values didn't have to be constant.

Works since n choose 2 is n!/2!(n-2)! = n*(n-1)/2

I don't know of any shorter ways to test for integers, previously I had been using (=<.)

Source Link

J, 10 Bytes

Triangular number of bytes as well :)

0=1|%:>:8*

Explanation:

        8*   | Multiply by 8
      >:     | Increment
    %:       | Square root
0=1|         | Test if it's an integer

Could have been 8 bytes if the truthy/falsy values didn't have to be constant.

I don't know of any shorter ways to test for integers, previously I had been using (=<.)