Questions tagged [number-bases]

Tag for questions about using various number bases in Mathematica. This includes, but is not restricted to base notation, base conversion and formatting issues.

37 questions
15
votes
4 answers

How to convert from base 2 to base n?

I'm trying to use baseform to convert numbers in base 10 to base n, how can I make the convertion between, say base 2 to base n? Baseform seems to always think that the base in expr BaseForm[Expr, n] is always 10.
Red Banana
  • 5,329
  • 2
  • 29
  • 47
1
vote
1 answer

Select base and exponent of arbitrary number

I want to write a function say BaseExponent that will output the base and exponent of a number. In particular it should do the following: BaseExponent[(1 + I Sqrt[3])^(1/72)] = {(1 + I Sqrt[3]), 1/72} BaseExponent[72] = {72, 1} BaseExponent[1/4] =…
wisedoe
  • 239
  • 1
  • 7
1
vote
0 answers

IntegerString output using Roman numerals

I noticed a peculiar behavior of the IntegerString command that I would like to bring to the attention of the community. The code is as follows: Clear[i] Symbol@IntegerString[1, "Roman"] t1 = Table[{Symbol@IntegerString[i, "Roman"], i}, {i, 10}] t2…
Syed
  • 52,495
  • 4
  • 30
  • 85
1
vote
1 answer

How do I check if the base-$b$ representation of my number contains the same digits?

I came up with the following exercise with the intention of learning Mathematica but I am already stuck in the beginning. Let $ n,b $ denote positive integers with $ n>0 $ and $ b\geq2 $. My aim is to check whether the base-$ b $ representation of $…
Klangen
  • 1,009
  • 5
  • 14
1
vote
1 answer

No function to enter value in a different base?

I notice that there is a syntax to enter a numeric literal in a different base, for example: In[8]:= 5^^1000000000000101 Out[8]= 30517578151 However, there does not seem to be any function to enter a number in a different base. Since, it seems…
Tyler Durden
  • 4,090
  • 14
  • 43
0
votes
1 answer

What is the preferred way to go from a non-decimal basis to a decimal basis?

We can insert a number in a basis different than 10 using the basis^^number expression. However, strangely enough, there does not seem to be a corresponding functional form to do this. Moreover, to convert a number of inputs to decimal basis, the…
glS
  • 7,623
  • 1
  • 21
  • 61