# Tag Info

## Hot answers tagged digits

### How can I program the last digits of Fibonacci numbers?

This can be computed almost instantaneously due to one curious property of the Fibonacci numbers: Their sequence is periodic modulo any modulus $m$. These periods are known as Pisano periods $\pi(m)$. ...
• 19.2k

### Calculate $140$ digits of Conway's Constant from the Look and Say Sequence

I call this ambiguous and I think you haven't thought this through. Let us assume it would be possible by such a direct method of calculating $\lambda$. First, we need to speed up the high-level ...
• 113k

### How can I program the last digits of Fibonacci numbers?

Using an undocumented function (see this as well) to implement the matrix form of the Fibonacci recurrence (see this as well): ...

### How to write an array of repeated numbers as a single number

That can easily be done by separating each number into digits and re-assembling them as Number {3097, 3097, 3097, 3097} // IntegerDigits // Flatten // FromDigits
• 113k
Accepted

### Convert real number to IBM 32 Float (not IEEE)

Compiled solution I found this solutions. ...
• 710

### How can I program the last digits of Fibonacci numbers?

I combined MatrixPowerMod from Bressoud & Wagon's book, A Course in Computational Number Theory, with a Fold formulation from @J.M.'s, to give ...
• 15.3k

### How do I get this recurrent sequence to show?

EDITS 29.04.17 - Cycle plot extended to base 20 using a code based on Tally[]. - Extend list of cycle lengths to b = 20 28.04.17 - Results: plots added 27.04.17 - Proof of periodicity 26.04.2017 -...
• 13.1k
Accepted

### Integer to Alpha Representation

I think you can use IntegerDigits directly if you add an offset, and then use the 3rd argument of IntegerDigits to only return ...
• 131k

### How to find the number of digits in a number

Inte> IntegerLength[n] will return the number of digits in an integer. I could not find a corresponding function that worked for reals It is not very clear what "number of digits" might even mean ...
• 236k

### How Create a list of the first 10,000 digits of Pi and sum it?

Does this do what you want: Total @ RealDigits[Pi, 10, 10^4][[1,259;;7233]]
• 3,705

### Consider all numbers, from two-digit up to 10-digit, written only with digits 1, 2, 3, 5, 7. Identify those that are perfect squares

OP's method used with smaller number of digits: ...
• 399k
Accepted

### How to create a function that merges the first $n$-digits of each value in a list?

Use Mod: f[n_, list_] := Mod[list, 10^n] Then: f[1, A] f[2, A] f[3, A] {1, 2, 3, 1, 6} {...
• 131k
Accepted

### DigitCount[], but in negative bases

Background mathworld.wolfram.com contains entries for Negabinary, Negadecimal and Base, including Wolfram language code examples Base $(-2)$ Negabinary ...
• 36.9k
Accepted

### Listing numbers with non-repeating digits

The lists of digits of the numbers you are looking for are mere permutations of the digits $0,\,1,\,2\,\dotsc,9$. Permutations can provide you with these ...
Accepted

### How Create a list of the first 10,000 digits of Pi and sum it?

RealDigits[Pi, 10, 10000] // First // Take[#, {259, 7233}] & // Total
• 10.3k

### How Create a list of the first 10,000 digits of Pi and sum it?

You can use the four-argument of form of RealDigits: RealDigits[$x, b, len, n$] gives len digits starting with the coefficient of $b^n$. ...
• 399k

### About a problem with FromDigits

The documentation mentions (in a bullet point in "Details") FromDigits[{list,n},b] takes n to be an exponent [...] I think ...
• 9,020

### Integer to Alpha Representation

A memoized recursive approach seems faster: ...
• 67.5k
Accepted

### Sum of squared digits returns incorrect result

The fix: use SetDelayed instead of Set when defining ssd: ...
• 399k

### How do I force mathematica to output more digits for this particular expression?

To address the question, as was already mentioned in the comments if you want arbitrary precision use exact numbers. In this case, your expression can be written as ...
• 1,838
Accepted

### Test if the decimal digits of $n$ appear $n$ times in the decimal representation of $n!$

20000 in 21 seconds. ...
• 5,222

### Convert numerical solution to RealDigits

Use N: Solve[Gamma[x] == 2*Sqrt[Pi], x] RealDigits[x /. N@%]
• 13.8k
Accepted

...
• 13.8k

### How to write an array of repeated numbers as a single number

Update: A shorter alternative using FromDigits with base 10^commonIntegerLength: ...
• 399k

### prime number digits less than n?

1337 has four digits. You ask for primes with 3 digits less than that. Select[Range[10^(Floor[Log10[1337]]-3),10^(Floor[Log10[1337]]-2)],PrimeQ] gives you ...
• 12.2k

### DigitCount[], but in negative bases

Here is my solution which uses a loop format mimicking the solutions on Wikipedia ...
Accepted

### How to avoid this type of change of digits in computed numbers?

The Problem There are two distinct issues at work: Why is the result of the simple arithmetic operation different from what you'd expect? How can we change the display (as opposed to the value) of a ...
• 1,309

### Calculate 40 digits of the MRB constant

First of all take a look at the thread mentioned in the comments for a sequence with faster convergence. Using one of the more obvious series (also mentioned in the MathWorld article you linked), the ...
• 3,180
Here's an approach using Reduce. The first step is to construct all of the inequalities. Consider a bit vector $b(1, 0, 1, 0)$. The inequalities that can be ...