All perfect praise be to Allaah, The Lord of the Worlds. I testify that there is none worthy of worship except Allaah, and that Muhammad is His slave and Messenger. We ask Allaah to exalt his mention as well as that of his family and all his companions.
Being grateful and thankful to Allaah is by remembering Him with the tongue, heart and limbs.
Remembering Him with the heart is to believe that the blessings that are bestowed on you are by the Grace of Allaah. Allaah says (interpretation of the meaning): {And whatever of blessings and good things you have, it is from Allaah.}[16:53].
Remembering Him with the tongue is to mention the blessings of Allaah on you, ascribing them to Him, and not to show off and exalt oneself over other people. Allaah says (interpretation of the meaning): {And proclaim the Grace of your Lord.}[93:11].
Remembering Him with the limbs is to use these bounties in the obedience of Allaah. Allaah says (interpretation of the meaning): {Work you, O family of Daawood, with thanks.}[34:13].
There is no doubt that fasting is one of the most important acts of worship of the limbs. It is indeed a way of being grateful to Allaah. You have to know, dear brother, that no matter to what extent a person performs acts of obedience, he can never be grateful about all the bounties that Allaah blessed him/her with, as Allaah says (interpretation of the meaning): {And if you count the favours of Allaah, never could you be able to count them.}[16:18].
As regards the second question, the supplications (and remembrance) that Allaah has legislated to be said according to a given number, have to be complied with. The Prophet said: ''He who visits a sick person whose appointed time of death has not yet come, and says seven times: ''I ask Allaah, Al-'Atheem (The Greatest), the Lord of the magnificent Throne to cure you, except that he is cured from his disease.''
So this supplication and others have to be complied with regarding the number of times that they have to be said. If a supplication is not said according to its specific number, it might not be of the same excellence as if it is said exactly according to the number specified.
Finally we draw the attention of the questioner that we do not know of a supplication in the Sunnah that has to be said 40 times. As regards the saying of the questioner 'then you will see a miracle' we do not understand what he means by this.
Allaah knows best.