The Equivalence Class
There's a logical idea used in the Fregean definition of number: the equivalence class.
Say that we want to define the geometrical term "the same direction". Take also the notion of a line in Euclidean geometry. Does
ab have the same direction as cd?
We can answer the question
if and only if ab and cd are parallel.
ab and cd, therefore, must be an example of the well-known geometrical parallel lines. What has this to do with the equivalence class or, indeed, with Fregean number theory? It does so because the direction of ab can be seen in terms of a class or of classes. That is:
ab is the class of all lines which have the same direction as ab.
In other words, the class of ab (or the direction of the line of ab) has as its members all that have the same direction as ab. So, in that case, perhaps cd is a member of the class ab. It is so, as said, because it is parallel to ab. If any other relation, say yz, is parallel to cd, then by definition it must be parallel to ab as well. So both cd and yz (amongst many other lines) belongs to the class ab – they are its members; though they aren't classes themselves.
It would be better to give our ‘ab’ a better symbolic expression so as to distinguish it from ‘cd’, ‘xy’ and every other member of it.
The equivalence class, then, will "fully identify the extension of the concept: direction of ab". That is, its extension includes all examples of direction which are equivalent to ab or parallel, in this case, to ab. In terms of the concept or predicate expression "direction of ab", the class ab (or the class of ab’s) has as members the extension of that concept or predicate expression. Or both cd and yz fall under the concept [direction of ab] just as horses fall under the concept [horse], etc.
All the above is an example of all the directions instantiated by parallel lines. What of other directions or of "direction in general"? These too can be defined in terms of classes. Instead of the class direction of ab (or the class of all parallel lines), we can now have the class of classes which are equi-directional. In other words, this higher-order class has as its members the members that instantiate direction in general (or are all examples of direction). However, didn’t we say earlier that classes within classes were disallowed on pain of paradox and infinite regress? Now we have a class of classes, and these member-classes themselves must also have their own members and so on. We would have yet another case of the infinite regress or indefinite inflation of classes in Fregean number theory (or his class theory). In addition, the equi-directional class must be an infinite class for another reason. That reason is that it's surely the case that there's an infinite (or innumerable) amount of actual or possible directions in general; especially bearing in mind that one line (or direction) may start off being perfectly straight but then, for example, take a diagonal turn and so on. The permutations of a given line or direction must surely be infinite or innumerable. So this strange meta-class – the class of equidirectionality – must give rise to many infinite regresses and paradoxes, not just the one brought about by having other classes as examples of some of its members.
Let’s get back to defining the concept NUMBER.
As we've said, we can define number as classes of equinumerous classes. In the case of the number 6, this number is defined in terms of all six-membered classes (whether the class of six horses or the class of six black persons and so on). Though, again, this equinumerous relation between classes mustn't rely on numbers or counting. Instead, that is, in terms of the one-to-one correspondences between all the members of a six-membered class and a different six-membered class. And this relation of correspondence is brought about by using the logical ideas equinumerosity and the equivalence class.
What of the problem of classes within classes?
To sum up. All the above includes examples of the logicist or Fregean attempt to
"complete the definition [of number] using only logical concepts: concepts whose meaning and extension are determined by the elementary laws of thought" (388).
In other words, it's an example of the many attempts to reduce mathematics (or simply arithmetic) to logic. As we know, this project failed and it was later generally accepted that logic is in fact a branch of mathematics, not vice versa.
Let’s go into detail and define zero (or 0) in purely logical terms.
We can do so, to begin with, by considering the predicate "not identical with itself". Clearly, then, there's not a single thing in our universe (or even at any possible world) that isn't identical to itself. It follows, therefore, that nothing falls under the concept or predicate "not identical with itself". In addition, Frege also believed that every predicate has as its extension a particular class and its members. What if nothing falls under "not identical with itself"? We can now say that its extension has precisely no members. Thus we can have an extensional class for our own number zero or 0. We can even say, a la Frege, that the number 0 is the class of all no-membered classes. Thus 0 too has its own extension!
That extension-class is often called the null class. More technically, the number 0 can be defined with variables instead of the numeral ‘0’. We can say that the
"number zero can be defined as the number of things x, such that x is not identical with itself (alternatively, as the class of all classes of things which are not identical with themselves)". 
This is another way of saying that there's no x which isn't self-identical; which is itself a logical truth. In terms of classes rather than the variable x, there are no classes of classes that aren't self-identical. However, according to Frege there is a class of classes of things (or members) that aren't self-identical. The point is, all these classes are empty, for the reasons just given. Or surely we must add that the class of all classes of non-self-identical things does indeed have members; though these members must only be classes - if only a single such class. It doesn't, then, have particulars or individuals as members, only an empty class – the null class.
This is an even more stark and blatant case of a class that has other classes as members. Not only that: its own member-classes are all empty! So, as with the infinite-regress argument, an empty class that's a member of the class of all empty classes will itself have at least one member-class as its own member. And so on. However, can we really say ‘and so on’ when this ostensible infinite regress is a result of empty member-classes and an empty meta-class – though that too, as said, may or must itself be a member of a higher or ‘larger’ class in a case of infinite inflation rather than infinite regress.
Frege required these empty classes (these null classes) in order to find an extension for the number 0, and therefore complete his reduction of arithmetic to logic, etc. Can we even make sense of an empty class?
S provides us with a logical schema to define the number 0, thus:
0 = df. ¬(x = x)
Put in a stark logical language, the proposition of non-self-identity seems even more ridiculous and absurd, if not contradictory or paradoxical. In natural language, the schema above can be translated thus:
For a definition of the number 0, we can say that it's not the case that all things equal themselves. Indeed there's at least one thing that doesn't equal itself.
It follows that according to Frege we can define the remaining numbers in the way we defined the number 0 – we can do so recursively. It appears strange that we can define 1 in terms of 0; or, more precisely, in term of the empty or null class. As S puts it:
"1 is the class of all classes equal in number to the null class (for it is a logical truth that there is at least one and at most one null class)." (388)
It seems strange, prima facie, that the number 1 is compared with 0 (or is ‘corresponded’ to the null class). We think this because empty classes seem strange or even impossible. And there we may think that there isn’t a single null class. As we saw earlier, Frege himself believed that there is a null class, otherwise we wouldn't have a logical extension for 0.
So 1 is the class of all classes with no members. And there's precisely one null class, according to Frege. Thus,the member-class of the null class is made to correspond to the class of all one-membered classes. It can do so because although the null class has no members (except, perhaps, another class), the null class is still a class of sorts even without members. So it's still a one or a unity. Despite the fact that there's one or a single null class, the members of all one-membered classes can still be taken to correspond, literally one-to-one, with the null class. It follows, therefore, that the number 1 also has its own extension – the null class or the class with no members. However, again, it's still a one (or a unity) and it can therefore still be used to correspond with all the one-membered classes which themselves belong to the class 1 (or the number 1).
In that case, we must also say that the meta-class (the class of all one-membered classes) must itself contain the null class (alongside all the one-membered classes as its other members). It is, again, a member of the class 1 not because it has one member; but because the empty class itself is a one or a unity. The class 1 contains two different classes: one-membered classes as well as the singular null class. This situation is replicated recursively with the other higher numbers.
Now take the number 2.
Instead of saying that 2 is the class of all two-membered classes, we should instead say that 2 is the class of all classes equal in number to the class whose only members are the null class and the class whose only member is the null class. Perhaps we must put it this way because if we talk of ‘one-membered’ or a ‘two-membered’ class we're using numbers in our definitions of numbers. And that's not allowed; primarily because numbers aren't logical but mathematical objects.
The class of all two-membered classes (or the class with these particular concepts that aren't counted, etc.) must include not only the null class but also the class whose only member is the null class. That last class, as we've already seen, is the class we used to define the number 1; just as we used the null set to define it, and, in turn, the null set alone was used to define the number 0. We now have:
i) the class of two- membered classes
ii) the class of one-membered classes the null class
As we've already seen, the classes enclosed within the meta-class must also contain classes ad infinitum.
What we correspond isn't the type of member-classes, but only classes qua classes qua members of classes. It doesn’t matter that the class 2 is a class that itself contains disparate classes - including the class whose only member is the null class and the class whose only member (not members) is the null class. What matters are the classes, not the types of classes (as the later Russell might have put it). In terms of counting, we only count classes as members qua classes, not types of classes. In terms of corresponding classes or members one-to-one, we also only take member-classes qua classes, not qua types. And so on. This ‘so on’ is a recursive ‘so on’, as it were.
As S puts it: We ‘“build” the numbers from the null class, while making no ontological assumptions whatsoever’ (388). This is another way of saying that Frege’s theory is concerned with classes qua classes, not classes qua types of classes. As with an axiomatic deductive logical system, we derive or ‘infer’ the rest of the numbers from the ‘axiomatic’, as it were, 0, rather than from logical axioms or premises. This is no surprise considering that it was part of Frege’s attempt to reduce mathematics to logic. This deductive system of number is itself logical in nature, not just the definitions of the individual numbers themselves.
The Successor Relation
We can also mention the "successor relation". We define this by means of the existential quantifier -∃. More correctly, for the
"number of the Fs is one more than (i.e. successor to) the number of the Gs if there exists an F such that the rest of the Fs are the same number as all the Gs". 
In other words, the members of class F are one more in number than the members of class G. In addition, if class F contains a member or individual F such that when that is excluded, all the other members of class F in fact are the same in number as the previous class G. So, in terms of one-to-one matching of every member of class G with every member of class F bar one. That single anomaly makes class F a different class.
However, in the above we appear to be using number-terms such as ‘number’ itself, ‘one more than’, the ‘same number’, and so on. I thought that number-terms couldn't be used in these Fregean definitions of numbers. However, S writes: "Remember 'same number as' is defined without reference to number.” So S must have used number-terms to translate and simplify the purely logical definitions that, instead, rely only on logical ideas or terms like ‘corresponds with’, ‘equivalence’, and ‘equinumerous’. Without the above translation using numbers, it may be difficult to understand the purely logical definitions of number offered by Frege and others.
In terms of logical recursion in number-definition, we can use a variable and say that
"x is a natural number if it falls under every concept which zero falls under and which is such that any successor of whatever falls under it also falls under it". 
In other words, x is a natural number if it falls under a concept which nothing falls under, or has as its extension the null class. This, clearly now, is a reference to the definition of the number 0. In terms of recursion, we can now talk about other concepts or classes under which at least one thing falls or has as its extension a single class. That is, the number 1. It's a recursive definition because the null class is a member of every ‘successor’ concept or successor class. That is, the class 1 contains both the class with a single member, the null class, and the null class with no members. In that case, successor numbers have been defined in terms of prior numbers or prior classes that are now contained in new classes and thus recursively generate newly defined higher numbers. As S puts it:
"… every concept which zero falls under and which is such that any successor of whatever falls under it also falls under it". 
To conclude, we logically define the number 2/3 by including a class which itself contains classes as members, such as class 2, class 1, and the null class. Or classes with two members, classes with one member, and a single class with no members – the null class.
This Fregean definition was actually used by Peano to derive his own postulates. In turn, from Peano’s he also derived the rest of arithmetic. Both done recursively. Further, Dedekind and Cantor showed how to derive the whole of number theory from arithmetic. Therefore we have derived mathematics from logic.
We can represent this recursive edifice in terms of a foundational schema thus:
i) the whole of number theory
iii) Peano’s ‘postulates’
iv) Frege’s number theory (logical terms)
i) the whole of mathematics
ii) the whole of number theory (Cantor, Dedekind)
iii) arithmetic (also Peano)
iv) Peano’s ‘postulates’
v) Frege’s number theory
vi) logical terms and the ‘constants’
We can therefore condense these schemas into the simpler: