[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math

Search:


View post   

>> No.5358570 [View]
File: 9 KB, 125x162, FileLeonhard_Euler.jpg [View same] [iqdb] [saucenao] [google]
5358570

>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.

Simple code, with a O(n) brute force algorithm. Does anyone know the O(1) algorithm?

Navigation
View posts[+24][+48][+96]