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 455 characters in body
Source Link
dzaima
  • 20.3k
  • 2
  • 42
  • 75

SOGL V0.12, 14 bytes

1[:Λ∑:A.>?ao←I

Try it Here!

Explanation:

1 push 1
 [ while ToS != 0
 :Λ get the divisors
 ∑ sum
 :A save on variable A without popping
 .>? ← if greater than the input
 ao output the variable A
 ← and stop the program, implicitly outputting ToS - the counter
 I increment the counter

SOGL V0.12, 14 bytes

1[:Λ∑:A.>?ao←I

Try it Here!

SOGL V0.12, 14 bytes

1[:Λ∑:A.>?ao←I

Try it Here!

Explanation:

1 push 1
 [ while ToS != 0
 :Λ get the divisors
 ∑ sum
 :A save on variable A without popping
 .>? ← if greater than the input
 ao output the variable A
 ← and stop the program, implicitly outputting ToS - the counter
 I increment the counter
Source Link
dzaima
  • 20.3k
  • 2
  • 42
  • 75

SOGL V0.12, 14 bytes

1[:Λ∑:A.>?ao←I

Try it Here!

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