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.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I'm with torvalds on this
In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked

In reply to Re: Can It Be Written In Base X With Only 1s And 0s by BrowserUk
in thread Can It Be Written In Base X With Only 1s And 0s by Limbic~Region

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.