<jupyter_start><jupyter_text>[Problem 1](https://projecteuler.net/problem=1)---If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.  Find the sum of all the multiples of 3 or 5 below 1000. Brute Force---In scala, adding to a variable isn't good form, the proper way to brute force through every value in a range is to use recursion. And to keep from blowing the stack, I make sure it's tail recursive.<jupyter_code>@annotation.tailrec
final def natural3and5brute(upper:Int = 1000, current:Int = 1, output:Int = 0):Int = {
  if (current == upper) output
  else {
      val newout:Int = if (current % 3 == 0 | current % 5 == 0) output + current else output
      natural3and5brute(upper, current + 1, newout)
  }
}
natural3and5brute()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09535160905840286, 'fraction_numerical': 0.041716328963051254, 'mean_word_length': 4.0602409638554215, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '115959', 'license': 'MIT', 'n_tokens_mistral': 296, 'n_tokens_neox': 260, 'n_words': 114, 'path': 'scala/Problem1.ipynb', 'repo_name': 'destrys/euler', 'size': '839'}