Questions tagged [number-representation]

Questions about interpretation of numeric input or how Mathematica stores and manipulates numbers internally.

Filter by
Sorted by
Tagged with
0
votes
1answer
51 views

Check if a fraction leads to an integer, choose $r$ and run trough $0\le a\le n$ and go to $r+1$

Well, I am trying to do the following: I have two functions $y(r,a)$ and $z(r,a)$ and I want to check of the division of both those functions leads to an integer. In order to do that I want to choose ...
2
votes
2answers
106 views

Finding IntegerPartitions[252] with no zero and no duplicates

Well, I am trying to execute the following code: ...
0
votes
0answers
43 views

Alternative for PowerRepresentations[n, x, 1]

I am looking for numbers $n$ that can be written as the sum of other numbers. So: PowersRepresentations[n, x, 1]. But is there a faster way of finding these numbers?...
4
votes
3answers
296 views

Checking if a number is right sorted

I have a number $n$ such that the digits of $n$ are strictly increasing to the left except for the first digit. So for example when $n=51369$ fits the bill because: $$1<3<6<9\tag1$$ Is there ...
6
votes
2answers
549 views

How to force Mathematica to do infinite-precision calculations?

Consider the following calculation: 1234*5678*90.12 The result is: 6.31439*10^8 However, I want to get a precise result. Of ...
5
votes
8answers
1k views

Making the number 12345...n

Well, I am trying to write a code that makes the number: $$123456\dots n\tag1$$ So, when $n=10$ we get: $$12345678910$$ And when $n=15$ we get: $$123456789101112131415$$ And when $n=4$ we get: $$1234$$...
2
votes
1answer
74 views

Get sign of unassigned variables

I want to find the signs of the following expression of unassigned variables: a = x1 x2 - x3 x4; The signs or prefactors are +1 ...
1
vote
0answers
60 views

Implementing the Binary GCD algorithm in Mathematica

Well, I have $n\in\mathbb{N}$ and I want to transform $n$ to a binary number which can be done using FromDigits[IntegerDigits[n, 2]]. I want to compute the ...
0
votes
0answers
32 views

Making a binary number $n$ that must contain $k$ times a $1$ such that `k==GCD[n,IntegerReverse[n]]`

Well, I am trying to code the following thing in Mathematica: I have a binary number $n$ that must contain $k$ times a $1$. So for example: when $k=5$ the following binary numbers does fit the rule: $$...
1
vote
1answer
70 views

Solving a system of equations using a list of possible solutions

Well, I have for example the following input and output of a code: ...
1
vote
1answer
73 views

Parallel Mathematica-code that runs too slow when running PowerRepresentations[] function

Well, I am a student in elementary number theory and trying to find natural numbers that can be written as the sum of integers to the power of an integer. The code I am using now is the following: <...
0
votes
0answers
41 views

Solving a system of equations (works with squares not with fifth powers)

Well, I was trying to solve a system of equations in a different question of mine. There @kglr gave a very efficient code for solving that system of equations using squares: ...
3
votes
1answer
77 views

Removing a element from list when obeying a certain condition

