You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 KiB

Number

WIP

{ Sowwy I'm not a mathematician, please excuse if I'm wrong, lemme know if you spot something, thank u <3 ~drummyfish }

Numbers are one of the most elementary mathematical objects, building stones serving most often as quantitative values (that is: telling count, size, length, order etc.), in higher math also used in much more abstract ways which have only distant relationship to traditional counting. Examples of numbers are minus one half, zero, pi or i. Numbers constitute the basis and core of mathematics and as such they sit almost at the lowest level of it, i.e. most other things such as algebra, functions and equations are built on top of numbers or require numbers to even be examined. In modern mathematics numbers themselves aren't on the absolute bottom of the foundations though, they are themselves built on top of sets, as set theory is most commonly used as a basis of whole mathematics, however for many purposes this is just a formalism that's of practical interest only to some mathematicians -- on the other hand numbers just cannot be avoided anywhere, by a mathematician or just a common folk. The word number may be the first that comes to our mind when we say mathematics. The area of number theory is particularly focused on examining numbers (though it's examining almost exclusively integer numbers because these seem to have the deepest pattern related e.g. to divisibility).

Let's not confuse numbers with digits or figures (numerals) -- a number is a purely abstract entity while digits serve as symbols for numbers so that we can write them down. One number may be written in many ways, using one of many numeral systems (Roman numerals, dots, Arabic numerals of different bases etc.), for example 4 stands for a number than can also be written as IV, four, 8/2, 16:4, 2^2, 4.00 or 0b100. There are also numbers which cannot exactly be captured within our traditional numeral systems, for some of them we have special symbols -- most famous example is of course pi whose digits we cannot ever completely write down -- and there are even numbers for which we have no symbols at all, ones that are yet not well researched and are only described by equations to which they are the solution.

Basically anything can be encoded as a number which makes numbers a universal abstract "medium" -- we can exploit this in both mathematics and programming. Ways of encoding information in numbers may vary, for a mathematician it is natural to see any number as a multiset of its prime factors (e.g. 12 = 2 * 2 * 3, the three numbers are inherently embedded within number 12) that may carry a message, a programmer will probably rather encode the message in binary and then interpret the 1s and 0s as a number in direct representation, i.e. he will embed the information in the digits. You can probably come up with many more ways.

Here are some fun facts about numbers:

  • Some people associate numbers with colors, though what color each number has seems to be completely subjective. See synesthesia.
  • There is a funny hypothetical number between 6 and 7 called thrembo.
  • There exist illegal numbers, owing to the above mentioned fact that any information can be encoded as a number along with the fact that some information is illegal (see e.g. "intellectual property").
  • ...
 quaternions                . imaginary line
            projected       : (imaginary numbers)
 projected   j line     2i ~+~ ~ ~ ~ ~+ 1 + 2i
  k line       :            :         ,
     ...        :_          :         ,             complex numbers
        \___      \_ j      :         ,
            \___    +_   i ~+~ ~ ~ ~ ~+ 1 + i
                +___  \_    :         ,
               k    \___\_  :         ,
                        \_\_:         1         2         3         4
  - - -~|~-~-~-~-~|~-~-~-~-~+~-~-|-~-~|~-~-~|~-~|~-~-~-|-~|~|~-~-~-~|~- - -
       -2        -1        0:   1/2   ,    phi         e    pi           real line    
                = i^2       :  = 0.5  ,    ~=         ~=   ~= 3.14...  (real numbers)
                            :         ,   1.61...    2.71...     
                        -i ~+~ ~ ~ ~ ~+
                            :           1 - i
                            .

Number lines and some notable numbers -- the horizontal line is real line, the vertical is imaginary line that adds another dimension and reveals complex numbers. Further on we can see quaternion lines projected, hinting on the existence of yet higher dimensional numbers (which however cannot properly be displayed using mere two dimensions here).

The following is a table demonstrating just one way of how you can play around with numbers -- here we just examine whole positive numbers (like number theorists would) up to 50, count each one's total number of divisors (excluding 1 and itself, 0 here means the number is prime except for 1, if the number is highest in the series so far the number is called "highly composite"), unique divisors (excluding itself), sum of total and unique divisors (if the number equal sum of unique divisors, it is said to be a "perfect number"), average "dividing spread" (distance of each tested potential divisor's remainder after division from half of this tested potential divisor, kind of "amount of not dividing the number") in percents, maximum dividing spread and normalized range between smallest and biggest divisor expressed in percents (-1 if there are none). You can make quite interesting graphs from similar data and discover cool and interesting patterns.

