Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

added 494 characters in body
Source Link
Dennis
  • 211.7k
  • 41
  • 380
  • 830

Jelly, 7 bytes

1Æṣ=$#Ṫ6Æṣ=$#Ṫ

Try it online! Try it online!

How it works

6Æṣ=$#Ṫ Main link. Argument: n
6 Set the return value to 6.
 # Execute the link to the left with argument k = 6, 7, 8, ... until n
 values of k result in a truthy value. Yield the array of matches.
 $ Combine the two links to the left into a monadic chain.
 Æṣ Compute the sum of k's proper divisors.
 = Compare the result with k.
 Ṫ Tail; extract the last match.

Jelly, 7 bytes

1Æṣ=$#Ṫ

Try it online!

Jelly, 7 bytes

6Æṣ=$#Ṫ

Try it online!

How it works

6Æṣ=$#Ṫ Main link. Argument: n
6 Set the return value to 6.
 # Execute the link to the left with argument k = 6, 7, 8, ... until n
 values of k result in a truthy value. Yield the array of matches.
 $ Combine the two links to the left into a monadic chain.
 Æṣ Compute the sum of k's proper divisors.
 = Compare the result with k.
 Ṫ Tail; extract the last match.
Source Link
Dennis
  • 211.7k
  • 41
  • 380
  • 830

Jelly, 7 bytes

1Æṣ=$#Ṫ

Try it online!

AltStyle によって変換されたページ (->オリジナル) /