All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Duodecimal Digital Expansion Puzzle (Posted on 2023-03-11) Difficulty: 3 of 5
Consider the digital expansion of this duodecimal fraction:
 (4)12
--------
 (19)12
Determine the (419)12th duodecimal digit to the right of the duodecimal point.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Solution | Comment 2 of 3 |
My result confirms Charlie's solution.  The desired digit is 5.

The base 12 result is 0.2(35186A), with the part in parentheses repeating every 6.

My routine made a list with the first element being a 0, which as it happens works out nicely in Python, since the list indices are zero based.

to print out the first 19 duodecimal places, I need "places" to be one more than 19:
div12(4,19,12,20)
returns:
[0, 2, 3, 5, 1, 8, 6, 10, 3, 5, 1, 8, 6, 10, 3, 5, 1, 8, 6, 10]


def div12(x,y,base,places):
    """ Divide x by y where both are in base "base", out to n_places places
    with the result showing in base base.  Make output a list and use 'digits'
    such as 10, 11, 12 etc instead of A, B, C
    Have x be less than y, so that there is nothing before the 'decimal' point """
    num = base2base(x,base,10)
    den = base2base(y,base,10)
    ans = []
    divd = num
    for i in range(places):
        digit = divd//den
        remain = divd%den
        ans.append(digit)
        divd = (remain)*12
    return ans

x = base2base(419,12,10)    # which evaluates to 597
answerList = div12(4,19,12,x+1)
print(answerList[x])

prints out:
5
  Posted by Larry on 2023-03-11 10:09:14
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (14)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information