4
$\begingroup$

Much like the Word-tank-wheel challenge, but numbers!

Find a number that can 'rotate' in a way that the origin number and its rotations must be divisible (i.e. whole number) by the number of times it rotated.

Here's some examples of potential answer:

Example 1:
Number to start with: 321
Rotations: 3
Result:

origin number - 321 (321/3 = 107, pass)  
rotation 1: 213 (213/3 = 71, pass)  
rotation 2: 132 (132/3 = 44, pass)  
rotation 3: 321 (pass)  

Example 2:
Number to start with: 1644444
Rotations: 4
Result:

origin number - 1644444 (1644444 /4 = 411111, pass)  
rotation 1: 4164444 (4164444/4 = 1041111, pass)  
rotation 2: 4416444 (4416444/4 = 1104111, pass)  
rotation 3: 4441644 (4441644/4 = 1110411, pass) 
rotation 4: 4444164 (4444164/4 = 1111041, pass) 

Rules:
- Must be at least 3 digits & 3 rotations
- Rotation must be in the same direction
- Rotation ≤ Digit (to prevent infinite looping, see example 1)
- Cannot use repeating numbers (11111, 22222, etc) or number starting / ending with 0's (100, 01230, etc)
- Base 10 number system, positive numbers

Scoring:
- ([Digit] x [Rotations]) / (1 + (Digit - Rotation)), hence:
- Example 1 = 3 (Digits) x 3 (Rotations) / 1 = score of 9
- Example 2 = 7 (Digits) x 4 (Rotations) / 4 = score of 7

Highest score wins.
This challenge will remains open for at least 2 days.

Time's up!

Highest score: Jonathan Allan with score of ..um... ∞!
Great attempts with others who joined the challenge!

$\endgroup$
  • $\begingroup$ don't we have to attempt to divide 1644444 by 7, i.e. the number of digits? $\endgroup$ – JMP Aug 5 '16 at 20:34
  • 2
    $\begingroup$ @JonMarkPerry Alex's rules clarify no, you'll just score more points if you can find a number that accommodates a number of divisible rotations very close to its length. $\endgroup$ – C. Woods Aug 5 '16 at 20:35
  • $\begingroup$ ...I just noticed your example $2$ - looks like we can go higher :) $\endgroup$ – Jonathan Allan Aug 5 '16 at 21:49
  • $\begingroup$ Honestly it goes beyond what I imagined the answer would be, it's far more interesting! $\endgroup$ – Alex Aug 8 '16 at 15:24
9
$\begingroup$

We can make a score of

...as high as we want* (subject to paper, ink and time - or "memory limitations")

* Update to method

An issue with the method given below is that $9$s become more frequent in $9^p$ as $p$ increases and we need to mutate more than just $2$ digits here and there. We can definitely do $p=28$ as $9^{28}$ has no $9$s, for a score of $72057594037927936$

Furthermore we can probably do this new method for any $p$ (not proven to myself yet):

Make $x=10^{9^{^{p}}}-1$
- a string of $9^p$ $9s$ (which will be divisible by $9^p$)
then make $n$ by subtracting a multiple of $9^p$ which has no $9$s but is less than $9^p$ digits long (actually we can go a bit higher if we really need to as the first digit of $x$ is a $9$)

As an example take $p=125$ - the smallest multiple of $9^p$ we can subtract in this case is $45409$, but that has only $124$ digits, nowhere near the $9^{125}-1$ digit limit we set ourselves above.

That would be $n=10^{9^{125}}-45409\times9^{125}-1$
obviously too big to write in an answer, and would give a score of $9^{250}$:

36360291795869936842385267079543319118023385026001623040346035832580600191583895484198508262979388783308179702534403855752855931517013066142992430916562025780021771247847643450125342836565813209972590371590152578728008385990139795377610001

Previous method

Make a string of $9$s of length $9^p-2$, place $2$ digits that sum to $9$ (e.g. $18$) somewhere in the string to make a value, $x$, of length $9^p$. The choice of where to place the two non-$9$ digits is made such that $n=x-(x\pmod{9^p})$ contains no zeros (this new string, $n$, is not going to be just $9$s and it will still have length $9^p$).

Such answers

quickly become too long to perform string manipulation in memory on my laptop (I could probably do something clever here I guess) but also would take an age to exhaustively check all rotations, although it is guaranteed due to the string's digits summing to a multiple of $9$ (we made our new $n$ congruent to $0$ modulo $9^p$) while being a length of $9^p$.

