Three cases:
1. distinct parts
2. all elements are odd
3. number of parts is odd.
We now focus on the bijection between case 1 and case 2.
# Mathematica code ✅
```
distinctPartitionsOf13 = (n |-> Select[IntegerPartitions[n], DuplicateFreeQ[#] &])[13];
oddElementPartitionsOf13 = IntegerPartitions[13, Infinity, Range[1, 13, 2]];
oddPartsPartitionsOf13 = IntegerPartitions[13, {1, Infinity, 2}, All];
Length /@ {distinctPartitionsOf13, oddElementPartitionsOf13,
oddPartsPartitionsOf13} (* {18,18,52} *)
```
### 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 ]
```
### oddElementToDistinct
```
binaryDecomposition[n_Integer] :=
Reverse[2^Flatten[Position[Reverse[IntegerDigits[n, 2]], 1] - 1]]
helper[lst_] :=
Flatten@Table[ele[[1]]*binaryDecomposition[ele[[2]]], {ele, lst}];
oddElementToDistinct[partition_List] := helper@Tally@partition
generatedDistinctPartitionsOf13 =
oddElementToDistinct /@ oddElementPartitionsOf13
Sort@Map[Sort, generatedDistinctPartitionsOf13] ==
Sort@Map[Sort, distinctPartitionsOf13]
```
# Reference
Use the method found on OEIS [A000009][2].
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.
**So naive, it reminds me of my skills in middle school math competitions.**
[1]: https://mathworld.wolfram.com/FerrersDiagram.html
[2]: https://oeis.org/A000009