Skip to main content
6 of 13
added 71 characters in body
138 Aspen
  • 2.3k
  • 6
  • 25

3 cases:

  • distinct parts
  • all elements are odd
  • number of parts is odd.

Mathematica code 🏗

distinctPartitionsOf13 = (n |-> Select[IntegerPartitions[n], DuplicateFreeQ[#] &])[13]; oddElementPartitionsOf13 = IntegerPartitions[13, Infinity, Range[1, 13, 2]]; oddPartsPartitionsOf13 = ; 

distinctToOddElement

(* Helper function to split even numbers until no evens remain *) splitEven[n_] := If[EvenQ[n], Flatten[{splitEven[n/2], splitEven[n/2]}], n] (* Function to convert a partition with distinct parts to odd parts *) distinctToOddElement[partition_List] := Flatten[splitEven /@ partition] generatedOddElementPartitionsOf13 = distinctToOddElement/@ distinctPartitionsOf13; Sort@Map[Sort, generatedOddElementPartitionsOf13 ] == Sort@Map[Sort, oddElementPartitionsOf13 ] 

oddToDistinct

TODO 

Reference

Use the method found on OEIS A000009.

Bijection: given n = L1*1 + L2*3 + L3*5 + L7*7 + ..., a partition into odd parts, write each Li in binary, Li = 2^a1 + 2^a2 + 2^a3 + ... where the aj's are all different, then expand n = (2^a1 * 1 + ...)*1 + ... by removing the brackets and we get a partition into distinct parts. For the reverse operation, just keep splitting any even number into halves until no evens remain.

138 Aspen
  • 2.3k
  • 6
  • 25