number divisors divisors uniq. divisor sum uniq. div. sum avg. div. spread (%) max div. spread (%) div. range (%)
1 0 1 0 1 0 0 -1
2 0 1 0 1 0 0 -1
3 0 1 0 1 0 0 -1
4 2 2 4 3 33 100 0
5 0 1 0 1 16 50 -1
6 2 3 5 6 43 100 16
7 0 1 0 1 24 66 -1
8 4 3 10 7 44 100 25
9 2 2 6 4 36 100 0
10 2 3 7 8 40 100 30
11 0 1 0 1 34 80 -1
12 5 5 17 16 53 100 33
13 0 1 0 1 35 83 -1
14 2 3 9 10 43 100 35
15 2 3 8 9 44 100 13
16 7 4 24 15 49 100 37
17 0 1 0 1 38 87 -1
18 5 5 23 21 47 100 38
19 0 1 0 1 42 88 -1
20 5 5 23 22 51 100 40
21 2 3 10 11 45 100 19
22 2 3 13 14 43 100 40
23 0 1 0 1 42 90 -1
24 8 7 39 36 55 100 41
25 2 2 10 6 45 100 0
26 2 3 15 16 45 100 42
27 4 3 18 13 44 100 22
28 5 5 29 28 49 100 42
29 0 1 0 1 45 92 -1
30 6 7 41 42 52 100 43
31 0 1 0 1 45 93 -1
32 9 5 42 31 48 100 43
33 2 3 14 15 45 100 24
34 2 3 19 20 47 100 44
35 2 3 12 13 48 100 5
36 10 8 65 55 54 100 44
37 0 1 0 1 45 94 -1
38 2 3 21 22 45 100 44
39 2 3 16 17 46 100 25
40 8 7 53 50 51 100 45
41 0 1 0 1 47 95 -1
42 6 7 53 54 51 100 45
43 0 1 0 1 46 95 -1
44 5 5 41 40 49 100 45
45 5 5 35 33 47 100 26
46 2 3 25 26 47 100 45
47 0 1 0 1 47 95 -1
48 12 9 85 76 53 100 45
49 2 2 14 8 48 100 0
50 5 5 47 43 49 100 46

Numbers In Math

There are different types of numbers, in mathematics we classify them into sets. Though we can talk about finite sets of numbers perfectly well (e.g. modulo arithmetic, Boolean algebra etc.), we are firstly considering infinite sets (curiously some of these infinite sets can still be considered "bigger" than other infinite sets, e.g. by certain logic there is more real numbers than rational numbers, i.e. "fractions"). Some of these sets are subsets of others, some overlap and so forth. Here are some notable number sets (note that a list can potentially not capture all relationships between the sets):

  • all: Anything conceivable as a number, even by stretch. E.g. zero, minus infinity or aleph one.
    • p-adic numbers: Another way of generalizing rational numbers, they may (a bit mindblowingly) have infinitely many digits to the left (for which they are sometimes called leftist numbers).
    • H: quaternions: A sum of real number, imaginary number and two other kinds of numbers, forming a number in four dimensional space. E.g. 1 + i + j - k, 50 - 0.6k or 2i + 7j.
      • C: complex: A sum of real and imaginary number, forming a number in two dimensional plane. E.g. 3 + 2i, 0.5 - 13i or 100i.
        • algebraic: Are roots of one variable polynomials with integer coefficients. E.g. 4/3, the golden ratio or square root of two.
        • transcendental: Aren't algebraic. E.g. pi, sine of e or two to the power of square root of two.
        • imaginary: Have the same properties as real numbers but lie in another dimension, on a line perpendicular to the real number line, going through 0 -- they are connected to real numbers by the fact that imaginary unit (i) squared equals minus one. E.g. 0, 3i or -i.
        • R: real: Measure any continuous one dimensional quantity (such as height or length), the line they form is continuous. E.g. -0.3, pi or cube root of 10000.
          • negative: Smaller than zero. E.g. -1, -123 or -1000.
          • non-negative: Aren't negative. E.g. 0, 1 or 1000.
          • positive: Greater than zero. E.g. 1, 456 or 1000.
          • irrational: Aren't rational. E.g. pi, minus e or square root of 2.
          • Q: rational: "Fractions", countable set, can be written as a fraction of two integers; between any two there is always another one, so they are very densely "packed", though the line they form is not truly continuous. E.g. -2/3, 0.12345 or 2135.
            • Z: whole (integers): Are discrete, starting at zero, extending in positive and negative direction, all neighbors are spaced by the same distance of one unit. E.g. -5123, 32 or 0.
              • even: Are divisible by 2. E.g. -8, 0 or 1024.
              • odd: Aren't even. E.g. 1, -13 or 1023.
              • N0: natural (with zero): E.g. 0, 16 or 1000.
                • Fibonacci: Are part of a sequence that starts with 0 and 1 and continues with numbers each of which is the sum of previous two. E.g. 0, 3 or 89.
                • N: natural (without zero): "Caveman numbers", the kind of numbers people started to use first. E.g. 1, 10 or 945.
                  • prime: Are only divisible by 1 and themselves, excluding 1. E.g. 2, 7 or 809.
                  • composite: Aren't primes, excluding 1. For example 4, 22 or 150.

