Josheli
  • Home
  • Blog
    • Knob
    • Running
    • Soccer
    • Technology
  • Projects
    • Overview
    • No Instagram
    • Google Photos WordPress Plugin
    • Plex Channels
    • Sh***y Game
    • Soccer In Colorado
    • Statrat
    • The Dot Game
    • Vox cPanel Hacks
    • WW Points Calculator
  • About
Knob , Technology

Project Euler Problem 1

by dv January 10, 2012 No Comments

Endeavoring to be more of a producer than a consumer, ran across Project Euler which looks to be low friction but somewhat useful and interesting. Unfortunately their register/login system is broken:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/admin/domains/projecteuler.net/public_html/includes/login_preprocess.php on line 11

So I’ll keep track on my own blog I guess and see how far along I get.

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.

And my solution, in PHP:

$sum = 0;

for($i = 0; $i < 1000; ++$i) { if(!($i % 3) || !($i % 5)) { $sum += $i; } } echo number_format($sum); [/php] Answer: 233,168

Related Content:

  • Reason Number 48 Drupal Drives Me Crazy by Dv November 13, 2013 A user requests the ability to browse and insert links to nodes (pages) from the WYSIWYG editor, similar to how…
  • “10K Pace”? What’s That? by Dv July 20, 2006 Gilbert often says workouts need to be done at "10K pace". What is that really? It seems like everyone always…
  • Aptana Studio 3 Sync with Mapped Drives by Dv December 2, 2011 Soldiering on with Aptana, fighting as I go, here's how I was able to set up automatic synchronization between my…
  • Capitol 10K 2007 Rerun by Dv March 26, 2007 Our perceptions of the world and ourselves are odd. Sometimes what we think happened didn't actually happen. Sometimes what we…
  • Another blog about me plus some other stuff by Dv March 20, 2008 I said "I'm slow." Fletcher said, "save it for the blog." So here it is. I'm slow. By slow I…
  • Previous Aptana Studio 3 Sync with Mapped Drives9 years ago
  • Next Reason Number 48 Drupal Drives Me Crazy9 years ago

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Popular Posts

  • Josheli, What Happened? (11,517)
  • Install Ubuntu on HP Laptop with UEFI and new SSD Hard Drive (9,408)
  • Running a Plex Media Server on an Old Laptop (9,045)
  • More Janky Snowboarding Video (7,037)
  • Come Ski With Me (6,548)

Random Read

10 Miles and Nothing to Say
Ran ten on Saturday. Better in retrospect than at the time, though my legs are…

Read More

Google Photo
Google Photo
Google Photo
Google Photo

Social Things

  • Family Photos
  • Juiskie’s Instagram
  • Scooter’s Facebook
  • Scooter’s Instagram
  • YouTube Videos
  • DV’s Github
  • Tweet Tweet

RSS From Familyvance

  • Snowshoeing at Brainard Lake
  • Fishing and Hiking at Golden Gate Canyon State Park
  • Rainbow Trout Fishing Report at Waneka Lake
  • Weightless Texas-Rig Plastic Worms at Sawhill Ponds and Coot Lake
  • Sawhill Ponds Fishing Report
2021 Josheli. Donna Theme powered by WordPress