Here is an example

for which I have exhaustively tested all rotations, but which is too long for a SE answer box
using a $p$ of just $5$:
$18999\cdots99959256$

that is $18$ followed by $59042$ $9$s followed by $59256$
for a fully rotatable and divisible string of length of $9^5=59049$

For a score of

$\frac{59049^2}1=3486784401$


Original approach assumed "no repeated digits" meant something else and follows...

See further down for a score of

$43046721$

Pretty sure this can be extended for a higher score...

Score of $\frac{81\times81}1=6561$
$812345687923456789134567891245678912356789123467891234578912345689123456791234396$

Test in Python:

>>> n = 812345687923456789134567891245678912356789123467891234578912345689123456791234396
>>> s = str(n)
>>> for rotation in range(1, 82):
...     s = s[-1] + s[:-1]
...     if int(s) % 81:
...             print('failed at rotation {0}'.format(rotation))
... else:
...     print('success!')
...
success!
>>>

OK lets extend it - I use permutations of digits here to avoid repetition. More Python code:

>>>from itertools import permutations
>>> def makeN(l):
...     if l > 362880:
...             raise ValueError('Not enough permutations of 9 digits to satisfy the no repetition rule')
...     res = ''
...     digits = ''.join([str(i) for i in range(9, 0, -1)])
...     for p in permutations(digits):
...             for c in p:
...                     res += c
...                     if len(res) == l:
...                             res = int(res)
...                             res = res - (res % l)
...                             if '0' in str(res):
...                                     if res % 10 == 0 and l % 10 == 0:
...                                             raise ValueError('cannot produce a valid n for this l')
...                                     res += l
...                                     while '0' in str(res):
...                                             res += l
...                             return res
...

Now we can certainly score

$\frac{6561^2}1=43046721$ with makeN(6561)

With:

