The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
Weekend Challenge Sharpened: Missing Positions in Champernowne's Constant
07-30-2015, 04:53 PM (This post was last modified: 08-08-2015 05:14 AM by Gerald H.)
Post: #1
Weekend Challenge Sharpened: Missing Positions in Champernowne's Constant
Every natural number appears at some position in the concatenation of the natural numbers - sometimes called The Gods' Triangle, but let us call it N:

12345678910111213141516171819202122232425262728293031323334353637383940414243444​54647484950515253545556575859606162636465666768697071727374757677787980818283848​58687888990919293949596979899100101102103104105106107108109110111112113114115116​11711811912012112212312412512612712812913013113213313413513613713813914014114214​31441451461471481491501511521531541551561571581591601611621631641651661671681691​70171172173174175176177178179180181182183184185186187188189190191192193194195196​19719819920020120220320420520620720820921021121221321421521621721821922022122222​32242252262272282292302312322332342352362372382392402412422432442452462472482492​50251252253254255256257258259260261262263264265266267268269270271272273274275276​27727827928028128228328428528628728828929029129229329429529629729829930030130230​33043053063073083093103113123133143153163173183193203213223233243253263273283293​30331332333334335336337338339340341342343344345346347348349350351352353354355356​35735835936036136236336436536636736836937037137237337437537637737837938038138238​33843853863873883893903913923933943953963973983994004014024034044054064074084094​10411412413414415416417418419420421422423424425426427428429430431432433434435436​43743843944044144244344444544644744844945045145245345445545645745845946046146246​34644654664674684694704714724734744754764774784794804814824834844854864874884894​90491492493494495496497498499500....

For example

399

starts at the

1087th

digit of N &

400

at the

1090th

digit, counting from the first 1 rightwards.

The programme for the 49G below gives the starting position in N for the entry integer.

Challenge

You will notice that for consecutive integers, eg 399 & 400, the positions are not consecutive, so 1088 & 1089 do not appear as the starting positions of any integer.

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

for index

1

the programme returns

11

as 11 is the lowest number not representing the start position of an integer.

Clarification following posts #2 & #3

For input

2

the programme should return

13

for 3, 15........

Sorry for the imprecision of definition.

Code:

If you don'like CODE .... replace it with xSIZE COERCE.

::
  CK1&Dispatch
  # FF
  ::
    FPTR2 ^ZABS
    DUP
    CODE 00025 143174E78FB9760131174143818F858DC7530
    DUPUNROT
    FPTR2 ^#>Z
    FPTR2 ^RMULText
    Z1_
    FPTR2 ^RADDext
    Z10_
    ROT
    FPTR2 ^PPow#
    Z1_
    FPTR2 ^RSUBext
    Z9_
    FPTR2 ^ZQUOText
    FPTR2 ^RSUBext
  ;
;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Weekend Challenge Sharpened: Missing Positions in Champernowne's Constant - Gerald H - 07-30-2015 04:53 PM



User(s) browsing this thread: 1 Guest(s)