Skip to main content
deleted 80 characters in body
Source Link
138 Aspen
  • 2.3k
  • 6
  • 25

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.

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.

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.

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.

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.

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.

deleted 13 characters in body
Source Link
138 Aspen
  • 2.3k
  • 6
  • 25

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 = (nIntegerPartitions[13, |->{1, Select[IntegerPartitions[n]Infinity, OddQ@Length@#2}, &])[13];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.

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.

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 = (n |-> Select[IntegerPartitions[n], OddQ@Length@# &])[13]; 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.

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.

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.

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.

added 3 characters in body
Source Link
138 Aspen
  • 2.3k
  • 6
  • 25

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 = (n |-> Select[IntegerPartitions[n], OddQ@Length@# &])[13]; 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.

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.

Three cases:

  1. distinct parts
  2. all elements are odd
  3. number of parts is odd.

We now focus 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 = (n |-> Select[IntegerPartitions[n], OddQ@Length@# &])[13]; 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.

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.

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 = (n |-> Select[IntegerPartitions[n], OddQ@Length@# &])[13]; 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.

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.

added 85 characters in body
Source Link
138 Aspen
  • 2.3k
  • 6
  • 25
Loading
Post Undeleted by 138 Aspen
added 263 characters in body
Source Link
138 Aspen
  • 2.3k
  • 6
  • 25
Loading
added 86 characters in body
Source Link
138 Aspen
  • 2.3k
  • 6
  • 25
Loading
added 71 characters in body
Source Link
138 Aspen
  • 2.3k
  • 6
  • 25
Loading
added 71 characters in body
Source Link
138 Aspen
  • 2.3k
  • 6
  • 25
Loading
Post Deleted by 138 Aspen
Post Undeleted by 138 Aspen
added 76 characters in body
Source Link
138 Aspen
  • 2.3k
  • 6
  • 25
Loading
added 141 characters in body
Source Link
138 Aspen
  • 2.3k
  • 6
  • 25
Loading
deleted 295 characters in body
Source Link
138 Aspen
  • 2.3k
  • 6
  • 25
Loading
added 6 characters in body
Source Link
138 Aspen
  • 2.3k
  • 6
  • 25
Loading
Post Deleted by 138 Aspen
Source Link
138 Aspen
  • 2.3k
  • 6
  • 25
Loading