in reply to Can It Be Written In Base X With Only 1s And 0s
There is a pattern, but it is quite hard to describe. It's a -- for want of a better term -- a reducing, recursive power series.
So, for base 3, these are all the numbers that only use 0 or 1:
| + +3^4 | +3^3 + | + +3^3 | | +3^2 | + +3^2 | +3^2 + | +3^2 | +3^1 | +3^1 | + +3^1 | +3^1 | +3^1 | ++3^1 | +3^1 | +3^1 | +3^0 | +3^0 | +3^0 | +3^0 | +3^0 + | +3^0 | +3^0 | +3^0 | +3^0 | +3^0 | +3^0 + | +3^0 | +3^0 | +3^0 | +3^0 | +3^0 ---+--------------+----------+----------------+---------+------------- +--+-----------+-----------+-----------+-------------+---------+------ +--+---------+----------+---------+---------+------ ^0 | 1 | | + | ^1 | 3 4 | | + | ^2 | 9 10 12 13 | | + | ^3 | 27 28 30 31 | 36 37 39 40 | + | ^4 | 81 82 84 85 | 90 91 93 94 | 108 109 + 111 112 117 118 120 121 | ^5 | 243 244 246 247 | 252 253 255 256 | 270 271 + 273 274 279 280 282 283 | 324 325 327 328 333 334 + 336 337 351 352 354 355 360 361 363 364 ^6 | 729 ...
The +3^0s (ie.+1) is always applied to the number immediately to its left to derive the number underneath it.
The +3^1s (ie.+3) is always applied to the number two to its left to derive the number underneath it.
The +3^2s (ie.+9) is always applied to the number four to its left to derive the number underneath it. Etc.
Clear as mud right! Can't think of a better way to describe it.
For base-4, the same pattern emerges:
+ +4^4 +4^3 + +4^3 +4^2 + +4^2 +4^2 + +4^2 +4^1 +4^1 +4^1 + +4^1 +4^1 +4^1 + +4^1 +4^1 +4^1 +4^0 +4^0 +4^0 +4^0 +4^ +0 +4^0 +4^0 +4^0 +4^0 +4^0 +4^0 + +4^0 +4^0 +4^0 +4^0 +4^0 ^0 1 ^1 4 5 ^2 16 17 20 21 ^3 64 65 68 69 80 81 84 85 ^4 256 257 260 261 272 273 276 277 320 321 324 32 +5 336 337 340 341 ^5 1024 1025 1028 1029 1040 1041 1044 1045 1088 1089 1092 109 +3 1104 1105 1108 1109 1280 1281 1284 1285 1296 1297 1300 1301 1344 + 1345 1348 1349 1360 1361 1364 1365 ^6 4096 4097 4100 4101 4112 4113 4116 4117 4160 4161 4164 416 +5 4176 4177 4180 4181 4352 4353 4356 4357 4368 4369 4372 4373 4416 + 4417 4420 4421 4432 4433 4436 4437 5120 512 .... ^7 16384 ...
That should be codable as recursive iterator routine with a nested loop -- though its not falling off the page for me -- but more importantly should be expressible as a formula in terms of N which would avoid the need to do any conversions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can It Be Written In Base X With Only 1s And 0s
by Limbic~Region (Chancellor) on Jun 16, 2015 at 11:27 UTC | |
by BrowserUk (Patriarch) on Jun 16, 2015 at 12:11 UTC | |
by Limbic~Region (Chancellor) on Jun 16, 2015 at 12:53 UTC | |
by BrowserUk (Patriarch) on Jun 16, 2015 at 13:13 UTC |