987654321987654312987654231987654213987654132987654123987653421987653412987653241987653214987653142987653124987652431987652413987652341987652314987652143987652134987651432987651423987651342987651324987651243987651234987645321987645312987645231987645213987645132987645123987643521987643512987643251987643215987643152987643125987642531987642513987642351987642315987642153987642135987641532987641523987641352987641325987641253987641235987635421987635412987635241987635214987635142987635124987634521987634512987634251987634215987634152987634125987632541987632514987632451987632415987632154987632145987631542987631524987631452987631425987631254987631245987625431987625413987625341987625314987625143987625134987624531987624513987624351987624315987624153987624135987623541987623514987623451987623415987623154987623145987621543987621534987621453987621435987621354987621345987615432987615423987615342987615324987615243987615234987614532987614523987614352987614325987614253987614235987613542987613524987613452987613425987613254987613245987612543987612534987612453987612435987612354987612345987564321987564312987564231987564213987564132987564123987563421987563412987563241987563214987563142987563124987562431987562413987562341987562314987562143987562134987561432987561423987561342987561324987561243987561234987546321987546312987546231987546213987546132987546123987543621987543612987543261987543216987543162987543126987542631987542613987542361987542316987542163987542136987541632987541623987541362987541326987541263987541236987536421987536412987536241987536214987536142987536124987534621987534612987534261987534216987534162987534126987532641987532614987532461987532416987532164987532146987531642987531624987531462987531426987531264987531246987526431987526413987526341987526314987526143987526134987524631987524613987524361987524316987524163987524136987523641987523614987523461987523416987523164987523146987521643987521634987521463987521436987521364987521346987516432987516423987516342987516324987516243987516234987514632987514623987514362987514326987514263987514236987513642987513624987513462987513426987513264987513246987512643987512634987512463987512436987512364987512346987465321987465312987465231987465213987465132987465123987463521987463512987463251987463215987463152987463125987462531987462513987462351987462315987462153987462135987461532987461523987461352987461325987461253987461235987456321987456312987456231987456213987456132987456123987453621987453612987453261987453216987453162987453126987452631987452613987452361987452316987452163987452136987451632987451623987451362987451326987451263987451236987436521987436512987436251987436215987436152987436125987435621987435612987435261987435216987435162987435126987432651987432615987432561987432516987432165987432156987431652987431625987431562987431526987431265987431256987426531987426513987426351987426315987426153987426135987425631987425613987425361987425316987425163987425136987423651987423615987423561987423516987423165987423156987421653987421635987421563987421536987421365987421356987416532987416523987416352987416325987416253987416235987415632987415623987415362987415326987415263987415236987413652987413625987413562987413526987413265987413256987412653987412635987412563987412536987412365987412356987365421987365412987365241987365214987365142987365124987364521987364512987364251987364215987364152987364125987362541987362514987362451987362415987362154987362145987361542987361524987361452987361425987361254987361245987356421987356412987356241987356214987356142987356124987354621987354612987354261987354216987354162987354126987352641987352614987352461987352416987352164987352146987351642987351624987351462987351426987351264987351246987346521987346512987346251987346215987346152987346125987345621987345612987345261987345216987345162987345126987342651987342615987342561987342516987342165987342156987341652987341625987341562987341526987341265987341256987326541987326514987326451987326415987326154987326145987325641987325614987325461987325416987325164987325146987324651987324615987324561987324516987324165987324156987321654987321645987321564987321546987321465987321456987316542987316524987316452987316425987316254987316245987315642987315624987315462987315426987315264987315246987314652987314625987314562987314526987314265987314256987312654987312645987312564987312546987312465987312456987265431987265413987265341987265314987265143987265134987264531987264513987264351987264315987264153987264135987263541987263514987263451987263415987263154987263145987261543987261534987261453987261435987261354987261345987256431987256413987256341987256314987256143987256134987254631987254613987254361987254316987254163987254136987253641987253614987253461987253416987253164987253146987251643987251634987251463987251436987251364987251346987246531987246513987246351987246315987246153987246135987245631987245613987245361987245316987245163987245136987243651987243615987243561987243516987243165987243156987241653987241635987241563987241536987241365987241356987236541987236514987236451987236415987236154987236145987235641987235614987235461987235416987235164987235146987234651987234615987234561987234516987234165987234156987231654987231645987231564987231546987231465987231456987216543987216534987216453987216435987216354987216345987215643987215634987215463987215436987215364987215346987214653987214635987214563987214536987214365987214356987213654987213645987213564987213546987213465987213456987165432987165423987165342987165324987165243987165234987164532987164523987164352987164325987164253987164235987163542987163524987163452987163425987163254987163245987162543987162534987162453987162435987162354987162345987156432987156423987156342987156324987156243987156234987154632987154623987154362987154326987154263987154236987153642987153624987153462987153426987153264987153246987152643987152634987152463987152436987152364987152346987146532987146523987146352987146325987146253987146235987145632987145623987145362987145326987145263987145236987143652987143625987143562987143526987143265987143256987142653987142635987142563987142536987142365987142356987136542987136524987136452987136425987136254987136245987135642987135624987135462987135426987135264987135246987134652987134625987134562987134526987134265987134256987132654987132645987132564987132546987132465987132456987126543987126534987126453987126435987126354987126345987125643987125634987125463987125436987125364987125346987124653987124635987124563987124536987124365987124356987123654987123645987123564987123546987123465987123456986754321986754312986754231986754213986754132986754123986753421986753412986753565
$\endgroup$
3
$\begingroup$

Score:81

819999999 over 9 rotations

$\endgroup$
  • $\begingroup$ what if you used all even digits,,, $\endgroup$ – Jasen Aug 6 '16 at 3:58
2
$\begingroup$

for rotations = digits = divisior the highest score I could find was find is score 164

222,222,222,444,444,444 is divisible by 18 over 18 rotations

because all permutations are even and divisible by nine

but then I reasised:

888,888,888,888,888,888,444,444,444,444,444,444

is divisible by 36 for all permutations scoring 1296

$\endgroup$
  • $\begingroup$ It looks like this answer is strictly inferior to content that is already thoroughly expressed in another answer. (Jonathan Allan already beat your answer by several orders of magnitude.) In the future, please be sure to read through other answers on the site before adding your own. Thanks! $\endgroup$ – Deusovi Aug 6 '16 at 4:16
  • 1
    $\begingroup$ I have a larger divisor than any other answer, strings of infinite length are uninsteresting to me $\endgroup$ – Jasen Aug 6 '16 at 4:20
  • $\begingroup$ How is $36$ greater than $9^{125}$ (my largest finite divisor example)? Note that that example is also divisible for the full $9^{125}$ rotations. $\endgroup$ – Jonathan Allan Aug 6 '16 at 6:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.