One of the most interesting and mysterious number sets are the prime numbers, in fact many number theorists dedicate their whole careers solely to them. Primes are the kind of thing that's defined very simply but give rise to a whole universe of mysteries and whys, there are patterns that seem impossible to describe, conjectures that look impossible to prove and so on. Another similar type of numbers are the perfect numbers.

Of course there are countless other number sets, especially those induced by various number sequences and functions of which there are whole encyclopedias. Another possible division is e.g. to cardinal and ordinal numbers: ordinal numbers tell the order while cardinals say the size (cardinality) of a set -- when dealing with finite sets the distinction doesn't really have to be made, within natural numbers the order of a number is equal to the size of a set of all numbers up to that number, but with infinite sets this starts to matter -- for example we couldn't tell the size of the set of natural numbers by ordinals as there is no last natural number, but we can assign the set a cardinal number (aleph zero) -- this gives rise to new kind of numbers.

Numbers are awesome, just ask any number theorist (or watch a numberphile video for that matter). Normal people see numbers just as boring soulless quantities but the opposite is true for that who studies them -- study of numbers goes extremely deep, possibly as deep as humans can go and once you get a closer look at something, you discover the art of nature. Each number has its own unique set of properties which give it a kind of "personality", different sets of numbers create species and "teams" of numbers. Numbers are intertwined in intricate ways, there are literally infinitely many patterns that are all related in weird ways -- normies think that mathematicians know basically everything about numbers, but in higher math it's the exact opposite, most things about number sequences are mysterious and mathematicians don't even have any clue about why they're so, many things are probably even unknowable. Numbers are also self referencing which leads to new and new patterns appearing without end -- for example prime numbers are interesting numbers, but you may start counting them and a number that counts numbers is itself a number, you are getting new numbers just by looking at other numbers. The world of numbers is like a whole universe you can explore just in your head, anywhere you go, it's almost like the best, most free video game of all time, embedded right in this Universe, in logic itself. Numbers are like animals, some are small, some big, some are hardly visible, trying to hide, some can't be overlooked -- they inhabit various areas and interact with each other, just exploring this can make you quite happy. { Pokemon-like game with numbers when? ~drummyfish }

There is a famous encyclopedia of integer sequences at https://oeis.org/, made by number theorists -- it's quite minimalist, now also free licensed (used to be proprietary, they seem to enjoy license hopping). At the moment it contains more than 370000 sequences; by browsing it you can get a glimpse of how deep the study of numbers goes. These people are also funny, they give numbers entertaining names like happy numbers (adding its squared digits eventually gives 1), polite numbers, friendly numbers, cake numbers, lucky numbers or weird numbers.

All natural numbers are interesting: there is a fun proof by contradiction of this. Suppose there exists a set of uninteresting numbers which is a subset of natural numbers; then the smallest of these numbers is interesting by being the smallest uninteresting number -- we've arrived at contradiction, therefore a set of uninteresting numbers cannot exist.

