# Self number

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Self_number
> Markdown URL: https://mediated.wiki/source/Self_number.md
> Source: https://en.wikipedia.org/wiki/Self_number
> Source revision: 1303920819
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Short description|Type of natural number}}
In [number theory](/source/number_theory), a '''self number''' in a given [number base](/source/number_base) <math>b</math> is a [natural number](/source/natural_number) that cannot be written as the sum of any other natural number <math>n</math> and the individual digits of <math>n</math>. 20 is a self number (in base 10), because no such combination can be found (all <math>n < 15</math> give a result less than 20; all other <math>n</math> give a result greater than 20). 21 is not, because it can be written as 15 + 1 + 5 using ''n'' = 15. These numbers were first described in 1959 by the [India](/source/India)n [mathematician](/source/mathematician) [D. R. Kaprekar](/source/D._R._Kaprekar).<ref>{{OEIS|id=A003052}}</ref>

==Definition and properties==
Let <math>n</math> be a natural number. We define the <math>b</math>-'''self function''' <math>F_b : \mathbb{N} \rightarrow \mathbb{N}</math> for base <math>b > 1</math> to be the following:
:<math>F_{b}(n) = n + \sum_{i=0}^{k - 1} d_i. </math>
where <math>k = \lfloor \log_{b}{n} \rfloor + 1</math> is the number of digits in the number in base <math>b</math>, and 
:<math>d_i = \frac{n \bmod{b^{i+1}} - n \bmod b^i}{b^i}</math>
is the value of each digit of the number. A natural number <math>n</math> is a <math>b</math>-'''self number''' if the [preimage](/source/Inverse_function) of <math>n</math> for <math>F_b</math> is the [empty set](/source/empty_set).

In general, for even bases, all [odd](/source/even_and_odd_numbers) numbers below the base number are self numbers, since any number below such an odd number would have to also be a 1-digit number which when added to its digit would result in an even number. For odd bases, all odd numbers are self numbers.<ref name=CS384>Sándor & Crstici (2004) p.384</ref>

The set of self numbers in a given  base <math>b</math> is infinite and has a positive [asymptotic density](/source/asymptotic_density): when <math>b</math> is odd, this density is 1/2.<ref name=CS385>Sándor & Crstici (2004) p.385</ref>

== Self numbers in specific bases ==
For [base 2](/source/Binary_number) self numbers, see {{oeis|id=A010061}}. (written in base 10)

The first few base 10 self numbers are:
: [1](/source/1_(number)), [3](/source/3_(number)), [5](/source/5_(number)), [7](/source/7_(number)), [9](/source/9_(number)), [20](/source/20_(number)), [31](/source/31_(number)), [42](/source/42_(number)), [53](/source/53_(number)), [64](/source/64_(number)), [75](/source/75_(number)), [86](/source/86_(number)), [97](/source/97_(number)), [108](/source/108_(number)), [110](/source/110_(number)), [121](/source/121_(number)), [132](/source/132_(number)), [143](/source/143_(number)), [154](/source/154_(number)), [165](/source/165_(number)), [176](/source/176_(number)), [187](/source/187_(number)), [198](/source/198_(number)), [209](/source/209_(number)), [211](/source/211_(number)), [222](/source/222_(number)), [233](/source/233_(number)), [244](/source/244_(number)), [255](/source/255_(number)), [266](/source/266_(number)), [277](/source/277_(number)), 288, 299, 310, 312, 323, 334, 345, 356, 367, 378, 389, [400](/source/400_(number)), 411, 413, 424, 435, 446, 457, 468, 479, 490, ... {{OEIS|id=A003052}}

== Self primes ==

A '''self prime''' is a self number that is [prime](/source/prime_number). 

The first few self primes in base 10 are
:3, 5, 7, 31, 53, 97, 211, 233, 277, 367, 389, 457, 479, 547, 569, 613, 659, 727, 839, 883, 929, 1021, 1087, 1109, 1223, 1289, 1447, 1559, 1627, 1693, 1783, 1873, ... {{OEIS|id=A006378}}

==References==
{{reflist}}
* Kaprekar, D. R. ''The Mathematics of New Self-Numbers'' Devaiali  (1963): 19 - 20. 
* {{cite journal |author=R. B. Patel |title=Some Tests for ''k''-Self Numbers |journal=Math. Student |volume=56 |year=1991 |pages=206–210}}
* {{cite journal |author=B. Recaman |title=Problem E2408 |journal=Amer. Math. Monthly |volume=81 |issue=4 |year=1974 |pages=407 |doi=10.2307/2319017|jstor=2319017 }}
* {{cite book | last1=Sándor | first1=Jozsef | last2=Crstici | first2=Borislav | title=Handbook of number theory II | location=Dordrecht | publisher=Kluwer Academic | year=2004 | isbn=1-4020-2546-7 | pages=32–36 | zbl=1079.11001 }}
* {{MathWorld|urlname=SelfNumber|title=Self Number}}

{{Prime number classes}}
{{Classes of natural numbers}}

Category:Arithmetic dynamics
Category:Base-dependent integer sequences
Category:Inverse functions

---
Adapted from the Wikipedia article [Self number](https://en.wikipedia.org/wiki/Self_number) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Self_number?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
