Skip to main content
added 171 characters in body
Source Link
Tbw
  • 3k
  • 4
  • 29

APL(Dyalog Unicode), 10 998 bytes SBCS

⊢∊(+\⍣2⍳)⊢∊+\⍣2⍤⍳ 

Try it on APLgolf!Try it on APLgolf!

Same-1 byte thanks to att.

A tacit function which takes an integer on the right and returns 1 if tetrahedral and 0 if not. Same method as the Vyxal and Uiua answers.

⊢∊(+\⍣2⍳)­⁡​‎‎⁡⁠⁢⁤‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁢⁢‏⁠‎⁡⁠⁢⁣‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏‏​⁡⁠⁡‌­⊢∊+\⍣2⍤⍳­⁡​‎‎⁡⁠⁢⁤‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁢⁢‏⁠‎⁡⁠⁢⁣‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏‏​⁡⁠⁡‌­    ⍤⍳ # ‎⁡range  , then  +\ # ‎⁢cumulative sums,   ⍣2 # ‎⁣twice ⊢∊  # ‎⁤input is member 💎 

Created with the help of Luminespire.

APL(Dyalog Unicode), 109 bytes SBCS

⊢∊(+\⍣2⍳) 

Try it on APLgolf!

Same as the Vyxal and Uiua answers.

⊢∊(+\⍣2⍳)­⁡​‎‎⁡⁠⁢⁤‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁢⁢‏⁠‎⁡⁠⁢⁣‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏‏​⁡⁠⁡‌­    # ‎⁡range   +\ # ‎⁢cumulative sums   ⍣2 # ‎⁣twice ⊢∊  # ‎⁤input is member 💎 

Created with the help of Luminespire.

APL(Dyalog Unicode), 10 98 bytes SBCS

⊢∊+\⍣2⍤⍳ 

Try it on APLgolf!

-1 byte thanks to att.

A tacit function which takes an integer on the right and returns 1 if tetrahedral and 0 if not. Same method as the Vyxal and Uiua answers.

⊢∊+\⍣2⍤⍳­⁡​‎‎⁡⁠⁢⁤‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁢⁢‏⁠‎⁡⁠⁢⁣‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏‏​⁡⁠⁡‌­ ⍤⍳ # ‎⁡range, then  +\ # ‎⁢cumulative sums, ⍣2 # ‎⁣twice ⊢∊ # ‎⁤input is member 💎 

Created with the help of Luminespire.

added 319 characters in body
Source Link
Tbw
  • 3k
  • 4
  • 29

APL(Dyalog Unicode), 109 bytes SBCS

⊢∊(+\⍣2⍳) 

Try it on APLgolf!

Same as the Vyxal and Uiua answers.

⊢∊(+\⍣2⍳)­⁡​‎‎⁡⁠⁢⁤‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁢⁢‏⁠‎⁡⁠⁢⁣‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏‏​⁡⁠⁡‌­ ⍳ # ‎⁡range +\ # ‎⁢cumulative sums ⍣2 # ‎⁣twice ⊢∊ # ‎⁤input is member 💎 

Created with the help of Luminespire.

APL(Dyalog Unicode), 109 bytes SBCS

⊢∊(+\⍣2⍳) 

Try it on APLgolf!

Same as the Vyxal and Uiua answers.

APL(Dyalog Unicode), 109 bytes SBCS

⊢∊(+\⍣2⍳) 

Try it on APLgolf!

Same as the Vyxal and Uiua answers.

⊢∊(+\⍣2⍳)­⁡​‎‎⁡⁠⁢⁤‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁢⁢‏⁠‎⁡⁠⁢⁣‏‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏‏​⁡⁠⁡‌­ ⍳ # ‎⁡range +\ # ‎⁢cumulative sums ⍣2 # ‎⁣twice ⊢∊ # ‎⁤input is member 💎 

Created with the help of Luminespire.

deleted 1 character in body
Source Link
Tbw
  • 3k
  • 4
  • 29

APL(Dyalog Unicode), 10109 bytes SBCS

{⍵∊+\+\⍳⍵}⊢∊(+\⍣2⍳) 

Try it on APLgolf!Try it on APLgolf!

Same as the Vyxal and Uiua answers.

APL(Dyalog Unicode), 10 bytes SBCS

{⍵∊+\+\⍳⍵} 

Try it on APLgolf!

Same as the Vyxal and Uiua answers.

APL(Dyalog Unicode), 109 bytes SBCS

⊢∊(+\⍣2⍳) 

Try it on APLgolf!

Same as the Vyxal and Uiua answers.

Source Link
Tbw
  • 3k
  • 4
  • 29
Loading