TODO: what is the best number? maybe top 10? would 10 be in top 10?

Numbers In Programming/Computers

While mathematicians work mostly with infinite number sets, programmers have to limit themselves to finite sets of numbers because computers have limited memory and can only store limited number of numeric values. Mathematicians are as precise with numbers as possible as they're interested in structures and patterns that numbers form, programmers just want to use numbers to solve problems, so they mostly use approximations -- for example programmers typically approximate real numbers with floating point numbers that are just a subset of rational numbers. This isn't really a problem though, computers can comfortably work with numbers large and precise enough for solving any practical problem -- a slight annoyance is that one has to be careful about such things as underflows and overflows (i.e. a value wrapping around from lowest to highest value and vice versa), limited precision resulting in error accumulation, unlinearization of linear systems and so on. Programmers also don't care about strictly respecting some properties that certain number sets must mathematically have, for example integers along with addition are mathematically a group, however signed integers in two's complement aren't a group because the lowest value doesn't have an inverse element (e.g. on 8 bits the lowest value is -128 and highest 127, the lowest value is missing its partner). Programmers also allow "special" values to be parts of their number sets, especially e.g. with the common IEEE floating point types we see values like plus/minus infinity, negative zero or NaN ("not a number") which also break some mathematical properties but this really doesn't play much of a role in practical problems. Numbers in computers are represented in binary and programmers themselves often prefer to write numbers in binary, hexadecimal or octal representation -- they also often meet powers of two rather than powers of ten (for example the data type limits are typically limited by some power of two). Famously programmers start counting from 0 (they go as far as using the term "zeroth") while mathematicians rather tend to start at 1. Just as mathematicians have different sets of numbers, programmers have an analogy in numeric data types -- a data type defines a set of values and operations that can be performed with them. The following are some of the common data types and representations of numbers in computers:

  • numeric: Anything considered a number. In very high level languages there may be just one generic "number" type that can store any kind of number, automatically choosing best representation for it etc.
    • unsigned: Don't allow negative values -- this is sufficient in many cases, simpler to implement and can offer higher range in the positive direction.
    • signed: Allow also negative values which brings up the issue of what representation to use -- nowadays the most common is two's complement.
    • fixed size: Most common, each number takes some fixed size in memory, expressed in bits or bytes -- this of course determines the maximum number of values and so for example the minimum and maximum storable number.
      • 8bit: Can store 256 value (e.g. integers from 0 to 255 or -128 to 127).
      • 16bit: Can store 65536 values.
      • 32bit: Can store 4294967296 values.
    • arbitrary size: Can store arbitrarily high/low and/or precise value, take variable amount of memory depending on how much is needed, used only in very specialized cases, may be considerably slower.
    • integer: Integer values, most common, usually using direct or two's complement representation.
    • fractional: Have higher precision than integers, allow storing fractions, are often used to approximate real numbers.
      • fixed point: Are represented by a number with radix point in fixed place, have uniform precision.
      • floating point: Have movable radix point which is more complicated but allows for representing both very high and very small values due to non-uniform precision.
    • complex: Analogous to mathematical complex numbers.
    • quaternion: Analogous to mathematical quaternions.
    • symbolic: Used in some specialized mathematical software to perform symbolic computation, i.e. computation done in a human-like way, by manipulating symbols without using concrete values that would have to resort to approximation.

Notable Numbers

