Peace be upon you, and the mercy of Allah, our noble Sayed

Are there sources that support practicing an act of worship, or repeating it, for 40 days? For we see some people performing khatmas (devotional cycles) of supplications, ziyarahs or prayers over a period of forty days, for the fulfillment of needs and other purposes.
In the Name of Allah, the All-beneficent, the All-merciful
Blessings and peace be upon our Prophet Muhammad and his pure family.
Yes, there are a number of grounds on which we can rely for the khatmas to which the believers and scholars have been accustomed, repeating certain litanies and supplications forty times or for forty days. They are as follows:
1- Practicing any act of worship with sincerity for forty days brings about great qualities and virtues, such as detachment from the world (zuhd), wisdom and insight. It has come in al-Kafi from Abu Jaʿfar (a), who said: “No servant makes his faith in Allah sincere for forty days—or he said: No servant excels in the remembrance of Allah Almighty for forty days—but that Allah Almighty makes him detached from this world, gives him insight into its disease and its cure, establishes wisdom firmly in his heart, and makes his tongue speak it.”
2- Many scenes of the descent of the greatest mercy upon His prophets and His servants came about because they supplicated Allah and sought His forgiveness over forty days—the Prophets David and Solomon being an example.
3- The young man whom the Prophet (s) sent away because of the enormity of his sin wept and sought forgiveness for forty days, and then the verse was revealed: “and those who, when they commit an indecent act or wrong themselves, remember Allah, and plead [to Allah seeking His] forgiveness for their sins—and who forgives sins except Allah?—and who knowingly do not persist in what [sins] they have committed” (Qurʾan 3:135)
4- There are several litanies whose repetition forty times has been narrated, which may have a connection with the matter at hand. Among them is the supplication of forty believers for the answering of supplication; and if one is unable to gather the forty, then repeating it forty times.
5- Perhaps forty is the number that represents abundance in its personal aspect, so that by it is realized “Remember Allah with frequent remembrance” (Qurʾan 33:41), that is, one becomes among those who remember Allah much.
For this reason, the number forty has come in many narrations as an indication of abundance, for example:
* The prayer of one who drinks wine is not accepted for 40 days.
* The prohibition against eating meat continuously for 40 days.
* The prohibition against abstaining from eating meat for 40 days.
* Harisa gives strength for 40 days.
* The prohibited hoarding is [for] 40 days.
* The prohibition against leaving off shaving for 40 days.
All of that is an expression of the abundance that is realized by forty.
Hence came the tried-and-tested practices (mujarrabat) of the scholars in ziyarah, the night prayer, or other acts of worship and litanies—practicing them for forty days.
But that does not mean that the customary khatmas are restricted to forty; rather, they may be done with any number, according to the intention of the one considering it—such as repeating the litany 14 times, seeking blessing through the Infallibles, or drawing on the narrations transmitted concerning the numbers in certain supplications and litanies, such as three, ten, seventy, a hundred and so on.
Sayed Mahmoud Al-Mosawi