Write a program which prints the sequence of prime numbers. The shortest solution wins!
All numbers must have a unary representation (not just in the output, but throughout the entire program). This could be a string of 1s, a list of 1s, Peano-style objects, etc.
No particular output format is required, as long as numbers are recognizable.
[1, 1, 1], and
S(S(S(0))) are all acceptable representations of
3, for example.
Examples of permissible operations:
- Appending or prepending a constant value to a string/list
- Deleting a constant number of elements from a string/list
- Comparing something with a constant, such as
is_emptyon a string/list
Examples of what's not allowed:
- Any operations on non-unary integers or floats, such as
- Built-in functions which operate on multiple strings/lists, like
- Importing or downloading a library which does unary arithmetic ;-)