Personally I think the easiest and most intuitive for the user is to simply rank in order by when the most recent viewing was, and not worry about how many times the listing has been previously seen. Perhaps let the user flag particular listings as being of interest, so that they come to the top regardlesss of when it was last viewed. However, you asked for an algoithm that weighs the time since the most recent viewing together with the number of viewings to produce a score, then rank the listings by score. It all depends how you feel the relative weight of time versus frequency should be handled. For example - if I viewed one listing 4 times last week and not since, and I viewed a second listing just once yesterday, which should score higher? if I viewed a third listing 100 timnes last year but not since how should that be ranked?
Here's one approach - don't know if it matches what you're expecting, but if you keep track of all viewings by date for each user then you could produce a score for each listing that would be calculated as follows. Let = number of viewing of a particular site, = time (in days) elapsed since the viewing (i= 1 for today, i=2 for yesterday, etc), then the score for that listing would be:
In this systen one viewing today scores 1 point, which equals 2 viewings yesterday but is less than one viewing yesterday plus 2 viewing 2 days ago.