אמר רב זוטרא בר טוביה אמר רב: המותח חוט של תפירה בשבת - חייב חטאת. והלומד דבר אחד מן המגוש - חייב מיתה, והיודע לחשב תקופות ומזלות ואינו חושב - אסור לספר הימנו. [...]
אמר רבי שמעון בן פזי אמר רבי יהושע בן לוי משום בר קפרא: כל היודע לחשב בתקופות ומזלות ואינו חושב - עליו הכתוב אומר +ישעיהו ה+ ואת פעל ה’ לא יביטו ומעשה ידיו לא ראו.
אמר רבי שמואל בר נחמני אמר רבי יוחנן: מנין שמצוה על האדם לחשב תקופות ומזלות - שנאמר +דברים ד+ ושמרתם ועשיתם כי היא חכמתכם ובינתכם לעיני העמים איזו חכמה ובינה שהיא לעיני העמים - הוי אומר זה חישוב תקופות ומזלות.
English from Soncino:
R. Zutra b. Tobiah said in Rab’s name: He who pulls the thread of a seam on the Sabbath is liable to a sin-offering; and he who learns a single thing from a Magian is worthy of death; and he who is able to calculate the cycles and planetary courses but does not, one may hold no conversation with him. [...]
R. Simeon b. Pazzi said in the name of R. Joshua b. Levi on the authority of Bar Kappara: He who knows how to calculate the cycles and planetary courses, but does not, of him Scripture saith, but they regard not the work of the Lord, neither have they considered the operation of his hands.
R. Samuel b. Nahmani said in R. Johanan’s name: How do we know that it is one’s duty to calculate the cycles and planetary courses? Because it is written, for this is your wisdom and understanding in the sight of the peoples: what wisdom and understanding is in the sight of the peoples? Say, that it is the science of cycles and planets.
The Semag actually records this as one of the 613 commandments, aseh 75: