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 Revisions

1 of 2
Not a tree
  • 3.2k
  • 1
  • 13
  • 24

><>, 24 bytes

I'm trying a new language (since my Mathematica licence expired...)

01v>{=n;
1$<^!?(}:{:*@:+

Try it online, or at the fish playground

Assumes the input number is already on the stack, and returns 0 or 1. It works by multiplying together the first n numbers until that stops being less than the input, and then printing 1 if it equals the input, and 0 if it doesn't.

Not a tree
  • 3.2k
  • 1
  • 13
  • 24

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