Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Can It Be Written In Base X With Only 1s And 0s

by Laurent_R (Canon)
on Jun 15, 2015 at 21:57 UTC ( [id://1130532]=note: print w/replies, xml ) Need Help??


in reply to Re: Can It Be Written In Base X With Only 1s And 0s
in thread Can It Be Written In Base X With Only 1s And 0s

And, in addition, it seems to me that if you do the full conversion, then you might be able to reduce considerably the number of numbers that you need to check. Suppose for example that, in base 4, you find one number to be 20000001. Then you know that there is no point to check any number between 20000001(4) and 33333333(4), as none of them is a likely candidate to be made of only 0's and 1's.

This huge optimization might be possible without doing the full conversion, but it looks far less easy.

  • Comment on Re^2: Can It Be Written In Base X With Only 1s And 0s

Replies are listed 'Best First'.
Re^3: Can It Be Written In Base X With Only 1s And 0s
by ikegami (Patriarch) on Jun 15, 2015 at 22:31 UTC

    That's what the iterator in my other post does. If you're looking for the 5th term, it will produce the following sequence:

    105
    115
    1005
    1015
    1105
    1115
    10005
    ...
    1111115
    10000005
    ...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1130532]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (2)
As of 2024-04-20 04:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found