It seems you have four phrases here:
1. "passing time", "marking time", "keeping track of time"
Ex.: "He is passing time in the hospital by reading novels."
Ex.: "The prisoner was marking time by saving one crumb for every day."
Ex.: "The teacher was keeping track of time during the test and warned us when only ten minutes remained."
2. "as vast as the ocean"; very expansive; unlimited
Ex.: "His potential to succeed is as vast as the ocean."
Ex.: "The distance between their hearts was as vast as the ocean."
3. "mathematical logic"
This is complicated. It is a whole system of how to combine numbers. Things like +, -, x, <, =, etc. are part of mathematical logic.
4. "memory"; ability to retain information; an experience that is remembered
Ex.: "He has an excellent memory; he never forgets someone's name!"
Ex.: "My computer has 500G of memory; it can store a large amount of information and files."
Ex.: "I have good memories about our vacation house at the beach."
I hope that was accurate and helpful.