Code Tag: Number Theory

How likely are we going to get “descending numbers”?

Use numbers 0, 1, 2, 3, 4, 5 to create none-repeating four-digit numbers. If we call the number with every digit smaller than the one on its left “descending number“, what is the probability for the four-digit number to be a “descending number”.

Womens World Cup

From Benni Trachtenberg, it’s time to dust off your football manager’s blazer just in time for the women’s World Cup: A soccer coach is assembling a team of 11 players to compete in the Riddler League. (For the sake of this problem, all players are invincible and will play the entirety of every game of …

10 digit probability

Let S be the set of all 10-digit numbers (which by definition may not begin with 0) in which each digit 0 through 9 appears exactly once. For example, the number 3820956714 is in S. A number n is picked from S at random. What is the probability that n is divisible by 11? If …

Night King Battle

At a pivotal moment in an epic battle between the living and the dead, the Night King, head of the army of the dead, raises all the fallen (formerly) living soldiers to join his ranks. This ability obviously presents a huge military advantage, but how big an advantage exactly? Forget the Battle of Winterfell and …

Divisibility

Let n be an integer randomly chosen in the interval [1, 120], and consider the sum Sn = sum of (k) from k=1 to k=n. Sn is Least likely to be divisible by _______?

The 4 digit number

Find a 4-digit number where the last 4 digits of its square is equal to that number. Write the 4-digit number as your answer. Example: This is just to give you a rough idea of what you need to do, this equation is not actually true. 1357 * 1357 = 97861357

Total Assassination

a/b is the simplest form of a fraction R(a,b are co prime). Value of R is less than 1 but greater than 0. If a+b=400, how many such pairs can be there?

Random Number Multiplication

Three integers, a, b, and c are chosen randomly from the following ranges: 1

Sum of Squares 1

a, b, c, d, e, f, and g are all distinct, positive integers such that a2 + b2 = c2 + d2 = e2 + f2 = g. What is the smallest possible value of g? Inspiration

Ratio between sum of fractions

A = (1/1)+(1/3)+(1/5)+…+(1/99) / (1/(1*99))+(1/(3*97))+(1/(5*95))+…+(1/(99*1)) Find A       Quick and dirty code, we’re adding the values in the numerator and denominator separately then combining them at the end of the loop It gives us a nice clean integer solution, 50

An odd conjecture

What is the smallest odd number which can not be written as 2^a+p Here, a is (an) integer and p is prime. Note : Don’t treat 1 as a prime number