Deadfish/Constants

Given below are the shortest ways to produce a number in the range of 0 to 255 with Deadfish. At most 36 instructions are necessary to reach any number in that range.

The shortest way to reach any number is generally to produce the nearest square possible (256 is impossible) and then increment/decrement from there. Decrement/increment to the nearest square, add the square instruction and then recurse with the nearest square, with the exception of the numbers 0 to 3, which are shorter by just using increments without squaring and/or recursion. Otherwise, 3 would become  because the nearest square of 3 is 4.

For numbers above 256 we theorize the same method holds, except for a couple caveats:
 * 257 needs to go via 289 = 17² rather than the equally close 225 = 15², since the latter would require passing through the impossible 256.
 * The expensive square 65536 = 256² should be avoided, going via either 255² or 257² instead.
 * 65537 needs to go via 255² rather than 257² (they're the same distance, but the former is itself shorter).

List of Deadfish constants
0 = 1 =  i 2 =   ii 3 =   iii 4 =  iis 5 =  iisi 6 =  iisii 7 =  iiisdd 8 =  iiisd 9 =  iiis 10 = iiisi 11 = iiisii 12 = iiisiii 13 = iissddd 14 = iissdd 15 = iissd 16 = iiss 17 = iissi 18 = iissii 19 = iissiii 20 = iissiiii 21 = iisisdddd 22 = iisisddd 23 = iisisdd 24 = iisisd 25 = iisis 26 = iisisi 27 = iisisii 28 = iisisiii 29 = iisisiiii 30 = iisisiiiii 31 = iisiisddddd 32 = iisiisdddd 33 = iisiisddd 34 = iisiisdd 35 = iisiisd 36 = iisiis 37 = iisiisi 38 = iisiisii 39 = iisiisiii 40 = iisiisiiii 41 = iisiisiiiii 42 = iisiisiiiiii 43 = iiisddsdddddd 44 = iiisddsddddd 45 = iiisddsdddd 46 = iiisddsddd 47 = iiisddsdd 48 = iiisddsd 49 = iiisdds 50 = iiisddsi 51 = iiisddsii 52 = iiisddsiii 53 = iiisddsiiii 54 = iiisddsiiiii 55 = iiisddsiiiiii 56 = iiisddsiiiiiii 57 = iiisdsddddddd 58 = iiisdsdddddd 59 = iiisdsddddd 60 = iiisdsdddd 61 = iiisdsddd 62 = iiisdsdd 63 = iiisdsd 64 = iiisds 65 = iiisdsi 66 = iiisdsii 67 = iiisdsiii 68 = iiisdsiiii 69 = iiisdsiiiii 70 = iiisdsiiiiii 71 = iiisdsiiiiiii 72 = iiisdsiiiiiiii 73 = iiissdddddddd 74 = iiissddddddd 75 = iiissdddddd 76 = iiissddddd 77 = iiissdddd 78 = iiissddd 79 = iiissdd 80 = iiissd 81 = iiiss 82 = iiissi 83 = iiissii 84 = iiissiii 85 = iiissiiii 86 = iiissiiiii 87 = iiissiiiiii 88 = iiissiiiiiii 89 = iiissiiiiiiii 90 = iiissiiiiiiiii 91 = iiisisddddddddd 92 = iiisisdddddddd 93 = iiisisddddddd 94 = iiisisdddddd 95 = iiisisddddd 96 = iiisisdddd 97 = iiisisddd 98 = iiisisdd 99 = iiisisd 100 = iiisis 101 = iiisisi 102 = iiisisii 103 = iiisisiii 104 = iiisisiiii 105 = iiisisiiiii 106 = iiisisiiiiii 107 = iiisisiiiiiii 108 = iiisisiiiiiiii 109 = iiisisiiiiiiiii 110 = iiisisiiiiiiiiii 111 = iiisiisdddddddddd 112 = iiisiisddddddddd 113 = iiisiisdddddddd 114 = iiisiisddddddd 115 = iiisiisdddddd 116 = iiisiisddddd 117 = iiisiisdddd 118 = iiisiisddd 119 = iiisiisdd 120 = iiisiisd 121 = iiisiis 122 = iiisiisi 123 = iiisiisii 124 = iiisiisiii 125 = iiisiisiiii 126 = iiisiisiiiii 127 = iiisiisiiiiii 128 = iiisiisiiiiiii 129 = iiisiisiiiiiiii 130 = iiisiisiiiiiiiii 131 = iiisiisiiiiiiiiii 132 = iiisiisiiiiiiiiiii 133 = iiisiiisddddddddddd 134 = iiisiiisdddddddddd 135 = iiisiiisddddddddd 136 = iiisiiisdddddddd 137 = iiisiiisddddddd 138 = iiisiiisdddddd 139 = iiisiiisddddd 140 = iiisiiisdddd 141 = iiisiiisddd 142 = iiisiiisdd 143 = iiisiiisd 144 = iiisiiis 145 = iiisiiisi 146 = iiisiiisii 147 = iiisiiisiii 148 = iiisiiisiiii 149 = iiisiiisiiiii 150 = iiisiiisiiiiii 151 = iiisiiisiiiiiii 152 = iiisiiisiiiiiiii 153 = iiisiiisiiiiiiiii 154 = iiisiiisiiiiiiiiii 155 = iiisiiisiiiiiiiiiii 156 = iiisiiisiiiiiiiiiiii 157 = iissdddsdddddddddddd 158 = iissdddsddddddddddd 159 = iissdddsdddddddddd 160 = iissdddsddddddddd 161 = iissdddsdddddddd 162 = iissdddsddddddd 163 = iissdddsdddddd 164 = iissdddsddddd 165 = iissdddsdddd 166 = iissdddsddd 167 = iissdddsdd 168 = iissdddsd 169 = iissddds 170 = iissdddsi 171 = iissdddsii 172 = iissdddsiii 173 = iissdddsiiii 174 = iissdddsiiiii 175 = iissdddsiiiiii 176 = iissdddsiiiiiii 177 = iissdddsiiiiiiii 178 = iissdddsiiiiiiiii 179 = iissdddsiiiiiiiiii 180 = iissdddsiiiiiiiiiii 181 = iissdddsiiiiiiiiiiii 182 = iissdddsiiiiiiiiiiiii 183 = iissddsddddddddddddd 184 = iissddsdddddddddddd 185 = iissddsddddddddddd 186 = iissddsdddddddddd 187 = iissddsddddddddd 188 = iissddsdddddddd 189 = iissddsddddddd 190 = iissddsdddddd 191 = iissddsddddd 192 = iissddsdddd 193 = iissddsddd 194 = iissddsdd 195 = iissddsd 196 = iissdds 197 = iissddsi 198 = iissddsii 199 = iissddsiii 200 = iissddsiiii 201 = iissddsiiiii 202 = iissddsiiiiii 203 = iissddsiiiiiii 204 = iissddsiiiiiiii 205 = iissddsiiiiiiiii 206 = iissddsiiiiiiiiii 207 = iissddsiiiiiiiiiii 208 = iissddsiiiiiiiiiiii 209 = iissddsiiiiiiiiiiiii 210 = iissddsiiiiiiiiiiiiii 211 = iissdsdddddddddddddd 212 = iissdsddddddddddddd 213 = iissdsdddddddddddd 214 = iissdsddddddddddd 215 = iissdsdddddddddd 216 = iissdsddddddddd 217 = iissdsdddddddd 218 = iissdsddddddd 219 = iissdsdddddd 220 = iissdsddddd 221 = iissdsdddd 222 = iissdsddd 223 = iissdsdd 224 = iissdsd 225 = iissds 226 = iissdsi 227 = iissdsii 228 = iissdsiii 229 = iissdsiiii 230 = iissdsiiiii 231 = iissdsiiiiii 232 = iissdsiiiiiii 233 = iissdsiiiiiiii 234 = iissdsiiiiiiiii 235 = iissdsiiiiiiiiii 236 = iissdsiiiiiiiiiii 237 = iissdsiiiiiiiiiiii 238 = iissdsiiiiiiiiiiiii 239 = iissdsiiiiiiiiiiiiii 240 = iissdsiiiiiiiiiiiiiii 241 = iissdsiiiiiiiiiiiiiiii 242 = iissdsiiiiiiiiiiiiiiiii 243 = iissdsiiiiiiiiiiiiiiiiii 244 = iissdsiiiiiiiiiiiiiiiiiii 245 = iissdsiiiiiiiiiiiiiiiiiiii 246 = iissdsiiiiiiiiiiiiiiiiiiiii 247 = iissdsiiiiiiiiiiiiiiiiiiiiii 248 = iissdsiiiiiiiiiiiiiiiiiiiiiii 249 = iissdsiiiiiiiiiiiiiiiiiiiiiiii 250 = iissdsiiiiiiiiiiiiiiiiiiiiiiiii 251 = iissdsiiiiiiiiiiiiiiiiiiiiiiiiii 252 = iissdsiiiiiiiiiiiiiiiiiiiiiiiiiii 253 = iissdsiiiiiiiiiiiiiiiiiiiiiiiiiiii 254 = iissdsiiiiiiiiiiiiiiiiiiiiiiiiiiiii 255 = iissdsiiiiiiiiiiiiiiiiiiiiiiiiiiiiii

Links

 * Haskell program to generate the constants