Saturday, December 12, 2015

More Fun with Cyclops Numbers

UPDATED:
Added Details and Links


I created a fun function to compute Cyclops Numbers, see previous post.



D=9; C=0; L=27; 
echo "obase=${D}+1;(${D}+1)^(2*${L}-1) -1 -(${D}-(${C}%${D}))*(${D}+1)^(${L}-1)" | bc

Where:
  • D = Is the side Digits, 1 to 9
  • C = Is the single Cyclops Eye Digit, must be < D, or C mod D will be used
  • L = The Cyclops Eye Location (width)

D=8; C=3; L=2; => 838
D=8; C=3; L=3; => 88388
D=8; C=3; L=4; => 8883888
D=4; C=8; L=5; => 444484444
D=9; C=0; L=6; => 99999099999

The results for the above function:

99999999999999999999999999099999999999999999999999999


It is all fun and games, until someone pokes the Cyclops Eye   :-)


-- Home Page: https://WA0UWH.blogspot.com


2 comments:

  1. Not sure what language you used.

    This is the equivalent function in C#:
    Layout = "";
    var Digit = '9';
    var Center = '0';
    var Length = 27;
    var cyclops = (new String(Digit, Length - 1) + Center + new String(Digit, Length - 1));
    @cyclops //mvc/razor to display in html page

    ReplyDelete
  2. Very Good !!

    I thought about using a "text" function to generate the number, but wanted to continue with my use of a math function (and bc) to actually compute the value, see a previous post.

    Thanks.
    Eldon - WA0UWH

    ReplyDelete