This question came up recently:  John III, the third king of Johnland was very angry with John II, who killed the founder of Johnland, the beloved John I. By his new law the digit $2$ was forbidden to use. The numbers were listed as $1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, $$ 15, 16, 17, 18, 19, 30, 31, 33, \dots $ What was the $2021$st number in this new system?  I then came up with this: Sol.:  First, I studied how many numbers would be ‘skipped’ in the system within a power of 10; 100: 0 101: 1 102: 20 103: 300 104: 4000 105: 50000 The pattern is quite clear. Skipped numbers before 2021st number: 300 x 2 + 1 x 2 + 0 x 1 = 602. However, in 602 there are some skipped numbers: (300 x 2 + 1 x 2 + 0 x 1) + (20 x 6 + 0 x 2) = 602 + 120 Also in 120 there are some more: (300 x 2 + 1 x 2 + 0 x 1) + (20 x 6 + 0 x 2) + (20 x 1 + 1 x 2) = 602 + 120 + 22 And in 22: (300 x 2 + 1 x 2 + 0 x 1) + (20 x 6 + 0 x 2) + (20 x 1 + 1 x 2) + (1 x 2 + 0 x 2) = 602 + 120 + 22 + 2 There are none in two.  From there I didn't know what to do with myself and just got the answer in python, but that's cheating, so I would like to know how I can hope to solve this question with pure maths. Cheers!
123512
A man counts numbers and skips the numbers that have digits divisible by 3. The first ten numbers are 1, 2, 4, 5, 7, 8, 11, 12, 14, 15. What is the 100th number?   Quick googling for solution gives an interesting alternative method using change in base:     Its actually base 6 system, So $100$ in base 6 is $244$ in decimal.   But as $3$ is not included in the system, 4 will actually be 3, 5 will be 4, so on, Hence $100th$ number is 255   Can someone explain this please?  I tried same method on similar question, to find $100th$ number for the sequence that skips digits divisible by 2 or 5.  100 in base 4 is 1210 and reconverting it back yields 1310. Which is wrong.  Many thanks in advance,  Chris
44977
Please don't sign this as a duplicate of , they aren't. I am interested about the actual algorithm, not a proof of the existence.  Does a such mapping exists? I think, it must, because both of them have the same cardinality ($\aleph_1$).  My actual suggestion for a such mapping were simply merge the digits of the real numbers. For example, from $\pi$ and $e$ we could got  $3.1415...$ and $2.7182...$ would lead to $32.17411852...$ .  Although I am not sure it were ok. Maybe a better, clearer solution also exists?
47058
How many 10-digit numbers can be made by using the digits {5,6,7} (all of them) and with the additional constraints that no two consecutive digits must be the same and also that the first and last digits of the number must be the same?   I am trying to find a solution by using combinatorics. I start from the 1st leftmost digit, which can have any value from {5,6,7} (3 possibilities).  Then we move to the 2nd digit, which can have 2 values (since it can't be the same with the 1st) and so on, and for the last digit we only have 1 option. But this is not correct, because for the 9th digit we have the restriction that it must be different from the 8th and also different from the 10th, which, in turn, is equal to the 1st.  I don't know how to express this.  I therefore tried to find a recursive relation.  I found that the general relation is $a(n) = 2*a(n-1)$ if n odd and $2*a(n-1) + 6$ if n is even.   For n=4, we have 6 such numbers (4-digit numbers, but with the given restrictions). Then if we add one more digit to the right, we remove the rightmost (4th) digit, which had to be the same with the first, and now for the 3rd digit we have 2 options instead of 1 (we can also add the options that were rejected because they were neighboring with the 4th digit). So in total we now have $2 x 6 = 12$ options. Therefore, $a(4)=6$ and $a(5)=12$. I don't understand, however, where this $+6$ (in the recursive relation) comes from!  By the way, the correct answer is 510.  Many thanks in anticipation.
108191
I was looking at a 10x10 multiplication table, and I decided to count the unique products. There are 42 out of a possible 100 numbers represented. I had to wonder, why 42? I counted the 58 non-listed numbers -- most of them are either primes >10 or multiples of those primes. I couldn't figure out a satisfying reason like that for 75, 84, 96 and 98. I feel like the number 42 should be calculable from the natural log of 100 and 10, or something, but I can't really figure it out.  Also, I counted the frequency of all the numbers represented. They all have either 1, 2, 3, or 4 instances. The six numbers that have only 1 instance are all squares -- those of 1, 5, 7, 8, 9, and 10. This makes sense -- squares don't fall into that 4x5 = 5x4 redundancy. The 23 numbers with 2 instances are kind of the default I guess. The four with 3 are the remaining squares -- 4, 9, 16, and 36. 4 and 9 make sense to me, as they are squares within the basic range of the times table, so they are hit by themselves, their square root, and 1. I'm having trouble accounting for why 16 and 36 have three representatives. I'm also having trouble seeing the pattern (or patterns) in the numbers with four representatives.  I ultimately want to find a way to, given a times table of any size, calculate whether a given number will appear, and how many times.  Also, I'm pretty sure that for times tables 7x7 and below, more than half of the possible numbers are represented on the table, but for times tables above 7x7, less than half are represented. Why is 7 the turning point?
103132
I've noticed that the reciprocal of many prime numbers have a curious number of digits. For example. 1/7 has 6 repeating digits, 1/17 has 16 repeating digits, and 1/47 has 46. There's a rule here that makes this pattern, and I haven't quite figured it out. Does anyone have some insight on this?  There are a few other numbers that follow the pattern subversively. For example, 1/3 has two repeating digits: 33. 1/11 has ten repeating digits: 0909090909. The number 1/13 has a set of six that repeats twice, which makes a set that's 12 digits long.  For reference, here is a website that lists reciprocals of numbers 2 through 70, including non-primes.   The ones that break the rule are 1/2 and 1/5, but they seem to be a matched pair, where the 2 and 5 switch places in the equation 1/X = Y/10  What is the rule that makes this pattern? I'm very curious.
506
In the decimal system: $...-3, -2, -1, 0, 1, 2, 3...$ In the binary system: $...-11, -10, -1, 0, 1, 10, 11...$ In the unary system: $-111, -11, -1, \text{ ??? }, 1, 11, 111...$   I was only able to find a related question but none with an answer so far:
82626
Suppose,I have a number 1256. I want (1256 % 11)! That is 2 . But, here, if i try in this way,  ( (125 % 11 ) * 10 + 6 ) % 11 = 2. That is exactly the same answer 2 as above.  I am confused , how This two process gives the similar answer ??? Even if , I try this method for any number n,m  to find (n mod m) . How this works ?? Can anybody explain ?
96642
What does the number 2 mean in this picture?    Thanks.   Sorry I'm not a math expert.  I need this to make a program in C to generate a trinomial triangle for a guy who asked it on StackOverflow (it is his homework). Gotta earn that reputation. You know how it is!
81866
Since last week I have been working on a way, how to sum $1$ and $2$ to have $133$.  So for instance we can have $133$ $1s$ or $61$ $s$2 and one and so on. Looking back to the example: if we sum: $1 + 1... + 1 = 133$ there is only one way. But for the second one there will be $131$ possible ways. And I have to do this for every possible combination. I am stuck with it and I have no idea whatsoever on how to begin.  Any ideas or methods I could use guys?
42460
My friend thought of a system in which each number $n$ (I will first restrict my question to positive integers $n$) is represented by a digit string $(d_l,...,d_1)$ as follows $\forall n \in \mathbb{N}, \exists l \in \mathbb{N}: n = (d_l, d_{l-1}, ..., d_2, d_1) = \sum_{i=1}^l (d_i*(i!))$ where $\forall i \in \mathbb{N}, d_i \in \mathbb{N}: d_i \leq i$ and specifically $\forall i&gt;l, d_i = 0$ ; note that each integer $d_i$ would be represented in decimal with at least 1 digit (in general, these factorial digits can be quite long in decimal representation)- but this is not an issue at the moment [because his system uses a finite alphabet via balanced quinary for each $d_i$].  [In this post, any number shown is in decimal.]  For example, $$1729=2*6! + 2*5! + 2*4! + 1=(2,2,2,0,0,1)$$ and $$1729^3 = (10*12!+9*11!+5*10!+3*9!+6*8!) + 1729 = (10, 9, 5, 3, 6, 0,2,2,2,0,0,1)$$.  My question is: how would this digit string $(d_l,...,d_1)$ be computed most efficiently for general positive integer n? I have mostly just been trying to guess at the largest $l \in \mathbb{N}: l*(l!) \leq n, (l+1)! &gt; n$ and then (once I have found it), I just go through digit-by-digit, working my way down in values of candidate $d_i$ (mostly by squeeze theorem with the goal of finding out that $d_i + 1$ is too large first and then next testing $d_i$ and finding that it works). This process can be quite arduous. What would you recommend doing, algorithmically and efficiently? Bragging rights for Mathematica code that automates the process.  (Using Stirling's formula might be helpful, but it still requires a lot of playing around.)  What modifications would need to be made for general real numbers (including nonintegers)? After the radix point, it works similarly, but with $(i!)^{-1}$ (where, I think, $d_i&lt;i \forall i \in \mathbb{N}$ and where the first such base is $\frac{1}{2!}$).  More generally and philosophically, are there any spiritual problems with this representation? It is meant to be rather compact and alien. What are some cool properties that it exhibits?
115336
The number $128$ can be written as $2^n$ with integer $n$, and so can its every individual digit. Is this the only number with this property, apart from the one-digit numbers  $1$, $2$, $4$ and $8$?   I have checked a lot, but I don't know how to prove or disprove it.
20105
$T(n) = 2$ if $n=0$  $T(n) = 9T(n-1)-56n +63$ if $n&gt;=1$  Repeated substitution  $k=1$  $T(n) = 9T(n-1)-56n+63 $  $k =2$  $T(n) = 81T(n-2) -560n + 1134$   $k =3$  $T(n) = 729T(n-3) -5096n + 15309$  I cant find the pattern for the n term and the integer  For now i just have  T(n) = $9^k(n-k)$
116671
Today in math class, a number puzzle arose where you would have to find a 10 digit number, where each digit describes the number of other digits in the number, for example: $$\text{0 1 2 3 4 5 6 7 8 9}$$ $$\text{6 2 1 0 0 0 1 0 0 0}$$  $\textit{The top row being digit number $n$, and the bottom row being the $10$ digit number.}$    You can see that since there are six zeros in the $10$ digit number, there is a $6$ in the $0$'s column. And since there are two $1$'s, there is a $2$ in the $1$'s column and so on.  So, my question would be: Are there any more solutions to this puzzle? And if not, how could you prove this?
120624
Base $10$ uses these digits: $\{0,1,2,3,4,5,6,7,8,9\};\;$ base $2$ uses: $\{0,1\};\;$ but what would base $1$ be?    Let's say we define Base $1$ to use: $\{0\}$. Because $10_2$ is equal to $010_2$, would all numbers be equal?  The way I have thought Base 1 might be represented is tally marks, $0_{10}$ would be represented by nothing. So, $5$ in Base 1 would be represented by $00000$? Or we could define Base 1 to use: $\{$|$\}$ and $5$ would be |||||?
95245
Although I have seen many similar questions, none has been useful.   The question is quite simple: How do I reproduce the highlighted numerals in the image below?    Note that the form of the numerals addressed in questions as  is different from this one.  Thank you in advance!
28384
I'm wondering if some power of $2$ can be written in base $10$ as $2013$ followed by other digits.  Formally, does there exist $k,q,r \in \mathbb N$ such that $$2^k=2013 \cdot 10^q+r \,\,\,; \,\,\,r&lt;10^q $$  I'm not sure if it's true or not. I would go for a 'no', but I can't prove it.  Thanks for your help.
121208
What's the fastest and easiest to read implementation of calculating the sum of digits?  I.e. Given the number: 17463 = 1 + 7 + 4 + 6 + 3 = 21