Skip to main content
Commonmark migration
Source Link

#Jelly, 14 11 bytes

Jelly, 14 11 bytes

5½×lØp+.Ḟ»0

Try it online!

This is my first ever Jelly answer! This uses the algorithm from the MATL answer. Thanks to Dennis for shaving off 3 bytes!

Explanation:

   lØp      # Log Base phi
5½          # Of the square root of 5
  ×         # Times the input
      +     # Plus
       .    # 0.5
        Ḟ   # Floored

This gets the right answer, now we just need to handle the special case of '0'. With '0' as an arg, we get -infinity, so we return

»      # The maximum of 
 0     # Zero
       # And the previous calculated value.

#Jelly, 14 11 bytes

5½×lØp+.Ḟ»0

Try it online!

This is my first ever Jelly answer! This uses the algorithm from the MATL answer. Thanks to Dennis for shaving off 3 bytes!

Explanation:

   lØp      # Log Base phi
5½          # Of the square root of 5
  ×         # Times the input
      +     # Plus
       .    # 0.5
        Ḟ   # Floored

This gets the right answer, now we just need to handle the special case of '0'. With '0' as an arg, we get -infinity, so we return

»      # The maximum of 
 0     # Zero
       # And the previous calculated value.

Jelly, 14 11 bytes

5½×lØp+.Ḟ»0

Try it online!

This is my first ever Jelly answer! This uses the algorithm from the MATL answer. Thanks to Dennis for shaving off 3 bytes!

Explanation:

   lØp      # Log Base phi
5½          # Of the square root of 5
  ×         # Times the input
      +     # Plus
       .    # 0.5
        Ḟ   # Floored

This gets the right answer, now we just need to handle the special case of '0'. With '0' as an arg, we get -infinity, so we return

»      # The maximum of 
 0     # Zero
       # And the previous calculated value.
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

#Jelly, 14 11 bytes

5½×lØp+.Ḟ»0

Try it online!

This is my first ever Jelly answer! This uses the algorithm from the MATL answerfrom the MATL answer. Thanks to Dennis for shaving off 3 bytes!

Explanation:

   lØp      # Log Base phi
5½          # Of the square root of 5
  ×         # Times the input
      +     # Plus
       .    # 0.5
        Ḟ   # Floored

This gets the right answer, now we just need to handle the special case of '0'. With '0' as an arg, we get -infinity, so we return

»      # The maximum of 
 0     # Zero
       # And the previous calculated value.

#Jelly, 14 11 bytes

5½×lØp+.Ḟ»0

Try it online!

This is my first ever Jelly answer! This uses the algorithm from the MATL answer. Thanks to Dennis for shaving off 3 bytes!

Explanation:

   lØp      # Log Base phi
5½          # Of the square root of 5
  ×         # Times the input
      +     # Plus
       .    # 0.5
        Ḟ   # Floored

This gets the right answer, now we just need to handle the special case of '0'. With '0' as an arg, we get -infinity, so we return

»      # The maximum of 
 0     # Zero
       # And the previous calculated value.

#Jelly, 14 11 bytes

5½×lØp+.Ḟ»0

Try it online!

This is my first ever Jelly answer! This uses the algorithm from the MATL answer. Thanks to Dennis for shaving off 3 bytes!

Explanation:

   lØp      # Log Base phi
5½          # Of the square root of 5
  ×         # Times the input
      +     # Plus
       .    # 0.5
        Ḟ   # Floored

This gets the right answer, now we just need to handle the special case of '0'. With '0' as an arg, we get -infinity, so we return

»      # The maximum of 
 0     # Zero
       # And the previous calculated value.
deleted 74 characters in body
Source Link
DJMcMayhem
  • 60.3k
  • 18
  • 204
  • 353

#Jelly, 1414 11 bytes

5½×lØp
1H+ÇḞ»05½×lØp+.Ḟ»0

Try it online!Try it online!

This is my first ever Jelly answer! It's nearly twice as long as the other one, but it was fun to come up with. This uses the algorithm from the MATL answer. I'll post an explanation eventuallyThanks to Dennis for shaving off 3 bytes!

Explanation:

   lØp      # Log Base phi
5½          # Of the square root of 5
  ×         # Times the input
      +     # Plus
       .    # 0.5
        Ḟ   # Floored

This gets the right answer, now we just need to handle the special case of '0'. With '0' as an arg, we get -infinity, so we return

»      # The maximum of 
 0     # Zero
       # And the previous calculated value.

#Jelly, 14 bytes

5½×lØp
1H+ÇḞ»0

Try it online!

This is my first ever Jelly answer! It's nearly twice as long as the other one, but it was fun to come up with. This uses the algorithm from the MATL answer. I'll post an explanation eventually.

#Jelly, 14 11 bytes

5½×lØp+.Ḟ»0

Try it online!

This is my first ever Jelly answer! This uses the algorithm from the MATL answer. Thanks to Dennis for shaving off 3 bytes!

Explanation:

   lØp      # Log Base phi
5½          # Of the square root of 5
  ×         # Times the input
      +     # Plus
       .    # 0.5
        Ḟ   # Floored

This gets the right answer, now we just need to handle the special case of '0'. With '0' as an arg, we get -infinity, so we return

»      # The maximum of 
 0     # Zero
       # And the previous calculated value.
Source Link
DJMcMayhem
  • 60.3k
  • 18
  • 204
  • 353
Loading