Intereting Posts

Norm homomorphism between ideal class groups
What are some classic fallacious proofs?
A sequence with infinitely many radicals: $a_{n}=\sqrt{1+\sqrt{a+\sqrt{a^2+\cdots+\sqrt{a^n}}}}$
Why isn't this a regular language?
How can I prove this is a metric?
The comultiplication on $\mathbb{C} S_3$ for a matrix basis?
Showing that the intersection of all subgroups of order $n$ is normal
Pushforward of pullback of a sheaf
Can an integral made up completely of real numbers have an imaginary answer?
Limit of a stochastic integral
Probability distribution in the coupon collector's problem
Do inequations exist with congruences?
If $f(a)=f(b)=0$, Show that $\int_a^b xf(x)f'(x)dx=-\frac 12\int^2dx$
Questions about Bochner integral
Algorithm wanted: Enumerate all subsets of a set in order of increasing sums

I was able to work out the cases for $n$ having up to $4$ digits and was wondering if someone could verify my generalization to $m$ digits. Here I am assuming that when a reversal results in there being a leading $0$ it get ignored (e.g. $76130$ gets reversed to $3167$, $998700$ to $7899$ etc.)

I believe the function can be expressed as $r(n): \mathbb{N} \rightarrow \mathbb{N}$

$$r(n) = \left \lfloor \frac{n}{10^m}\right \rfloor +\sum_{k=0}^{m-1}10^{m-k} \left( \left \lfloor\frac{n}{10^k} \right \rfloor-10 \left \lfloor \frac{\left \lfloor \frac{n}{10^k}\right \rfloor}{10}\right \rfloor \right)$$

where again, $n$ has $m$ digits.

- Primes of the form $a^2+b^2$ : a technical point.
- Find all positive integers $n$ such that $\phi(n)=6$.
- Maximal sum of positive numbers
- Proving $\gcd \left(\frac{a}{\gcd (a,b)},\frac{b}{\gcd (a,b)}\right)=1$
- $p$ divides $n^p-n$
- $\sum_{k=0}^n \binom{n}{k}^2 = \binom{2n}{n}?$

It seems like this combination of the floor function and powers of 10 is the only way to achieve this but is this true?

- Is the number of primes congruent to 1 mod 6 equal to the number of primes congruent to 5 mod 6?
- Existence of the natural density of the strictly-increasing sequence of positive integer?
- If $a^2$ divides $b^2$, then $a$ divides $b$
- Express Integer as Sum of Four Squares
- Is gcd the right adjoint of something?
- Prove that $\gcd(x, y)=\gcd(x,ax+y)$, would this be the correct reasoning?
- Direct proof that $n!$ divides $(n+1)(n+2)\cdots(2n)$
- When is $2^x+3^y$ a perfect square?
- Greatest common divisor of two relatively primes
- Without using prime factorization, find a prime factor of $\frac{(3^{41} -1)}{2}$

Your first term is always $0$, and you’re off by a factor of $10$; for example, by your formula

$$\begin{align*}

r(123)&=\left\lfloor\frac{123}{100}\right\rfloor+\sum_{k=0}^210^{3-k}\left(\left\lfloor\frac{123}{10^k}\right\rfloor-10\left\lfloor\frac1{10}\left\lfloor\frac{123}{10^k}\right\rfloor\right\rfloor\right)\\\\

&=0+1000(123-120)+100(12-10)+10(1-0)\\

&=3210

\end{align*}$$

instead of the correct $321$. However,

$$r(n)=\sum_{k=0}^{m-1}10^{m-1-k}\left(\left\lfloor\frac{n}{10^k}\right\rfloor-10\left\lfloor\frac1{10}\left\lfloor\frac{n}{10^k}\right\rfloor\right\rfloor\right)$$

does the trick.

Suppose that $n=\sum_{i=0}^{m-1}d_k10^i$, where each $d_i\in\{0,1,\dots,9\}$, and $d_{m-1}\ne 0$, so that the decimal expansion of $n$ is $d_{m-1}d_{m-2}\ldots d_1d_0$. Then

$$\left\lfloor\frac{n}{10^k}\right\rfloor=\sum_{i=k}^{m-1}d_i10^{i-k}=10\sum_{i=k+1}^{m-1}d_i10^{i-k}+d_k\;,$$

so

$$\left\lfloor\frac{n}{10^k}\right\rfloor-10\left\lfloor\frac1{10}\left\lfloor\frac{n}{10^k}\right\rfloor\right\rfloor=\left(10\sum_{i=k+1}^{m-1}d_i10^{i-k}+d_k\right)-10\sum_{i=k+1}^{m-1}d_i10^{i-k}=d_k\;,$$

and

$$r(n)=\sum_{k=0}^{m-1}10^{m-1-k}d_k=\sum_{k=0}^{m-1}d_{(m-1)-k}10^k\;,$$

whose decimal expansion is $d_0d_1\ldots d_{m-2}d_{m-1}$, as desired.

This is what I came up with:

$$\sum_{k=1}^{n}10^{k-1}\frac{xmod10^{n-k-1}-xmod10^{n-k}}{10^{n-k}}$$

Where n is the number of digits in the number x, it could be replaced with $\lfloor{log_{b}x}\rfloor+1$

I believe it works in different bases (just change 10 for the desired base), although it has only been tested in base 10! Taking the first term k = 1, with n = 3 for example gives:

$$\frac{xmod1000-xmod100}{100}$$

The $xmod1000$ term returns the original number, the $xmod100$ term returns the remainder after division by 100 which will be the two digit number after the “number of hundreds”, the result will then be the number of hundreds eg. for 345 the numerator will be 300, dividing by 100 returns 3. The next term in the series essentially does the same thing, the fraction returns the value the next power of ten along with one important difference; the $10^{k-1}$ term makes the digit be worth ten times what it was so in the 345 example the 3 will be worth 3 instead of 300 the for will remain at the same value of 40 and the 5 will be worth 500 because $10^{3-1}$ = 100 so at the third pass the value of the fraction is equal to 100 times the value of the digit at the third place. Adding all the terms together reverses the number 345 becomes 543, 1432 becomes 2341. If my explanation isn’t clear let me know!

- $X$ is Hausdorff if and only if the diagonal of $X\times X$ is closed
- Why is the shortest distance between two circles along the segment connecting their centers?
- Are there any non-obvious colimits of finite abelian groups?
- Pigeonhole Principle Question: Jessica the Combinatorics Student
- A and B disjoint, A compact, and B closed implies there is positive distance between both sets
- What properties should a matrix have if all its eigenvalues are real?
- How exactly is $i=\sqrt{-1}$ related to $\mathbb{C}$ being a closed algebraic field?
- Period of repeating decimals
- What is the value of $1^i$?
- Using induction for an easy proof for formal languages
- How many consecutive composite integers follow k!+1?
- $\gcd(a,\operatorname{lcm}(b,c))=\operatorname{lcm}(\gcd(a,b),\gcd(a,c))$
- What is the space curve with curvature and torsion obeying
- Closed form for the sequence defined by $a_0=1$ and $a_{n+1} = a_n + a_n^{-1}$
- Evaluate an infinite product in a closed form