Skip to main content
added 1122 characters in body
Source Link
Razetime
  • 27.6k
  • 3
  • 31
  • 77

Husk, 2624 bytes

LΣΣU¡(fo¬εṁm₁);; ►Lfo=¹ΣQḣḟo=¹ΣQḣ 

Try it online!Try it online! or Verify first 40 values

Explanation

Function ₁: Get the longest slice of numbers ḟo=¹ΣQḣ ḣ range 1..n Q all subsequences ḟo get the first value which satisfies: Σ sum = equals ¹ argument? 

Explanation coming soonTaking the first value works because Husk orders subsequences lexicographically, and the longest sequence will always be the one which is lexicographically smallest.

LΣΣU¡(fo¬εṁm₁);; ;; nest the input twice: 24 → [[24]] (conversion to node) ¡ iterate infinitely, producing intermediate results ṁ map each node list to m₁ it's elements converted to their fissions ṁ and join them fo filter using two functions ¬ε is it not of length <1? (this removes all nodes which cannot be broken down) U cut at first non-unique element ΣΣ join all the nested nodes into one list L length 

Husk, 26 bytes

LΣΣU¡(fo¬εṁm₁);; ►Lfo=¹ΣQḣ 

Try it online!

Explanation coming soon.

Husk, 24 bytes

LΣΣU¡(fo¬εṁm₁);; ḟo=¹ΣQḣ 

Try it online! or Verify first 40 values

Explanation

Function ₁: Get the longest slice of numbers ḟo=¹ΣQḣ ḣ range 1..n Q all subsequences ḟo get the first value which satisfies: Σ sum = equals ¹ argument? 

Taking the first value works because Husk orders subsequences lexicographically, and the longest sequence will always be the one which is lexicographically smallest.

LΣΣU¡(fo¬εṁm₁);; ;; nest the input twice: 24 → [[24]] (conversion to node) ¡ iterate infinitely, producing intermediate results ṁ map each node list to m₁ it's elements converted to their fissions ṁ and join them fo filter using two functions ¬ε is it not of length <1? (this removes all nodes which cannot be broken down) U cut at first non-unique element ΣΣ join all the nested nodes into one list L length 
Source Link
Razetime
  • 27.6k
  • 3
  • 31
  • 77

Husk, 26 bytes

LΣΣU¡(fo¬εṁm₁);; ►Lfo=¹ΣQḣ 

Try it online!

Explanation coming soon.