I'm working my way through Wolfram Challenges, the first question was Ok but tripped myself up on the second question. I have a basic function which takes a positive integer n and returns the number of multiples of both 3 and 5 up to n. It works for relatively smaller sets but after a point it gets stuck. So I am having trouble formatting it to be a proper written function. In searching for an answer myself, people online have made all sorts of elegant solutions for this popular programming problem but my question is far simpler in that I don't know why my function is failing.
f[n_Integer]:= Length[If[Mod[#, 15] == 0, #, Nothing] & /@ Range[n]]