Hello Codeforces.
Recently I was solving (UVA-10490) [perfect numbers] that I found tackling the problem knowing an interesting mathematical fact would make it very very simple unlike if you don't know this fact. so I thought it would be useful to gather some interesting mathematical numbers and it would be very kind of anyone to share an mathematical formula, facts, numbers that can help in tackling such problems.
1) Narcissistic Numbers
Narcissistic numbers, also known as Armstrong numbers or “pluperfect digital invariants,” are numbers that—listen closely—are equal to the sum of each of its digits when those digits are raised to the power of the AMOUNT of digits in the number.Ok. What? Let’s take an example of the four existing narcissistic cubes:153 = 1^3 + 5^3 + 3^3 370 = 3^3 + 7^3 + 0^3 371 = 3^3 + 7^3 + 1^3 407 = 4^3 + 0^3 + 7^3In these cases, each digit is cubed because there are three digits in the number. Then, those cubed numbers are added together to produce a sum equal to the original number. There are no 12 or 13-digit ones; the two 39-digit ones are:115132219018763992565095597973971522400 and 115132219018763992565095597973971522401.
2) Happy Numbers
Some numbers are weird; others are happy. If you’d like to find out if a given number is happy, you’ll need to perform the following set of operations. Let’s take the number 44:First, square each digit, then add them together:4^2 + 4^2 = 16 + 16 = 32Then, we’ll do it again with our new number:3^2 + 2^2 = 9 + 4 = 13And again:1^2 + 3^2 = 1 + 9 = 10And finally:1^2 + 0^2 = 1 + 0 = 1Voila! It’s a happy number. Anytime you take a number, perform this “procedure,” and eventually arrive at the number 1, you have yourself a happy number. If your number never reaches 1, then sadly, it’s unhappy. Interestingly, happy number are extremely common; there are 11 of them between 1 and 50, for example.As a final note, the greatest happy number with no recurring digits is 986,543,210. That is a happy number indeed.
3) Perfect Numbers
perfect numbers. A perfect number is one that is exactly equal to the sum of its proper divisors (again, excluding itself). The first perfect number is 6, as its divisors (1, 2, 3) all up to 6. Six is followed by 28, 496, and 8,128. Early Greek mathematicians knew only of these first 4 perfect numbers; Nichomatus discovered 8,128 by the year A.D. 100. Three more were discovered, the first circa 1456 (33,550,336) by an unknown mathematician, and in 1588 (8,589,869,056 and 137,438,691,328) by Italian mathematician Pietro Cataldi in 1588.All known perfect numbers are even; it is not yet known whether an odd prime exists or is even possible. English mathematician James Joseph Sylvester wrote “…a prolonged meditation on the subject has satisfied me that the existence of any one such [odd perfect number]—its escape, so to say, from the complex web of conditions which hem it in on all sides—would be little short of a miracle.”
4) Untouchable Numbers
For a number to be untouchable, it must not be equal to the sum of the proper divisors of ANY number. A few untouchables are 2, 5, 52, and 88; in fact, 5 is thought to be the only odd untouchable number in existence (though it hasn’t been formally proven). There are an infinite number of untouchable numbers, meaning there is no such thing as the largest one.
5) Smith Numbers
A Smith number is a composite number for which, in a given base (in base 10 by default), the sum of its digits is equal to the sum of the digits in its prime factorization.For example, 378 = 2 × 3 × 3 × 3 × 7 is a Smith number since 3 + 7 + 8 = 2 + 3 + 3 + 3 + 7. In this definition the factors are treated as digits: for example, 22 factors to 2 × 11 and yields three digits: 2, 1, 1. Therefore 22 is a Smith number because 2 + 2 = 2 + 1 + 1.
The first few Smith numbers are:
4, 22, 27, 58, 85, 94, 121, 166, 202, 265, 274, 319, 346, 355, 378, 382, 391, 438, 454, 483, 517,526, 535, 562, 576, 588, 627, 634, 636, 645, 648, 654, 663, 666, 690, 706, 728, 729, 762, 778, 825, 852, 861, 895, 913, 915, 922, 958, 985
6)Carmichael Numbers
In number theory, a Carmichael number is a composite number n which satisfies the modular arithmetic congruence relation: b^(n-1) = 1 (mod n).
the first few of them :561, 1105, 1729, 2465, 2821, 6601, 8911, 10585, 15841, 29341, 41041, 46657, 52633, 62745, 63973, 75361, 101101, 115921, 126217, 162401, 172081, 188461, 252601, 278545, 294409, 314821, 334153, 340561, 399001, 410041, 449065, 488881, 512461.
resources :
http://listverse.com/2013/05/15/10-fun-examples-of-recreational-number-theory/
https://en.wikipedia.org/wiki/Smith_number
https://en.wikipedia.org/wiki/Carmichael_number
note : the contributions will be added to the blog time by time.
Thanks . :)