Questions tagged [number-representation]

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

Filter by
Sorted by
Tagged with
9 votes
1 answer
283 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 ...
user avatar
1 vote
1 answer
66 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 ...
user avatar
  • 4,368
1 vote
0 answers
33 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 ...
user avatar
  • 1,241
1 vote
3 answers
126 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 ...
user avatar
  • 6,658
5 votes
1 answer
68 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 ...
user avatar
0 votes
0 answers
63 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 ...
user avatar
  • 173
0 votes
1 answer
56 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 ...
user avatar
  • 1,765
2 votes
2 answers
109 views

Finding IntegerPartitions[252] with no zero and no duplicates

Well, I am trying to execute the following code: ...
user avatar
  • 1,765
0 votes
0 answers
47 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?...
user avatar
  • 1,765
4 votes
3 answers
313 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 ...
user avatar
  • 1,765
6 votes
2 answers
675 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 ...
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$$...
user avatar
  • 1,765
2 votes
1 answer
88 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 ...
user avatar
1 vote
0 answers
67 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 ...
user avatar
  • 1,765
0 votes
0 answers
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: $$...
user avatar
  • 1,765
1 vote
1 answer
74 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: ...
user avatar
  • 1,765
1 vote
1 answer
99 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: <...
user avatar
  • 1,765
0 votes
0 answers
44 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: ...
user avatar
  • 1,765
3 votes
1 answer
84 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 ...
user avatar
  • 1,765
3 votes
3 answers
246 views

Solving for a unique set of solutions

I have the following code: ...
user avatar
  • 1,765
1 vote
2 answers
67 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 ...
user avatar
0 votes
0 answers
74 views

How to Shape Text?

Imagine I have a certain number 23819657294172004194219023914217958273128471531429470113 If I convert it to a string with ...
user avatar
  • 4,368
1 vote
1 answer
108 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, ...
user avatar
  • 13
1 vote
1 answer
76 views

Extending NumberForm

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

How does this FromDigit module work?

I am entering the following input: ...
user avatar
  • 181
0 votes
1 answer
84 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 ...
user avatar
  • 283
1 vote
0 answers
40 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: ...
user avatar
2 votes
0 answers
81 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 ...
user avatar
  • 565
8 votes
0 answers
211 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 ...
user avatar
  • 2,410
1 vote
1 answer
61 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 ...
user avatar
  • 4,070
1 vote
2 answers
105 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 ...
user avatar
  • 1,765
0 votes
0 answers
52 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 ...
user avatar
0 votes
0 answers
41 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 ...
user avatar
2 votes
0 answers
46 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 ...
user avatar
  • 2,911
15 votes
2 answers
768 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 ...
user avatar
0 votes
2 answers
57 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 ...
user avatar
0 votes
0 answers
66 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 ...
user avatar
  • 883
2 votes
3 answers
178 views

How to make the Ticks larger? [closed]

I can´t find the option for larger ticks ...
user avatar
  • 3,101
2 votes
1 answer
100 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....
user avatar
0 votes
1 answer
66 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 ...
user avatar
  • 101
1 vote
1 answer
44 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: ...
user avatar
  • 818
2 votes
2 answers
349 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 ...
user avatar
  • 480
2 votes
3 answers
122 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 ...
user avatar
  • 1,765
0 votes
1 answer
76 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 ...
user avatar
  • 363
6 votes
3 answers
337 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^...
user avatar
1 vote
2 answers
65 views

Filtering solutions in PowerRepresentations

I have the following code: PowersRepresentations[10400, 7, 2] This produces Length[PowersRepresentations[10400, 7, 2]]=433789 ...
user avatar
  • 1,765
0 votes
0 answers
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 ...
user avatar
  • 3,101
0 votes
0 answers
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 $...
user avatar
0 votes
0 answers
33 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 ...
user avatar
  • 177