Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

77%
+5 −0
Challenges Juggler sequences

Husk, 11 10 bytes U¡λ⌊^+.%2¹ Try it online! This can probably be trivially ported to Jelly. Explanation U¡o⌊Ṡ^o+.%2 ¡ iterate over the input infinitely, creating a list o ...

posted 3y ago by Razetime‭  ·  edited 3y ago by Razetime‭

Answer
#3: Post edited by user avatar Razetime‭ · 2021-05-11T06:18:32Z (over 3 years ago)
  • # [Husk], 11 bytes
  • o⌊Ṡ^o+.%2
  • [Try it online!][TIO-kob3dnyf]
  • [Husk]: https://github.com/barbuz/Husk
  • [TIO-kob3dnyf]: https://tio.run/##yygtzv7/P/TQwvxHPV0Pdy6Iy9fWUzX6//@/MQA "Husk – Try It Online"
  • This can probably be trivially ported to Jelly.
  • ## Explanation
  • ```
  • U¡o⌊Ṡ^o+.%2
  • ¡ iterate over the input infinitely, creating a list
  • o with the following two functions:
  • Ṡ^ take the previous result to the power
  • %2 result modulo 2
  • +. + 1/2
  • ⌊ floor it
  • U longest unique prefix
  • # [Husk], <sup><del>11</del></sup> 10 bytes
  • λ⌊^+.%2¹
  • [Try it online!][TIO-kojn6zfm]
  • [Husk]: https://github.com/barbuz/Husk
  • [TIO-kojn6zfm]: https://tio.run/##yygtzv7/P/TQwnO7H/V0xWnrqRod2vn//39jAA "Husk – Try It Online"
  • This can probably be trivially ported to Jelly.
  • ## Explanation
  • ```
  • U¡o⌊Ṡ^o+.%2
  • ¡ iterate over the input infinitely, creating a list
  • o with the following two functions:
  • Ṡ^ take the previous result to the power
  • %2 result modulo 2
  • +. + 1/2
  • ⌊ floor it
  • U longest unique prefix
#2: Post edited by user avatar Razetime‭ · 2021-05-05T06:44:24Z (over 3 years ago)
  • # [Husk], 11 bytes
  • U¡o⌊Ṡ^o+.%2
  • [Try it online!][TIO-kob3dnyf]
  • [Husk]: https://github.com/barbuz/Husk
  • [TIO-kob3dnyf]: https://tio.run/##yygtzv7/P/TQwvxHPV0Pdy6Iy9fWUzX6//@/MQA "Husk – Try It Online"
  • ## Explanation
  • ```
  • U¡o⌊Ṡ^o+.%2
  • ¡ iterate over the input infinitely, creating a list
  • o with the following two functions:
  • Ṡ^ take the previous result to the power
  • %2 result modulo 2
  • +. + 1/2
  • ⌊ floor it
  • U longest unique prefix
  • # [Husk], 11 bytes
  • U¡o⌊Ṡ^o+.%2
  • [Try it online!][TIO-kob3dnyf]
  • [Husk]: https://github.com/barbuz/Husk
  • [TIO-kob3dnyf]: https://tio.run/##yygtzv7/P/TQwvxHPV0Pdy6Iy9fWUzX6//@/MQA "Husk – Try It Online"
  • This can probably be trivially ported to Jelly.
  • ## Explanation
  • ```
  • U¡o⌊Ṡ^o+.%2
  • ¡ iterate over the input infinitely, creating a list
  • o with the following two functions:
  • Ṡ^ take the previous result to the power
  • %2 result modulo 2
  • +. + 1/2
  • ⌊ floor it
  • U longest unique prefix
#1: Initial revision by user avatar Razetime‭ · 2021-05-05T06:43:45Z (over 3 years ago)
# [Husk], 11 bytes

    U¡o⌊Ṡ^o+.%2

[Try it online!][TIO-kob3dnyf]

[Husk]: https://github.com/barbuz/Husk
[TIO-kob3dnyf]: https://tio.run/##yygtzv7/P/TQwvxHPV0Pdy6Iy9fWUzX6//@/MQA "Husk – Try It Online"

## Explanation
```
U¡o⌊Ṡ^o+.%2
 ¡            iterate over the input infinitely, creating a list
  o           with the following two functions:
    Ṡ^        take the previous result to the power
         %2   result modulo 2
       +.     + 1/2
   ⌊          floor it
U             longest unique prefix