Well, I have the following code: Select[PowersRepresentations[n, a, b], DuplicateFreeQ[#] && ! MemberQ[#, 0] &] This code finds ...
3
votes
3answers
237 views

Solving for a unique set of solutions

I have the following code: ...
1
vote
2answers
60 views

Is there a function in Mathematica that saves the power of 10 of a number in scientific form?

I have a number for instance 0.0622. I want to put it in ScientificForm so I do ...
0
votes
0answers
65 views

How to Shape Text?

Imagine I have a certain number 23819657294172004194219023914217958273128471531429470113 If I convert it to a string with ...
1
vote
1answer
70 views

How to express number in exponential decimal such as 1e2=100?

I am using MATLAB for a long time, and usually I express the number as exponential decimal such as x = 1e2; % x=100 However, if I write this form in mathematica, ...
1
vote
1answer
65 views

Extending NumberForm

I'd like to define a function, call it NumberF, that takes a real number n and two naturals l...
0
votes
1answer
66 views

Conversion to expression in base 17 with particular needs

So, I am trying to write a function that takes a number between 0 and 1 in base 10 as input and gives a list of its decimal figures in it's expression in base 17. For example, $f(0.5)= \lbrace 8,8,8,8,...
1
vote
0answers
69 views

How does this FromDigit module work?

I am entering the following input: ...
0
votes
1answer
57 views

Exporting complex exponential float arrays to Python

A question related to a previous question. The answer in the previous question works well for simple complex arrays but not when considering arrays with exponential float coefficients as in the ...
1
vote
0answers
40 views
2
votes
0answers
72 views

PaddedForm - DigitBlock only respected for non-padding

I'm trying to pad some binary and hexadecimal numbers using PaddedForm, and also to separate the digits into blocks of 4. For example, I'd like a number like ...
8
votes
0answers
207 views

How would one add Hyperreals as a new type to Mathematica?

Hyperreals are an extension to the real numbers; they formalise the concepts of infinities and infinitestimals as numbers, rather than the named limit points outside of the system of reals and form ...
1
vote
1answer
52 views

How to make StringCases to understand the scientific form of numbers?

Consider the string string="Tau_distribution_mass=547.0_theta=6.87982e-05.txt"; I would like to make a row ...
1
vote
2answers
86 views

How can I test if the sum of two divisors of a number add up to a perfect square? [closed]

Let's say I have a number $n$ and I want to find the divisors of $n$, I can do that using Divisors[n]. That will generate a list ...
0
votes
0answers
36 views

How to copy and paste numbers with "`" mark and use them in calculations, without using N or setting precision every time

Suppose we have run a calculation and get a number like 2.758952615889003` If we then copy-paste this number and do a calculation like ...
0
votes
0answers
40 views

Find the nearest exact form of an irrational number [duplicate]

Is it possible to find the nearest exact form of an irrational number if the decimal number is given? Suppose i only have $6$ digits i.e. $3.14159$ the output should tell me one of the possibilities ...
2
votes
0answers
44 views

Question to developers: what are the actual or potential difficulties in implementing split-complex unity $j$ out of the box?

I wonder, what are some real or potential and purely theoretic difficulties you may face if you decided to implement the split-complex unity $j$ such that $j^2=1$ along with already existing complex ...
13
votes
2answers
680 views

How to enter a repeating decimal in Mathematica

I don't understand how to manipulate numbers with repeating decimal in Wolfram Mathematica language. For example 0.3... does not work as input and I don't see how ...
0
votes
2answers
45 views

How to export InputForm of a number

I need to export full form of a number i.e. the actual form with which Mathematica works. For example, full form of a number is ...
0
votes
0answers
65 views

Correct way to format numbers

I have defined the following function: randvec[mag_]:= mag Normalize[Table[RandomReal[], {j, 1, 4}]] I would like to format the numbers in the list so that they ...
2
votes
3answers
154 views

How to make the Ticks larger? [closed]

I can´t find the option for larger ticks ...
2
votes
1answer
72 views

Concatenate a variable with a string

I have a little problem with a variable and a string. I built a game with a panel that shows a random word,the player clicks "Yes" if he knows the meaning and clicks "No" otherwise....
0
votes
1answer
62 views

Is there a way to use identities in Mathematica efficiently? [duplicate]

Imagine I have defined a variable l=p/(a*b) Let's say I perform some operations, and I get the final answer to be p/a. But all I ...
1
vote
1answer
42 views

Rounding Issue with a number containing "`"

I would like to round a number saved in a weird format (I have no idea what the "`" means, could someone explain?) to 3 digits: ...
2
votes
2answers
238 views

Unexpected Indeterminate result from evaluating a limit [closed]

Consider $\qquad \underset{h\to 0}{\text{lim}}\dfrac{\sqrt[4]{h+x}-\sqrt[4]{x}}{\sqrt{h+x}-\sqrt{x}}$ Here is what I get when I evaluate it Mathematica: When I calculate it by hand and in other ...
2
votes
3answers
115 views

What is the probability of the digit $k$ in the number $x^n$

Well, the title of the question says it all: how to write a code that finds the probability of the digit $k$ in the number $x^n$? For example, when $x=2$, $n=100$, and $k=7$ we are trying to find how ...
0
votes
1answer
75 views

Computmg the powers of a complex number? [closed]

this is the complex number im dealing with zb=(1/7)* (Cos[Pi/3]+I Sin[Pi/3]) I need to represent for the first 10 powers in the plane. I also need to label the ...
6
votes
3answers
322 views

Force Mathematica to display `Series` in factorial notation

The Series expansion for Sin[Pi * x] is Series[Sin[Pi * x], {x, 0, 10}] Pi * x - (Pi^3 * x^...
1
vote
2answers
61 views

Filtering solutions in PowerRepresentations

I have the following code: PowersRepresentations[10400, 7, 2] This produces Length[PowersRepresentations[10400, 7, 2]]=433789 ...
0
votes
0answers
43 views

How to control the visible area (up and down the line) in NumberLinePlot?

How can you control the up and down line visible part of the graph? The target if view arrosw and text below the line (purple arrow) and if it´s posible make great the upper area ...
0
votes
0answers
41 views

Arrange the output by 3-adic valuation

I have a number that has the form $x=\sum_{k=1}^n c_k3^{q_k}$, where $q_k\in\mathbb{Q}$ and $0\neq c_k$ is in $\mathbb{Z}$ or $i\mathbb{Z}$. We may define the $3$-adic valuation of $c_k3^{q_k}$ as $...
0
votes
0answers
32 views

Why it is impossible to have a complex number with Integer number as real part and approximate number as imaginary part? [duplicate]

1/3 + 3. I (*output 0.333333+3.I*) 2 + 3. I (*output 2.+3.I*) According to the above code, it seems impossible to have a complex number with Integer or exact ...
1
vote
2answers
102 views

Efficient computation of list mapping

I'm wondering about possible techniques to solve the following problem efficiently in Mathematica. Suppose you are given a list of integers that represent digits of a number with base 40. This list ...
0
votes
0answers
56 views

Handling underflows

I am trying to implement an algorithm described for example in this paper, Section III, or referenced here, from where numerical parameters have been taken. I added the snippet I use to compute the ...
1
vote
1answer
43 views

How does the Bias parameter adjusts Chebyshev nodes in RationalInterpolation of the Function Approximation Package?

How does the Bias parameter adjusts Chebyshev nodes in RationalInterpolation of the Function Approximation Package? What is the mathematical mapping/formula applied in the Bias adjustment from -1 1 ...
1
vote
3answers
119 views

How to get string from the result of BaseForm function

I want to get the string "b0.3ae" In:=BaseForm[176.23, 16] Out:=Subscript[b0.3ae, 16] And then I want to get 176.23 by ...
6
votes
4answers
300 views

How to format natural numbers so that they are 2 digits long?

I want to format all numbers from 1 to 50 so that they are all 2 digits long. desiredOutput={01,02,...,49,50} Digging through the documentation the ...
3
votes
5answers
806 views

Convert decimal value to hexadecimal

How can I convert for example 62343 to a hexadecimal value 45 to a hexadecimal value ? I see I can use: IntegerDigits[62343, 16] = {15, 3, 8, 7} ...