Weekend Challenge Sharpened: Missing Positions in Champernowne's Constant
|
08-04-2015, 05:04 AM
Post: #5
|
|||
|
|||
RE: Weekend Challenge: Missing Positions in Gods' Triangle
(07-30-2015 04:53 PM)Gerald H Wrote: Write a programme that on input of the index of a number, say C, that cannot appear as position of any integer returns C, eg The following does the trick: Code: « As requested, it returns 11 for an input of 1, 1089 for an input of 690, and, for example, 1124999998 for an input of 987654321. [Here i refers to an index into God's Number, c refers to the "dead" digits of God's Number where no integer starts, and ch (characteristic) is the power of ten currently being addressed as we iterate from the "units" to the "tens" to the "hundreds" etc.. All local variables are initialised to zero except for the input value, c.] |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: