## DEV Community

Posted on • Updated on

# Hey folks

Project Euler is a series of challenging mathematical/computer programming problems that I like to start. I'm sure there will be a lot to learn for me, and I would like to share my solutions here in DEV.

❓ Here is problem 001:

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.

💡 For solving this problem, we can simply use the Modulo operation and calculate the numbers which are multiples of 3 or 5.

❗ Modulo is a math operation that finds the remainder when one integer is divided by another. In writing, it is frequently abbreviated as a mod, or represented by the symbol %.
For two integers a and b:
a mod b = r
Where a is the dividend, b is the divisor (or modulus), and r is the remainder.

Here is an example:

11 mod 4 = 3, because 11 divides by 4 (twice), with 3 remaining.

💻 So, my solution in Python is:

``````sum = 0

for integer in range(1, 1000):
if integer % 3 == 0 or integer % 5 == 0:
sum += integer
print(sum)
``````

✅ The answer to this problem is `233168`.

## Thank You ❤️

I wish my posts to be useful to anyone new to the world of programming or anybody curious 🧐!
If you find the content useful to you, please comment your thoughts, I would love to learn from you all.

Thank you for your loving directions.
{"ft_lang_label":"__label__en","ft_lang_prob":0.9112439,"math_prob":0.9678369,"size":1371,"snap":"2023-14-2023-23","text_gpt3_token_len":369,"char_repetition_ratio":0.101682514,"word_repetition_ratio":0.0073260074,"special_character_ratio":0.27862874,"punctuation_ratio":0.12,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99683595,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-06-08T11:24:46Z\",\"WARC-Record-ID\":\"<urn:uuid:c5a27b0b-33b1-4a36-9ad4-37e135f5961a>\",\"Content-Length\":\"74799\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:0a0d486b-837c-4e1f-8a1c-e3dac445eb51>\",\"WARC-Concurrent-To\":\"<urn:uuid:3b823a9c-c33c-4aa0-8a1e-9741a5bcb618>\",\"WARC-IP-Address\":\"146.75.37.194\",\"WARC-Target-URI\":\"https://practicaldev-herokuapp-com.global.ssl.fastly.net/feriun/project-euler-001-2213\",\"WARC-Payload-Digest\":\"sha1:YODCI4235O2FHGGYE4JYRIPQUJ5NFPXG\",\"WARC-Block-Digest\":\"sha1:6XXJPJHF3YHCAQ6JB6LIRRYDLFJLP5NS\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-23/CC-MAIN-2023-23_segments_1685224654871.97_warc_CC-MAIN-20230608103815-20230608133815-00786.warc.gz\"}"}