What exactly is a number?
A basic question is, what would be the purpose of such a definition? Would it clarify anything if we came up with a definition that, say, included quaternions and not matrices or analytic functions?
Most of the usages of the term "number" are due to historical choices that have lived on. I'd be interested in seeing things that were called "numbers" initially, but are not called "numbers" now, I suppose, but any definition that applies is just a hack to justify choices at the boundaries, I think.
As mentioned, I haven't seen quaternions called "numbers." We say $1+i$ is a "complex number," but we just say $1+i+j+k$ is a "quaternion." At least in my experience.
Algebraic numbers
In "number theory," we often deal with "algebraic extensions" of the rational numbers. For example, $\mathbb Q(\sqrt{2})$ is the set of numbers of the form $a+b\sqrt 2, a,b\in\mathbb Q$. These can be seen as a subset of $\mathbb R$, but they actually exist more abstractly - for example, algebraically, we don't know whether $\sqrt{2}<0$ or $\sqrt{2}>0$ - the number exists as an algebraic object entirely - an object which, when squared, equals $2$.
The same thing happens with $\mathbb Q(\sqrt{-1})$. It would be strange to call $\sqrt{2}$ a "number" and not call $\sqrt{-1}$ a "number" in this context. Mathematicians call the two fields "algebraic number fields."
For example, $\mathbb Q(\sqrt[3]{2})$ can be seen as isomorphic to a subset of $\mathbb R$, but it is also isomorphic to a (different) subset of $\mathbb C$.
Complex Numbers
There are also ways to see, inside the 'real numbers,' that the complex numbers sort of have to exist. My favorite way: If you look at the radius of convergence of the Taylor series of $f(x)=\frac{1}{x^2-x}$ at $x=a$, you get the radius of convergence is $\min(|a|,|a-1|)$. That is, the zeros of the denominator "block" the Taylor series. If you look at the Taylor series of $g(x)=\frac{1}{1+x^2}$ at a real number $x=a$, you get that the radius of convergence is $\sqrt{1+a^2}$. There is something (a zero of $1+x^2$?) "blocking" the Taylor series of $g(x)$ that looks like it is exactly a distance $1$ from $0$ in a direction perpendicular to the real line.
Complex numbers also are necessary for breaking down real matrices into component parts. Well, not "necessary," but the representation of matrices in, say, Jordan canonical form, becomes quite a bit more complicated without complex numbers. So complex numbers, oddly, make matrices seem more regular (or, if you prefer, hide the complexity.)
Also, complex numbers are really necessary for understanding quantum theory in physics. Everything you think you intuit about the universe, in terms of "measurements" being real numbers, starts to fall apart at the quantum level. The universe is far stranger than it seems.
$p$-adic Numbers
$p$-adic numbers are probably called "numbers" just because their construction is essentially the "same" as the construction of the reals, only using a different metric on $\mathbb Q$, and because they can be used to answer questions about the natural numbers.
Ordinals, Cardinals
Ordinal and cardinal numbers represent a different type of extension of the natural numbers.
I think of "ordinals" as being like the results of a race with no ties. Every runner has a result "ordinal" and any non-empty subset of the runners has a "winner."
Cardinal numbers are like a pile of beans, and determining whether two piles of beans have the same amount in them.
Ordinals are by far the most weird, because even addition of ordinals is non-commutative.
In this case, then, ordinals and cardinals are "measurements" of something.
Non-standard real number definitions
There are also lots of variations of the real numbers that we call "numbers," basically because they are a variant of the real numbers.
Conclusion: Exclusions
The hardest part of coming up with a definition for "number" is to exclude: Why don't we call matrices, or functions, or other similar things "numbers?" Things we see as primarily functions are not seen as "numbers," but it is hard to exclude them with anything rigorous. Indeed, one way to see the complex numbers is as a sub-ring of the ring of real $2\times 2$ matrices, and one reason we need complex numbers is that they are great at representing the operation of rotation - that is why we see them come in studying real matrices.
Zero-divisors are often a sign that a thing isn't a number, but we do have $g$-adic numbers with $g$ not prime, which is a ring with zero divisors. (Usually, $g$-adic numbers are not actually used anywhere, since they are just products of rings of $p$-adic numbers...)
Does anybody refer to the elements of ring $\mathbb Z/n\mathbb Z$ as "numbers?" Not in my experience.
I also haven't seen finite field elements referred to as "numbers."
So, no, the entire history of mathematics has not ascribed a single logical meaning to the word "number," so that we can distinguish what is and isn't a number. As noted in comments, "Cayley numbers" is another name for the octonions, but there are zero occurrences in Google NGram of the singular phrase, "Cayley number." So octonions are numbers, but a single octonion is not a "number?" That's just the world we live in. Number, being the most basic idea in mathematics, gets generalized in a lot of interesting ways, not all consistent, and not the same way over time.
Recall, the ancients didn't define $0$ as a "number."
Q: How many beans do you have?
A: I don't have beans.
(I suspect this failure was due to the confusion between cardinals and ordinals - we count finite cardinals by arbitrarily sorting and then computing the ordinal of the last element, but that fails when counting an empty collection...)
There is no concrete meaning to the word number. If you don't think about it, then number has no "concrete meaning", and if you ask around people in the street what is a number, they are likely to come up with either example or unclear definitions.
Number is a mathematical notion which represents quantity. And as all quantities go, numbers have some rudimentary arithmetical structures. This means that anything which can be used to measure some sort of quantity is a number. This goes from natural numbers, to rational numbers, to real, complex, ordinal and cardinal numbers.
Each of those measures a mathematical quantity. Note that I said "mathematical", because we may be interested in measuring quantities which have no representation in the physical world. For example, how many elements are in an infinite set. That is the role of cardinal numbers, that is the quantity they measure.
So any system which has rudimentary notions of addition and/or multiplication can be called "numbers". We don't have to have a physical interpretation for the term "number". This includes the complex numbers, the quaternions, octonions and many, many other systems.
In my thinking, a number is simply an object which satisfies some set of algebraic rules. In particular, these rules are typically constructed to allow an equation a solution. Most interesting, these solutions were unavailable in the less abstract version of the number, whereas, with the extended concept of number the solutions exist. This seems to be the theme in the numbers which have been of interest in my studies. For example:
- $x+3=0$ has no solution in $\mathbb{N}$ yet $x = -3 \in \mathbb{Z}$ is the solution.
- $x^2-2=0$ has no solution in $\mathbb{Q}$ yet $x = \sqrt{2} \in \mathbb{R}$ is the solution.
- $x^2+1=0$ has no solution in $\mathbb{R}$ yet $x = i \in \mathbb{C}$ is the solution.
However, even this theme is not enough, a new type of number can also just be something which allows some new algebraic rule. For example,
- $2+j$ is a hyperbolic number. Here $j^2 = 1$ and we have some rather unusual relations such as $(1+j)(1-j) = 1+j-j-j^2 = 0$. The hyperbolic numbers are not even an integral domain, they're zero divisors.
- $1+\epsilon$ is a dual number or null number as I tend to call them. In particular $\epsilon^2=0$ so these capture something much like the idea of an infinitesimal.
This list goes on and on. Indeed, the elements of an associative algebra over $\mathbb{R}$ are classically called numbers. There is a vast literature which catalogs a myriad of such systems from around the dawn of the 20-th century. In fact, the study of various forms of hypercomplex analysis is still an active field to this day. Up to this point, the objects I mention are all finite dimensional as vector spaces over $\mathbb{R}$. In the 1970's physicists began throwing around super numbers. These numbers were infinite dimensional extensions of the null numbers I mentioned above. They gave values for which commuting and anticommuting variables could take. Such variables could be used to frame the classical theory of fields for fermions and bosons. In my view, the supernumbers of interest were those built from infinitely many Grassmann generators. Since the numbers themselves were built from infinite sums, an underlying norm is given and mathematically the problem becomes one of Banach spaces.
My point? A number is not just for counting.