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

50%
+0 −0
Challenges Prime Difference

Japt, 15 14 bytes @§XnÈj}aX+j}a2 Try it or run all test cases @§XnÈj}aX+j}a2 :Implicit input of integer U @ :Function taking an integer X as argument § ...

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

Answer
#4: Post edited by user avatar Shaggy‭ · 2021-06-22T16:36:13Z (over 3 years ago)
  • # [Japt](https://github.com/ETHproductions/japt), <s>15</s> 14 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • @§XnÈj}aX+j}a2
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=QKdYbshqfWFYK2p9YTI&input=OA)
  • @§XnÈj}aX+j}a2 :Implicit input of integer U
  • @ :Function taking an integer X as argument
  • § : Is U <= ...
  • Xn : Subtract X from
  • È : Function taking an integer as input
  • j : Is prime?
  • } : End function
  • a : Get the first integer that returns true when passed through that function starting at
  • X+j : X plus is X prime
  • } :End function
  • a2 :Get the first integer that returns true when passed through that function starting at 2
  • # [Japt](https://github.com/ETHproductions/japt), <s>15</s> 14 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • @§XnÈj}aX+j}a2
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=QKdYbshqfWFYK2p9YTI&input=OA) or [run all test cases](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=QKdYbshqfWFYK2p9YTI&input=WzEgMiAzIDQgNSA2IDcgOF0tbQ)
  • @§XnÈj}aX+j}a2 :Implicit input of integer U
  • @ :Function taking an integer X as argument
  • § : Is U <= ...
  • Xn : Subtract X from
  • È : Function taking an integer as input
  • j : Is prime?
  • } : End function
  • a : Get the first integer that returns true when passed through that function starting at
  • X+j : X plus is X prime
  • } :End function
  • a2 :Get the first integer that returns true when passed through that function starting at 2
#3: Post edited by user avatar Shaggy‭ · 2021-06-22T16:11:20Z (over 3 years ago)
  • # [Japt](https://github.com/ETHproductions/japt), 15 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • @§XnÈj}aÒX*j}a2
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=QKdYbshqfWHSWCpqfWEy&input=OA)
  • @§XnÈj}aÒX*j}a2 :Implicit input of integer U
  • @ :Function taking an integer X as argument
  • § : Is U <= ...
  • Xn : Subtract X from
  • È : Function taking an integer as input
  • j : Is prime?
  • } : End function
  • a : Get the first integer that returns true when passed through that function starting at
  • Ò : Negate the bitwise NOT of
  • X*j : X multiplied by is X prime
  • } :End function
  • a2 :Get the first integer that returns true when passed through that function starting at 2
  • # [Japt](https://github.com/ETHproductions/japt), <s>15</s> 14 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • @§XnÈj}aX+j}a2
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=QKdYbshqfWFYK2p9YTI&input=OA)
  • @§XnÈj}aX+j}a2 :Implicit input of integer U
  • @ :Function taking an integer X as argument
  • § : Is U <= ...
  • Xn : Subtract X from
  • È : Function taking an integer as input
  • j : Is prime?
  • } : End function
  • a : Get the first integer that returns true when passed through that function starting at
  • X+j : X plus is X prime
  • } :End function
  • a2 :Get the first integer that returns true when passed through that function starting at 2
#2: Post edited by user avatar Shaggy‭ · 2021-06-22T16:09:54Z (over 3 years ago)
  • # [Japt](https://github.com/ETHproductions/japt), 15 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • @§XnÈj}aÒX*j}a2
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=QKdYbshqfWHSWCpqfWEy&input=OA)
  • # [Japt](https://github.com/ETHproductions/japt), 15 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • @§XnÈj}aÒX*j}a2
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=QKdYbshqfWHSWCpqfWEy&input=OA)
  • @§XnÈj}aÒX*j}a2 :Implicit input of integer U
  • @ :Function taking an integer X as argument
  • § : Is U <= ...
  • Xn : Subtract X from
  • È : Function taking an integer as input
  • j : Is prime?
  • } : End function
  • a : Get the first integer that returns true when passed through that function starting at
  • Ò : Negate the bitwise NOT of
  • X*j : X multiplied by is X prime
  • } :End function
  • a2 :Get the first integer that returns true when passed through that function starting at 2
#1: Initial revision by user avatar Shaggy‭ · 2021-06-22T16:06:08Z (over 3 years ago)
# [Japt](https://github.com/ETHproductions/japt), 15 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)

    @§XnÈj}aÒX*j}a2

[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=QKdYbshqfWHSWCpqfWEy&input=OA)