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

60%
+1 −0
Challenges The Pell Numbers

Japt, 11 9 bytes Outputs the first n terms. Change the h to g to get the nth 0-indexed term. ÈÑ+ZÔÅÎ}h Try it ÈÑ+ZÔÅÎ}h :Implicit input of integer U È :Function taking an int...

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

Answer
#4: Post edited by user avatar Shaggy‭ · 2021-07-16T10:36:10Z (almost 3 years ago)
  • # [Japt](https://github.com/ETHproductions/japt), <s>11</s> 9 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • Outputs the first `n` terms. Change the `h` to `g` to get the `n`th 0-indexed term.
  • ÈÑ+ZÔÅÎ}h
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=yNErWtTFzn1o&input=MTM)
  • # [Japt](https://github.com/ETHproductions/japt), <s>11</s> 9 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • Outputs the first `n` terms. Change the `h` to `g` to get the `n`th 0-indexed term.
  • ÈÑ+ZÔÅÎ}h
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=yNErWtTFzn1o&input=MTM)
  • ÈÑ+ZÔÅÎ}h :Implicit input of integer U
  • È :Function taking an integer X and an array Z as arguments
  • Ñ : X*2
  • + : Plus
  • ZÔ : Reverse Z
  • Å : Slice off the first element
  • Î : Get the first element
  • } :End function
  • h :Starting with the array [0,1] repeatedly pass it (Z)
  • and its last element (X) through that function
  • pushing the result back to it each time until it reaches length U
#3: Post edited by user avatar Shaggy‭ · 2021-07-15T09:02:19Z (almost 3 years ago)
  • # [Japt](https://github.com/ETHproductions/japt), 11 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • Outputs the first `n` terms. Change the `h` to `g` to get the `n`th 0-indexed term.
  • @ZäÈ+YÑÃÌ}h
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=QFrkyCtZ0cPMfWg&input=MTM)
  • @ZäÈ+YÑÃÌ}h :Implicit input of integer U
  • @ :Function taking an array Z as argument
  • Zä : Consecutive pairs
  • È : Reduced by passing through the following function as X & Y
  • +YÑ : X+Y*2
  • Ã : End reduce
  • Ì : Last element
  • } :End function
  • h :Starting with [0,1] pass it through the function, pushing the result back to it until it reaches length U
  • # [Japt](https://github.com/ETHproductions/japt), <s>11</s> 9 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • Outputs the first `n` terms. Change the `h` to `g` to get the `n`th 0-indexed term.
  • ÈÑ+ZÔÅÎ}h
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=yNErWtTFzn1o&input=MTM)
#2: Post edited by user avatar Shaggy‭ · 2021-07-09T09:23:54Z (almost 3 years ago)
  • # [Japt](https://github.com/ETHproductions/japt), 11 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • Outputs the first `n` terms. Change the `h` to `g` to get the `n`th 0-indexed term.
  • @ZäÈ+YÑÃÌ}h
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=QFrkyCtZ0cPMfWg&input=MTM)
  • # [Japt](https://github.com/ETHproductions/japt), 11 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • Outputs the first `n` terms. Change the `h` to `g` to get the `n`th 0-indexed term.
  • @ZäÈ+YÑÃÌ}h
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=QFrkyCtZ0cPMfWg&input=MTM)
  • @ZäÈ+YÑÃÌ}h :Implicit input of integer U
  • @ :Function taking an array Z as argument
  • Zä : Consecutive pairs
  • È : Reduced by passing through the following function as X & Y
  • +YÑ : X+Y*2
  • Ã : End reduce
  • Ì : Last element
  • } :End function
  • h :Starting with [0,1] pass it through the function, pushing the result back to it until it reaches length U
#1: Initial revision by user avatar Shaggy‭ · 2021-07-09T08:37:05Z (almost 3 years ago)
# [Japt](https://github.com/ETHproductions/japt), 11 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)

Outputs the first `n` terms. Change the `h` to `g` to get the `n`th 0-indexed term.

    @ZäÈ+YÑÃÌ}h

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