Define Phi = (1+sqrt(5))/2. The unique Stolarsky representation uses the first column of the Stolarsky array A(n) = floor[n*(1+Phi)-Phi/2] and its compliment B(n)=round(n*Phi) given in A007064 and A007067. These two sequences are used to create the Stolarsky representation of a positive integer z. z appears in exactly one of the complementary sequences above. The rules are as follows: If z = 1, the representation is the empty sequence of digits. Otherwise, if z = A(n), the representation is '0' preceded by the representation of n. Otherwise, if z = B(n), the representation is '1' preceded by the representation of n. Stolarsky representations S(n) of n = 1 ... 150 (0 for A, 1 for B): n S(n) n S(n) n S(n) 1 0 51 111100 101 1001110 2 1 52 1111011 102 10011111 3 11 53 1111101 103 1011010 4 10 54 1111110 104 1011001 5 111 55 11111111 105 10110111 6 101 56 10000 106 1011100 7 110 57 101001 107 10111011 8 1111 58 100011 108 10111101 9 100 59 101010 109 10111110 10 1011 60 1010111 110 101111111 11 1101 61 100101 111 110000 12 1110 62 100110 112 1101001 13 11111 63 1001111 113 1100011 14 1010 64 101100 114 1101010 15 1001 65 1011011 115 11010111 16 10111 66 1011101 116 1100101 17 1100 67 1011110 117 1100110 18 11011 68 10111111 118 11001111 19 11101 69 110100 119 1101100 20 11110 70 110001 120 11011011 21 111111 71 1101011 121 11011101 22 1000 72 110010 122 11011110 23 10101 73 1100111 123 110111111 24 10011 74 1101101 124 1110100 25 10110 75 1101110 125 1110001 26 101111 76 11011111 126 11101011 27 11010 77 111000 127 1110010 28 11001 78 1110101 128 11100111 29 110111 79 1110011 129 11101101 30 11100 80 1110110 130 11101110 31 111011 81 11101111 131 111011111 32 111101 82 1111010 132 1111000 33 111110 83 1111001 133 11110101 34 1111111 84 11110111 134 11110011 35 10100 85 1111100 135 11110110 36 10001 86 11111011 136 111101111 37 101011 87 11111101 137 11111010 38 10010 88 11111110 138 11111001 39 100111 89 111111111 139 111110111 40 101101 90 101000 140 11111100 41 101110 91 100001 141 111111011 42 1011111 92 1010011 142 111111101 43 11000 93 100010 143 111111110 44 110101 94 1000111 144 1111111111 45 110011 95 1010101 145 100000 46 110110 96 1010110 146 1010001 47 1101111 97 10101111 147 1000011 48 111010 98 100100 148 1010010 49 111001 99 1001011 149 10100111 50 1110111 100 1001101 150 1000101 The lengths of this binary Stolarsky code for n = 1 ... 150 are (this sequence A200648): 1, 1, 2, 2, 3, 3, 3, 4, 3, 4, 4, 4, 5, 4, 4, 5, 4, 5, 5, 5, 6, 4, 5, 5, 5, 6, 5, 5, 6, 5, 6, 6, 6, 7, 5, 5, 6, 5, 6, 6, 6, 7, 5, 6, 6, 6, 7, 6, 6, 7, 6, 7, 7, 7, 8, 5, 6, 6, 6, 7, 6, 6, 7, 6, 7, 7, 7, 8, 6, 6, 7, 6, 7, 7, 7, 8, 6, 7, 7, 7, 8, 7, 7, 8, 7, 8, 8, 8, 9, 6, 6, 7, 6, 7, 7, 7, 8, 6, 7, 7 The number of 1's in the Stolarsky representation (the number of applications of the B-sequence needed) is, for n = 1 ... 150 (see A200649): 0, 1, 2, 1, 3, 2, 2, 4, 1, 3, 3, 3, 5, 2, 2, 4, 2, 4, 4, 4, 6, 1, 3, 3, 3, 5, 3, 3, 5, 3, 5, 5, 5, 7, 2, 2, 4, 2, 4, 4, 4, 6, 2, 4, 4, 4, 6, 4, 4, 6, 4, 6, 6, 6, 8, 1, 3, 3, 3, 5, 3, 3, 5, 3, 5, 5, 5, 7, 3, 3, 5, 3, 5, 5, 5, 7, 3, 5, 5, 5, 7, 5, 5, 7, 5, 7, 7, 7, 9, 2, 2, 4, 2, 4, 4, 4, 6, 2, 4, 4 The number of 0's in the Stolarskyrepresentation (the number of applications of the A-sequence needed) is, for n = 1 ... 150 (see A200650): 1, 0, 0, 1, 0, 1, 1, 0, 2, 1, 1, 1, 0, 2, 2, 1, 2, 1, 1, 1, 0, 3, 2, 2, 1, 0, 0, 1, 0, 1, 1, 0, 2, 1, 1, 1, 0, 2, 2, 1, 2, 1, 1, 1, 0, 3, 2, 2, 2, 1, 2, 2, 1, 2, 1, 1, 1, 0, 3, 3, 2, 3, 2, 2, 2, 1, 3, 2, 2, 2, 1, 2, 2, 1, 2, 1, 1, 1, 0, 4, 3, 3, 3, 2, 3, 3, 2, 3, 2, 2, 2, 1, 3, 3, 2, 3, 2, 2, 2, 1 The number of equal bit runs (e.g. '000', '1' or '111111') in the Stolarskyrepresentation (the number of applications of the A-sequence needed) is, for n = 1 ... 150 (see A200651): 1, 1, 1, 2, 1, 3, 2, 1, 2, 3, 3, 2, 1, 4, 3, 3, 2, 3, 3, 2, 1, 2, 5, 3, 4, 3, 4, 3, 3, 2, 3, 3, 2, 1, 4, 3, 5, 4, 3, 5, 4, 3, 2, 5, 3, 4, 3, 4, 3, 3, 2, 3, 3, 2, 1, 2, 5, 3, 6, 5, 5, 4, 3, 4, 5, 5, 4, 3, 4, 3, 5, 4, 3, 5, 4, 3, 2, 5, 3, 4, 3, 4, 3, 3, 2, 3, 3, 2, 1, 4, 3, 5, 4, 3, 7, 6, 5, 4, 5, 5 See also Wythoff representations http://oeis.org/A007895.