Here is a table of some notable numbers, mostly important in math and programming but also some famous ones from physics and popular culture (note: the order is rougly from lower numbers to higher ones, however not all of these numbers can be compared easily or at all, so the ordering isn't strictly correct).

number value equal to notes
minus infinity not always considered a number, smallest possible value
minus/negative one -1 i^2, j^2, k^2
"negative zero" "-0" zero non-mathematical, sometimes used in programming
zero 0 negative zero, e^(i * pi) + 1 "nothing"
4.940656... * 10^-324 smallest number storable in IEEE-754 64 binary float
1.401298... * 10^-45 smallest number storable in IEEE-754 32 binary float
1.616255... * 10^-35 Planck length in meters, smallest "length" in Universe
one eight 0.125 2^-3
one fourth 0.25 2^-2
one half 0.5 2^-1
one 1 2^0, 0!, 0.999... NOT a prime
square root of two 1.414213... 2^(1/2) irrational, diagonal of unit square, important in geom.
phi (golden ratio) 1.618033... (1 + sqrt(5)) / 2 irrational, visually pleasant ratio, divine proportion
two 2 2^1, 0b000010 prime
e (Euler's number) 2.718281... base of natural logarithm
three 3 2^2 - 1 prime, max. unsigned number with 2 bits
pi 3.141592... circle circumference to its diameter, irrational
four 4 2^2, 0b000100 first composite number
five 5 (twin) prime, number of platonic solids
six 6 3!, 1 * 2 * 3, 1 + 2 + 3 highly composite number, perfect number
tau 6.283185... 2 * pi radians in full circle, defined mostly for convenience
thrembo ??? the hidden number
seven 7 2^3 - 1 (twin) prime, days in week, max. unsigned n. with 3 bits
eight 8 2^3, 0b001000
nine 9
ten 10 10^1, 1 + 2 + 3 + 4 your IQ? :D
twelve, dozen 12 2 * 2 * 3 highly composite number
fifteen 15 2^4 - 1, 0b1111, 0x0f, 1 + 2 + 3 + 4 + 5 maximum unsigned number storable with 4 bits
sixteen 16 2^4, 2^2^2, 0b010000
twenty four 24 2 * 2 * 2 * 3, 4! highly composite number
thirty one 31 2^5 - 1 maximum unsigned number storable with 5 bits
thirty two 32 2^5, 0b100000
thirty six 36 2 * 2 * 3 * 3 highly composite number
fourty two 42 cringe number, answer to some stuff
fourty eight 48 2^5 + 2^4, 2 * 2 * 2 * 2 * 3 highly composite number
sixty three 63 2^6 - 1 maximum unsigned number storable with 6 bits
sixty four 64 2^6
sixty nine 69 sexual position
ninety six 96 2^5 + 2^6
one hundred 100 10^2
one hundred twenty one 121 11^2
one hundred twenty seven 127 2^7 - 1 maximum value of signed byte
one hundred twenty eight 128 2^7
one hundred fourty four 144 12^2
one hundred sixty eight 168 24 * 7 hours in week
two hundred fifty five 255 2^8 - 1, 0b11111111, 0xff maximum value of unsigned byte
two hundred fifty six 256 2^8, 16^2, ((2^2)^2)^2 number of values that can be stored in one byte
three hundred sixty 360 2 * 2 * 2 * 3 * 3 * 5 highly composite number, degrees in full circle
four hundred twenty 420 some stoner shit (they like to smoke it at 4:20)
five hundred twelve 512 2^9
six hundred and sixty six 666 number of the beast
one thousand 1000 10^3
one thousand twenty found 1024 2^10
two thousand fourty eight 2048 2^11
four thousand ninety six 4096 2^12
ten thousand 10000 10^4, 100^2
... (enough lol) 65535 2^16 - 1 maximum unsigned number storable with 16 bits
65536 2^16, 256^2, 2^(2^(2^2)) number of values storable with 16 bits
80085 looks like BOOBS
hundred thousand 100000 10^5
one million 1000000 10^6
one billion 1000000000 10^9
3735928559 0xdeadbeef one of famous hexadeciaml constants, spells out DEADBEEF
4294967295 2^32 - 1, 0xffffffff maximum unsigned number storable with 32 bits
4294967296 2^32 number of values storable with 32 bits
one trillion 1000000000000 10^12
18446744073709551615 2^64 - 1 maximum unsigned number storable with 64 bits
18446744073709551616 2^64 number of values storable with 64 bits
3.402823... * 10^38 largest number storable in IEEE-754 32 binary float
googol 10^100 often used big number
4.65... * 10^185 approx. number of Planck volumes in observable universe
1.797693... * 10^308 largest number storable in IEEE-754 64 binary float
googolplex 10^(10^100) 10^googol another large number, number of genders in 21st century
Graham's number g64 extremely, unimaginably large number, > googolplex
TREE(3) unknown yet even larger number, > Graham's number
infinity not always considered a number, largest possible value
aleph zero cardinality(N) infinite cardinal number, "size" of the set of nat. num.
i (imaginary unit) j * k part of complex numbers and quaternions
j k * i one of quaternion units
k i * j one of quaternion units