0 like 0 dislike
0 like 0 dislike
Trying to make function to create the set of all the orders of a b c and d based on an input number

1 Answer

0 like 0 dislike
0 like 0 dislike
Consider a number is base 4. There are 4 single digit numbers, 16 two digit numbers (including leading zeroes), 64 three digit numbers (including leading zeroes). In general, there are 4^n n-digit numbers (including leading zeroes). So, let’s say the input is 4. Then for each number from 1 to 4^n - 1 = 4^4 - 1 = 255, convert to a number in base 4. For example, let’s try 117:

117/4 = 29, with a remainder of 1

29/4 = 7, with a remainder of 1

7/4 = 1, with a remainder of 3

1/4 = 0, with a remainder of 1

So, in base 4 the base 10 numeral 117 is written as 1311. To check, confirm that 1*64 + 3*16 + 1*4 + 1*1 = 117. Now, just convert those digits to letters, with 0=A, 1=B, 2=C, 3=D. In this case, we get 1311 = BDBB. This process will return only digits 0, 1, 2, and 3, and will return every possible combination except for all 0s, because we started our counting at 1 instead of 0. This means you’ll get every combination except for all As returned.

Related questions

0 like 0 dislike
0 like 0 dislike
1 answer
MSR_Tlse asked Jun 21
Are the S3/S4 Edexcel Further Maths units useful to become an actuary? Topics include sampling, unbiased and biased estimators, confidence intervals and significance test...
MSR_Tlse asked Jun 21
0 like 0 dislike
0 like 0 dislike
0 answers
kymdouglas asked Jun 21
Free version of Hardy, An Introduction to the Theory of Numbers
kymdouglas asked Jun 21
0 like 0 dislike
0 like 0 dislike
1 answer
MSimonTV asked Jun 21
Prereqs for An Introduction to the Theory of Numbers by GH Hardy?
MSimonTV asked Jun 21
0 like 0 dislike
0 like 0 dislike
3 answers
BlaiseJames asked Jun 21
#53. In the second part after "So, let delta = epsilon" how do they go from |-(x+5)|<E to |-(x-5)-10|<E? In the first part is there a name for the rule/property used to f...
BlaiseJames asked Jun 21
0 like 0 dislike
0 like 0 dislike
3 answers

24.8k questions

103k answers

0 comments

33.7k users

OhhAskMe is a math solving hub where high school and university students ask and answer loads of math questions, discuss the latest in math, and share their knowledge. It’s 100% free!