I wanted to add something about the significance of forty days. Forty is a number that people notice in the Bible in some powerful scenarios, such as Jesus' fast in the desert. Scholars point out that forty is one of the numbers that Israelites find significant (forty years in desert exile, and so forth).
Again, it's not the number "40" that is significant, but each unique context of being "not enough," "just right," and "too much" (or "more than enough.") Look at the Biblical wandering in exile for forty years first.
Despite the few patriarchs who lived incredibly long lives, in Biblical times humans tended to view achieving old age as in their fifties. I don't have the biological figures in front of me, but the average life span of most people was fifty years or well under, throughout the world at that time. So it is not so much the number "40" as it was the measure of what was the sufficient amount of time for an entire generation to pass out of slavery and a new generation be born. So forty years is "just right" for 1) most people with slave mentality to have lived out their remaining years "free," but passing away so that the new and free generation takes over, and 2) they have several decades of learning and obeying God's teaching. As you know that was a hard thing for them to do even with God actually THERE. So it is not the "40" that is significant as much as it is the number of years where a generation passed and a new generation painfully learned to be both free people and knowing their God and codifying his worship.
So, let's be real. How long one fasts is not something you measure in years, so it's not like Jesus was going to fast for forty years! I'm being silly a bit here only because numerologists and many so called "scholars" are hugely silly. So Jesus is going to go and fast "the right amount of time." How much is the right amount of time? We know that humans can live without food for somewhere between two and three weeks. So that would be an extreme but "average" fast. Jesus was not your average person, obviously, being the Savior and the Messiah. He sets a higher example, and he also had the sustenance of being from the Holy Spirit through Mary. So Jesus was not "aiming to make the 40" in order to impress anyone with a magic number. He was a straight forward guy; he would have told the disciples if they were supposed to do things "by the forties." Jesus told them he didn't keep secrets from them; that would have defeated the whole purpose of him patiently explaining over and over what God wants. So Jesus fasted until it was "just the right amount." He fasted to demonstrate that it was not your average yet still impressive extreme fast of two to three weeks. He essentially doubled the time that someone could be expected to fast. Instead of 21 days (3 weeks) he fasted 40 days (just about double, and therefore almost 6 weeks).
So Jesus "made a point" but not that "40" is a whoop ti do magic number. And it was not a "hat tip" to the time of exile by referencing 40 because, um, well, Jesus made meaningful hat tips such as quoting Moses and appearing with Moses in person in front of three Apostles during the Transfiguration. I mean, people, you have to think a little bigger than looking for a number mentioned twice (measuring wildly different things) and say it is a holy or significant number. In both separate cases it was "just enough" of a quantity that was necessary for humanity in their emerging faith history to accomplish something good. So the point that Jesus made is that he truly emptied himself out of food sustenance beyond what the average human would expect in order to demonstrate that he was filling himself with space for the Holy Spirit to operate. Just as the ancient Israelites "emptied themselves" of the slave generation, Jesus emptied himself out of human food support, in order to demonstrate that he will show people how to survive on the Spirit. It's meaningful coincidence that both events can be measured by using the human construct of mathematics to result in a measure in both cases of "40."
By meaningful coincidence I mean that there are fruitful and valid parallels to be drawn, so it is entirely OK and even desirable to go, "Hmm, 40, I've heard that number before. Let me read the scriptures where it appeared. Oh yes!" And then one can conclude that there is a parallel of "emptying out," so that one can be filled with freedom, piety and Spirit. But the "40" itself has no meaning, but lends itself to the way human minds work, which is to be referential and curious, seeking linkages.
It's the message that is significant, not the number. Notice that the first Beatitude is "Blessed are the poor in spirit, for theirs is the kingdom of heaven" (Matthew 5:2). It's not that the Beatitude is in the position of the number one in the list. It can be linked to the fasting of Jesus because Jesus spends 40 days in order to empty himself the right amount to demonstrate how he fills instead with the Spirit, rather than human bread. He demonstrates with his body in the fast in order to teach others later with words that they too, empty and poor in spirit, will be filled with Spirit in heaven. The actions of Jesus and his words of teaching are significant, not the mathematics of counting that is used to help humans share the information and measure what had happened for how long and in what order. Jesus starts with that Beatitude because it sets the tone and is of fundamental importance, rather than because there is something special about "1."
I really hope this helps. People are really missing the point of the spirituality and theology as they do an idolatry of numbers.