Post Reply 
(50g) Integer Cube Root of an Integer
09-02-2017, 03:34 PM
Post: #1
(50g) Integer Cube Root of an Integer
For positive integer input N the programme returns the integer cube root, ie greatest integer cubed less than or equal to N.

For a random 1000 digit number

33723332557553775353525757337573537755533522772333232727225373253275725533335725​27325352752552573533222555227325357735332722375322535733533357722577325522733537​22235277532535355573272752525725227232537255772272757257527237257753332727532572​73327232573752273222237775335227233255273532577535572353227753773757222523352237​22525757355532355535723335557752773733555333732222737255732752335355532352737727​25275753355322773722522255535357537273523327777757235335733357535377323227722775​72252537733375735527537325777753357533273727575335727257327253772727233237537522​23733772357772257737732225553352323372277333273325325352557275755222353722537332​52737773327332777253377752353222323577223275257722273575357223737723575273533225​35777235737222727575772757573223575375222233277233752352773775273227357573557753​72275225532532322223772373575352252555552237577775733733523277325773755253527377​25532772333735733533753327773275227327573532275372557727335525352752377255353752​7735327732557323757327355353375255332733

the programme returns the integer cube root

14996048226776396981365120549516562555070959721242805493773661164963544888188015​56346435842736638915543782177873566529474838650069733763644482058793228038399075​85820587978412754592271325754859922095805411972846649767779396263186073689402512​30957274613534313832689378142569694744490574471694589142990940757353632225827412​71212646504465

in 70s.

Code:
::
  CK1&Dispatch
  # FF
  ::
    Z2_
    OVER
    FPTR2 ^Z>ZH
    FPTR2 ^ZBits
    BINT3
    #/
    ROTROT2DROP
    #1+
    FPTR2 ^PPow#
    BEGIN
    DUP
    BINT3
    FPTR2 ^PPow#
    DUP
    4PICK
    DUP
    FPTR2 ^RADDext
    FPTR2 ^RADDext
    3PICK
    FPTR2 ^RMULText
    SWAPDUP
    FPTR2 ^RADDext
    4PICK
    FPTR2 ^RADDext
    FPTR2 ^ZDIVext
    DROP
    DUPUNROT
    Z>
    NOT_UNTIL
    SWAPDROP
  ;
;
SIZE 127.5

CKSUM # 27E5h
Find all posts by this user
Quote this message in a reply
09-02-2017, 07:06 PM
Post: #2
RE: (50g) Integer Cube Root of an Integer
(09-02-2017 03:34 PM)Gerald H Wrote:  For a random 1000 digit number

33723332557553775353525757337573537755533522772333232727225373253275725533335725​27325352752552573533222555227325357735332722375322535733533357722577325522733537​22235277532535355573272752525725227232537255772272757257527237257753332727532572​73327232573752273222237775335227233255273532577535572353227753773757222523352237​22525757355532355535723335557752773733555333732222737255732752335355532352737727​25275753355322773722522255535357537273523327777757235335733357535377323227722775​72252537733375735527537325777753357533273727575335727257327253772727233237537522​23733772357772257737732225553352323372277333273325325352557275755222353722537332​52737773327332777253377752353222323577223275257722273575357223737723575273533225​35777235737222727575772757573223575375222233277233752352773775273227357573557753​72275225532532322223772373575352252555552237577775733733523277325773755253527377​25532772333735733533753327773275227327573532275372557727335525352752377255353752​7735327732557323757327355353375255332733

I imagine my comment is unrelated to your program, but this does not look like a "random" number to me, it contains only the digits 2,3, 5 and 7.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
09-02-2017, 08:51 PM
Post: #3
RE: (50g) Integer Cube Root of an Integer
Well yes, not really random & yet very random.

I wanted to see what a 1,000 digit 2357 number looks like & you never know, it just might have been a cube.
Find all posts by this user
Quote this message in a reply
09-02-2017, 10:19 PM
Post: #4
RE: (50g) Integer Cube Root of an Integer
(09-02-2017 07:06 PM)rprosperi Wrote:  I imagine my comment is unrelated to your program, but this does not look like a "random" number to me, it contains only the digits 2,3, 5 and 7.

[Image: 321a39e06d6401301d80001dd8b71c47]

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
09-03-2017, 07:45 AM
Post: #5
RE: (50g) Integer Cube Root of an Integer
What do you think, Bob, of the cube root above as a source of random digits?
Find all posts by this user
Quote this message in a reply
09-04-2017, 12:31 AM
Post: #6
RE: (50g) Integer Cube Root of an Integer
(09-03-2017 07:45 AM)Gerald H Wrote:  What do you think, Bob, of the cube root above as a source of random digits?

Well, pier4's cartoon really says it all, you can never be sure just how random a sample number is, your original number could be just as random as any other; it just appears suspicious when it only contains a limited number of digits.

The cube root does appear to be more random, but that doesn't mean much either.

I was just curious if the sample used had been selected for some specific reason.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
Post Reply 




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