Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

Commonmark migration
Source Link

#JavaScript (ES7), (削除) 19 (削除ここまで) 18 bytes

JavaScript (ES7), (削除) 19 (削除ここまで) 18 bytes

From my answer to a related question.

Outputs false for triangular numbers or true for non-triangular, as permitted by the OP.

n=>(8*n+1)**.5%1>0

##Try It

Try It

f=
n=>(8*n+1)**.5%1>0
oninput=_=>o.innerText=f(+i.value)
<input id=i type=number><pre id=o>

#JavaScript (ES7), (削除) 19 (削除ここまで) 18 bytes

From my answer to a related question.

Outputs false for triangular numbers or true for non-triangular, as permitted by the OP.

n=>(8*n+1)**.5%1>0

##Try It

f=
n=>(8*n+1)**.5%1>0
oninput=_=>o.innerText=f(+i.value)
<input id=i type=number><pre id=o>

JavaScript (ES7), (削除) 19 (削除ここまで) 18 bytes

From my answer to a related question.

Outputs false for triangular numbers or true for non-triangular, as permitted by the OP.

n=>(8*n+1)**.5%1>0

Try It

f=
n=>(8*n+1)**.5%1>0
oninput=_=>o.innerText=f(+i.value)
<input id=i type=number><pre id=o>

added 102 characters in body
Source Link
Shaggy
  • 45k
  • 4
  • 39
  • 95

#JavaScript (ES7), 19(削除) 19 (削除ここまで) 18 bytes

From my answer to a related question.

Outputs false for triangular numbers or true for non-triangular, as permitted by the OP.

n=>!((8*n+1)**.5%1)5%1>0

##Try It

f=
n=>!((8*n+1)**.5%1)5%1>0
oninput=_=>o.innerText=f(+i.value)
<input id=i type=number><pre id=o>

#JavaScript (ES7), 19 bytes

From my answer to a related question.

n=>!((8*n+1)**.5%1)

##Try It

f=
n=>!((8*n+1)**.5%1)
oninput=_=>o.innerText=f(+i.value)
<input id=i type=number><pre id=o>

#JavaScript (ES7), (削除) 19 (削除ここまで) 18 bytes

From my answer to a related question.

Outputs false for triangular numbers or true for non-triangular, as permitted by the OP.

n=>(8*n+1)**.5%1>0

##Try It

f=
n=>(8*n+1)**.5%1>0
oninput=_=>o.innerText=f(+i.value)
<input id=i type=number><pre id=o>

added 145 characters in body; added 290 characters in body
Source Link
Shaggy
  • 45k
  • 4
  • 39
  • 95

#JavaScript (ES7), 19 bytes

From my answer to a related question .

n=>!((8*n+1)**.5%1)

##Try It

f=
n=>!((8*n+1)**.5%1)
oninput=_=>o.innerText=f(+i.value)
<input id=i type=number><pre id=o>

#JavaScript (ES7), 19 bytes

n=>!((8*n+1)**.5%1)

#JavaScript (ES7), 19 bytes

From my answer to a related question .

n=>!((8*n+1)**.5%1)

##Try It

f=
n=>!((8*n+1)**.5%1)
oninput=_=>o.innerText=f(+i.value)
<input id=i type=number><pre id=o>

Source Link
Shaggy
  • 45k
  • 4
  • 39
  • 95
Loading

AltStyle によって変換されたページ (->オリジナル) /