Skip to main content

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
0 answers
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 ...
Xorker's user avatar
  • 23
3 votes
2 answers
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, ...
wonderich's user avatar
  • 923
4 votes
6 answers
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$; <...
asad's user avatar
  • 848
0 votes
0 answers
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: ...
John Taylor's user avatar
  • 5,827
4 votes
0 answers
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: ...
Danel's user avatar
  • 173
0 votes
0 answers
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 ...
1729taxi's user avatar
  • 777
2 votes
2 answers
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 ...
yarchik's user avatar
  • 18.7k
0 votes
3 answers
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, ...
Teg Louis's user avatar
7 votes
3 answers
439 views

Since when does Mathematica have an 'Inf' symbol?

When I do: ...
berniethejet's user avatar
  • 1,417
9 votes
3 answers
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 ...
Валерий Заподовников's user avatar
1 vote
0 answers
47 views

Printout precision [closed]

For debugging, I print out the SessionTime. In the Notebook it looks like: ...
Aharon Naiman's user avatar
1 vote
2 answers
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 ...
SaMaSo's user avatar
  • 231
2 votes
0 answers
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 ...
John Taylor's user avatar
  • 5,827
2 votes
1 answer
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 ...
imida k's user avatar
  • 4,295
1 vote
1 answer
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 ...
user967210's user avatar
1 vote
1 answer
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 ...
imida k's user avatar
  • 4,295
2 votes
3 answers
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 ...
thils's user avatar
  • 3,268
1 vote
2 answers
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 ...
Skj's user avatar
  • 19
-1 votes
2 answers
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 ...
Pedro García's user avatar
2 votes
2 answers
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 ...
Littlewood's user avatar
9 votes
1 answer
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 ...
sonarventu's user avatar
1 vote
1 answer
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 ...
sam wolfe's user avatar
  • 4,863
1 vote
0 answers
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 ...
user45937's user avatar
  • 1,291
1 vote
3 answers
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 ...
stevenvh's user avatar
  • 6,958
5 votes
1 answer
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 ...
jodesarro's user avatar
0 votes
0 answers
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 ...
Y. zeng's user avatar
  • 567
0 votes
1 answer
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 ...
Jan Eerland's user avatar
  • 2,001
2 votes
2 answers
118 views

Finding IntegerPartitions[252] with no zero and no duplicates

Well, I am trying to execute the following code: ...
Jan Eerland's user avatar
  • 2,001
0 votes
0 answers
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?...
Jan Eerland's user avatar
  • 2,001
7 votes
5 answers
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 ...
Jan Eerland's user avatar
  • 2,001
6 votes
2 answers
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 ...
Wolf's user avatar
  • 145
5 votes
8 answers
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$$...
Jan Eerland's user avatar
  • 2,001
3 votes
1 answer
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 ...
granular_bastard's user avatar
1 vote
0 answers
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 ...
Jan Eerland's user avatar
  • 2,001
1 vote
1 answer
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: ...
Jan Eerland's user avatar
  • 2,001
1 vote
1 answer
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: <...
Jan Eerland's user avatar
  • 2,001
3 votes
1 answer
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 ...
Jan Eerland's user avatar
  • 2,001
3 votes
3 answers
282 views

Solving for a unique set of solutions

I have the following code: ...
Jan Eerland's user avatar
  • 2,001
1 vote
2 answers
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 ...
Granger Obliviate's user avatar
1 vote
0 answers
112 views

How to Shape Text?

Imagine I have a certain number 23819657294172004194219023914217958273128471531429470113 If I convert it to a string with ...
sam wolfe's user avatar
  • 4,863
1 vote
1 answer
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, ...
Juno's user avatar
  • 13
1 vote
1 answer
88 views

Extending NumberForm

I'd like to define a function, call it NumberF, that takes a real number n and two naturals l...
sam wolfe's user avatar
  • 4,863
0 votes
1 answer
80 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,...
juan zaragoza's user avatar
1 vote
0 answers
70 views

How does this FromDigit module work?

I am entering the following input: ...
titanium's user avatar
  • 181
0 votes
1 answer
159 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 ...
John Doe's user avatar
  • 229
1 vote
0 answers
46 views

Why does this reduce evaluate with exact numbers but not numbers specified to 20/50/200 decimals of precision?

Consider the following lines of code: ...
user106860's user avatar
2 votes
0 answers
97 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 ...
Sean's user avatar
  • 645
8 votes
0 answers
242 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 ...
Julian Moore's user avatar
  • 2,560
1 vote
1 answer
85 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 ...
John Taylor's user avatar
  • 5,827
1 vote
2 answers
132 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 ...
Jan Eerland's user avatar
  • 2,001

1
2 3 4 5