# Questions tagged [number-representation]

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

212 questions
Filter by
Sorted by
Tagged with
29 views

### Non-numerical values in double numerical integration [closed]

I am integrating twice numerically, and in my case I cannot use the inbuilt double numerical integration. I am getting an error message about non-numerical values and I broke it down to the minimal ...
• 23
177 views

### Select a subset in the bit-strings with even 1s overlapped - thank you

Model 1 Consider the permutation list of 4-bit-strings: list = Permutations[{0, 0, 1, 1}, {4}] which outputs: {{0, 0, 1, 1}, {0, 1, 0, 1}, {0, 1, 1, 0}, {1, 0, 0, ...
• 923
443 views

### Convert integer to words of specific length

Assume we give the value from 1 to 26 to alphabets a,b,...,z. Now given an integer ($n$) i like to generate words of specific length ($l$) that sum of them equals $n$. For instance, if $n=10$, $l=3$; <...
• 848
21 views

### How to get back from CForm to ScientificForm? [duplicate]

Consider a number number = 2.*10^20 It is in the representation of ScientificForm. I convert it to C-form: ...
• 5,827
49 views

### Why does an integer index inside a symbol become real when entering a ChebyshevT function with floating point arithmetic?

When I enter an indexed symbol into a ChebyshevT function with integer arithmetic like this: ChebyshevT[1, 3 * a[4]] I get the expected result: ...
• 173
55 views

### Combining numbers with fractional powers together

I get lots of numerical answers that have integers raised to fractional powers multiplying each other. A simple example: 2^(1/3) 3^(2/3) which is of course 18^(1/3). How do I get Mathematica to do ...
• 777
112 views

### Period of repeating decimal

I came across of a 6-grader school problem to perform the following division 357.56/19. Pupils in the school understand that both numbers are numerically exact. I would like to introduce Mathematica ...
• 18.7k
94 views

### How to separate surds or integers from mixed quadratic surds?

If I have a number of the form: $$a + \sqrt{b}$$ How can I get $$a \text{ or } \sqrt{b}$$ by itself? For example, ...
439 views

When I do: ...
• 1,417
992 views

### Trace shows Linux has worse error than Windows in 1/(-1.)^1.2

So I questioned why there are differences between Wolfram Cloud and Windows 11 Evaluate $\int_{0}^{\pi/2} \cos^a (x)\sin(ax) dx$ using Mathematica ...
1 vote
47 views

### Printout precision [closed]

For debugging, I print out the SessionTime. In the Notebook it looks like: ...
• 1,215
1 vote
114 views

### How to make the output of ScientificForm computable

I am trying to extract the mantissas of a list of numbers using the ScientificForm and then do some operation on them. However, it seems that the output does not ...
• 231
102 views

### On numbers with N digits after comma in Mathematica

Consider a table tabb={{1.233546576,2.454546565},{22334.46687875465,6787233.3565665655}} I want to convert it into a table where all the numbers are only with 4 ...
• 5,827
85 views

### Defining function for decimal value k[0.5+0.5]

k[1 + 1] = 2; k[1 + 0.5] = 1.5; k[0.5 + 0.5] = 1; {k[2], k[1.5], k[1]} // TableForm 2 1.5 k[1] Can you explain this phenomenon? I think the output should be ...
• 4,295
1 vote
87 views

### Select primes from their Zeckendorf representation

I'm working with the Zeckendorf representation of prime numbers. I'm using ResourceFunction["ZeckendorfRepresentation"][Prime[n]] and I would like to select from all the results, the ones ...
• 245
1 vote
65 views

### Representing a number in r0 + r1 E + r2 E^2 form

Let E be the base of natural logarithm 2.71... A Sequence S[n] is believed to converge to a ...
• 4,295
322 views

### How to determine the unique combination of digits satisfying a given relation?

Is there a method to determine the unique combination of numbers a, b, c and d which satisfy the relation below, and which yields the output with the numbers in the given order. Example for 2023 is ...
• 3,268
1 vote
124 views

### Trying to apply numerical method with Do

I am trying the following scheme to learn to implement an iteration using Do loop. I tried to implement the same method using for loop but with same errors. I, therefore, turned to the Do loop to ...
• 19
111 views

### Calculate the value of a number as if it were represented in binary

I want to design a function that receives a number in binary, $110.11$ for example, and transform it to decimal. I would like to transform it into a list: {1,1,0,1,1}. However I have a lot of problems ...
• 107
186 views

### Writing the number '80668227' as a sums of 4 & 5 cubes

I need to write the number '80668227' as a sum of 4 & 5 cubes. I tried this code PowersRepresentations[80668227, 4, 3] in Mathematica but the above code is ...
• 145
318 views

### IntegerPart - is this a known bug?

I'm working in Mathematica 13.0 and I type a=0.00001; IntegerPart[a/a] and well, the output is 0. Try with almost any other value of ...
• 465
1 vote
108 views

### Extracting powers of a sum

Given a sum in the form Sum[n^k, {k, kl}] for some natural n and natural list kl, is it ...
• 4,863
1 vote
77 views

### Extracting digits of a real number with RealDigits produces unexpected result

I have a list of real numbers, each of which has two decimal places. I'm trying to extract the second digit after the decimal point. The function I'm using is ...
• 1,291
1 vote
160 views

### How can I get these decimals formatted properly?

It's nothing serious, but I was just wondering. I have a large number of floating point numbers which I write to a file. Mathematica writes each number with 17 decimal positions, which is way more ...
• 6,958
97 views

### BarLegend with comma as NumberPoint

I'm having trouble in plotting a Barlegend with comma as decimal separator in Wolfram Mathematica 13.0. I already tried to change the environment variables or to use ...
87 views

### When there is decimal number in N[], how can ensure digits more than machine precision?

We know that N[3/7,100] will keep 100 digits after decimal point. But N[3.1/7,100] will Keep only machine precision fewer ...
• 567
64 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,001
118 views

### Finding IntegerPartitions[252] with no zero and no duplicates

Well, I am trying to execute the following code: ...
• 2,001
52 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?...
• 2,001
352 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 ...
• 2,001
2k 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 ...
• 145
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,001
124 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
118 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 ...
• 2,001
1 vote
92 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: ...
• 2,001
1 vote
137 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: <...
• 2,001
93 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 ...
• 2,001
282 views

### Solving for a unique set of solutions

I have the following code: ...
• 2,001
1 vote
127 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 ...
1 vote
112 views

### How to Shape Text?

Imagine I have a certain number 23819657294172004194219023914217958273128471531429470113 If I convert it to a string with ...
• 4,863
1 vote
452 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, ...
• 13
1 vote
88 views

### Extending NumberForm

I'd like to define a function, call it NumberF, that takes a real number n and two naturals l...
• 4,863