How many books make up the 5 Books of Moses? You might think that there are five but really there may be seven. Or perhaps five.
There are two curious signs, the 2 inverted Nun in Numbers 10, 34, that serve as a subject of various Midrashic comments. The purpose of these signs is mysterious; we don't even know what they are supposed to look like . The fact is that there exist different traditions were they are upside down or read left to right or half left to right and half regular. Since we do not know what their shapes in truth are, it is hard to relate them to the other findings of unusual nun's, seven examples in Psalms 107 and, perhaps another example in the verse "…and Terach died in Haran ( Genesis 11, 32) . The different Midrashic explanation to this ancient phenomenon nicely illustrate the various approaches that Midrash can employ.
This sections has small signs around it, meaning, that this is not its real place. Rebbi says: That is not the reason but because (these verses) are considered a book of its own. The saying of R. Shmuel Bar Nachmeini , "She set its pillars seven - this is seven book of the Torah", follows whom? It follows Rebbi. Who is the Tanna who argues against Rebbi? It is R. Shimon Ben Gamliel. R. Shimon Ben Gamliel says: This section will be uprooted from its place and written in its rightful place in the future (but for now it is in its correct location). Why is it written here? So as to separate between first and second retribution . Second retribution is "and the people grumbled". First retribution is "and they traveled form the mountain of G-d ( i.e., they eagerly run away from G-d's presence)". Where is it its appropriate place? R. Ashi says: In the section on encampments (Shabbos 115-116).
The two Tannaim disagree whether this section belongs in its current location at present time. According to Rebbi it does for it demarcates a separate book of Torah. As a result there are three books in Numbers. The first book thematically belongs to Leviticus, the last to Deuteronomy and these two verses are transitional. R. Shimon states that it is in a good place for now but will ultimately be moved to an even more appropriate place. Both solve this difficult problem by recourse to a radical pshat explanation.
2. Halachic derash
A book that became erased and there remain in it 85 letters, like the section :and it was when the Ark was carried", renders hands impure (Yadaim 3,5) .
The section is set apart so as to encode a Halacha.
3. These verses were incorporated in to the Torah from the prophecy of Eldad and Meidad. Their prophecy so remained and was explained by the Ezekiel: "So says the Lord, G-d. Are you the one of whom I have spoken in the days of yore through prophets of Israel . And some say that there was a hidden book (of prophecy) (Midrash Chaseiros V'Yoseiros).
This midrash suggests that these verses were placed into an apparently inappropriate place because they contained the prophecy of Eldad and Meidad. The placement of a few sentences of a prophecy that is of relevance for later generations but of a prophet who did not merit his own book is not an uncommon occurrence throughout Tanach. Thus Netsiv writes: " Song of Songs – that was composed out of many separate songs of which many were composed through Ruach Hakodesh by others (not Solomon). For example the song “tell me…(1,7)” was said by Moshe as is explained in the Sifri… Also the verse “kiss me…” (1,2) was received (as tradition) by our Rabbis to have been written prior to Solomon and they asked :When was it composed?”. Similarly “We have a little sister (8,8)” was said at the days of Avraham, as explained in Genesis Rabba, section Lech Lecha. Solomon gathered songs through the Holy Spirit and also added of his own and fashioned it into one song. This is also like this regarding the book of Psalms that his father produced and which was called by his name even though it contains songs that were said by others…. So it says in Pesachim 117a that all the praises in the Psalms David said, as it says”completed songs of David son of Jesse”, because David edited and added to them. So also Solomon gathered verses that he had at hand and added many others of his own and made of it into one song… There are songs that were composed with a certain meaning at one time and Solomon adjusted it through Ruach Hakodesh for a different time”. (Rina Shel Torah 1,1)
“This prophecy (in Micha) is very difficult to understand. It appears that it was pre-existing form the time of the Judges and at the time of Micha it was added to the rest of his words. It states similarly in Leviticus Rabba that two verses in Isaiah were already known for the time of Be'eri (father of Ezekiel) but were added to the book of Isaiah. There are many such instances in Prophets and Writings (He'emek Davar to Genesis 49, 10)”. The Netsiv expands on this and cites many other examples in He'emek Sha'ala 166,5, among them that Shema Yisrael was first pronounced by the 12 tribes thorough Ruach Hakodesh and later incorporated by Moshe into the Torah, as per Pesachim 56a. This process of second transcription , he explains, accounts also for the phenomen of Keri and Ketiv, that is for the many words in the Hebrew Bible that are written in one way but are read somewhat differently. The Ketiv represents the original wording as first said through Ruach Hakodesh and the Keri the wording as it was transcribed in its final form the second time around, under Ruach Hakodesh.
S. Liebermann suggests that the inverted nuns function like similar signs in early reek manuscripts. These were used to indicate a space or yo mark passages that are in a wrong place - similar to the explanations that we have seen. It is difficult to see how this would apply to the passage in Pslams, however .
4. Aggadic Derash
The two nuns ) are similar to khaf and reish- to say that they are Ach and Rak (Only and however). Ach and Rak always exclude - to say that this is not the place of this section. Rebbi says because it is a book of its own (Lekach Tov).
Here the shape of the inverted nuns serves as an occasion of a derash which is then used to support the opinions found in the Talmud Shabbos.
The variety of approaches illustrates that Midrash is not only about parables or flights of fancy but that it also incorporates derash as well as pshat based approaches and even, what might now be called a 'critical'  approach.
1 Responsa Nefesh Chays to YO'D # 71 suggests that the various different shapes found in sifre torah are due to scribal elaboration of simple nun's that were originally the only ones in existence.
2 On the disagreement whether there is an additional nun or inverted nun, see Minchas Shai and Sum Seikhel of R. Wolf Heidenheim in his Toras Hoelokim ibid. Mesora to Numbers ibid does appear to classify the nuns in Pslams and Numbers as being the same but it does not mention the nun of Haran.
3 See Maharsho who explains that Num is a symbol of punishment as it makes up the word 'nafla', fell.
4 See also Yersushalmi Megillah 5, 9 and Sahbbos 116b for a somewhat different halachic derash.
5 I.Yavin, Introduction to Timerian Masorah, Masoretic studies 5, Scholar's Press, 1980
6 In its technical usage of "scientific".