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

71%
+3 −0
Challenges Prime Difference

Husk, 8 bytes Ψḟo≥⁰≠İp Try it online! or Verify first 8 values It is always a good day when you get to use Ψ in your program. Explanation Ψḟo≥⁰≠İp İp to the infinite list of prime num...

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

Answer
#2: Post edited by user avatar Razetime‭ · 2020-11-15T04:35:02Z (about 4 years ago)
  • # [Husk], 8 bytes
  • Ψḟo≥⁰≠İp
  • [Try it online!][TIO-khimeggk]
  • [Husk]: https://github.com/barbuz/Husk
  • [TIO-khimeggk]: https://tio.run/##ARwA4/9odXNr///OqOG4n2/iiaXigbDiiaDEsHD///81 "Husk – Try It Online"
  • It is always a good day when you get to use `Ψ` in your program.
  • ## Explanation
  • ```
  • Ψḟo≥⁰≠İp
  • İp to the infinite list of prime numbers,
  • Ψ apply this higher order function on overlapping pairs
  • ḟo first element where
  • ≠ absolute difference
  • ≥⁰ is greater than or equal to the input.
  • # [Husk], 8 bytes
  • Ψḟo≥⁰≠İp
  • [Try it online!][TIO-khimeggk] or [Verify first 8 values](https://tio.run/##ASIA3f9odXNr/23igoHhuKM4/86o4bifb@KJpeKBsOKJoMSwcP// "Husk – Try It Online")
  • [Husk]: https://github.com/barbuz/Husk
  • [TIO-khimeggk]: https://tio.run/##ARwA4/9odXNr///OqOG4n2/iiaXigbDiiaDEsHD///81 "Husk – Try It Online"
  • It is always a good day when you get to use `Ψ` in your program.
  • ## Explanation
  • ```
  • Ψḟo≥⁰≠İp
  • İp to the infinite list of prime numbers,
  • Ψ apply this higher order function on overlapping pairs
  • ḟo first element where
  • ≠ absolute difference
  • ≥⁰ is greater than or equal to the input.
#1: Initial revision by user avatar Razetime‭ · 2020-11-15T04:32:29Z (about 4 years ago)
# [Husk], 8 bytes

    Ψḟo≥⁰≠İp

[Try it online!][TIO-khimeggk]

[Husk]: https://github.com/barbuz/Husk
[TIO-khimeggk]: https://tio.run/##ARwA4/9odXNr///OqOG4n2/iiaXigbDiiaDEsHD///81 "Husk – Try It Online"

It is always a good day when you get to use `Ψ` in your program.

## Explanation
```
Ψḟo≥⁰≠İp
      İp to the infinite list of prime numbers,
Ψ        apply this higher order function on overlapping pairs
 ḟo      first element where
     ≠   absolute difference
   ≥⁰    is greater than or equal to the input.