2020-08-26 MATH 3600

459 days ago by calkin

b=10 # This is the default number of digits def list_to_number(L,bb): # This function will take the digits of n in low to high order and compute the temp = 0 # number corresponding to the reversal of those digits for num in L: temp=temp*bb+num return(temp) 
       
n=157 
       
list_to_number(n.digits(b),b) 
       
751
751
list_to_number(n.digits(3),3).digits(3) 
       
[1, 2, 2, 1, 1]
[1, 2, 2, 1, 1]
n.digits(3) 
       
[1, 1, 2, 2, 1]
[1, 1, 2, 2, 1]