login
This site is supported by donations to The OEIS Foundation.

 

Logo

Please make a donation to keep the OEIS running. We are now in our 55th year. In the past year we added 12000 new sequences and reached 8000 citations (which often say "discovered thanks to the OEIS"). We need to raise money to hire someone to manage submissions, which would reduce the load on our editors and speed up editing.
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A126592 Sum of numbers less than or equal to n which are multiples of 3 or 5. 3
0, 0, 3, 3, 8, 14, 14, 14, 23, 33, 33, 45, 45, 45, 60, 60, 60, 78, 78, 98, 119, 119, 119, 143, 168, 168, 195, 195, 195, 225, 225, 225, 258, 258, 293, 329, 329, 329, 368, 408, 408, 450, 450, 450, 495, 495, 495, 543, 543, 593, 644, 644, 644, 698, 753, 753, 810, 810 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

Sum of numbers m <= n such that mod(m, 3) * mod(m, 5) = 0.

LINKS

Harvey P. Dale, Table of n, a(n) for n = 1..1000

Project Euler, Multiples of 3 and 5

FORMULA

an(n, d) = d * floor(n/d), sn(n, d) = (an(n, d) * (an(n, d) + d))/(2*d), a(n) = sn(n, 3) + sn(n, 5) - sn(n, 15).

MATHEMATICA

an[n_, d_] := d * Floor[n/d]; sn[n_, d_] := (an[n, d] * (an[n, d] + d))/(2 * d); Table[sn[n, 3] + sn[n, 5] - sn[n, 15], {n, 1000}]

Accumulate[Table[If[Divisible[n, 3] || Divisible[n, 5], n, 0], {n, 60}]] (* Harvey P. Dale, Jun 09 2016 *)

Accumulate[Table[n Boole[GCD[n, 15] > 1], {n, 50}]] (* Alonso del Arte, Dec 23 2018 *)

PROG

(PARI) {b(n, x)=floor(n/x)*(1 + floor(n/x))};

for(n=1, 30, print1((3*b(n, 3) + 5*b(n, 5) - 15*b(n, 15))/2, ", ")) \\ G. C. Greubel, Mar 06 2018

(MAGMA) [(3*Floor(n/3)*(1 + Floor(n/3)) + 5*Floor(n/5)*(1 + Floor(n/5)) - 15*Floor(n/15)*(1 + Floor(n/15)))/2: n in [1..30]]; // G. C. Greubel, Mar 06 2018

(Scala) (for (n <- 2 to 50) yield if ((n % 3) * (n % 5) == 0) { n } else { 0 }).scanLeft(0)(_ + _) // Alonso del Arte, Dec 23 2018

CROSSREFS

Cf. A126073, A126590.

Sequence in context: A090597 A304887 A126073 * A055057 A154029 A219349

Adjacent sequences:  A126589 A126590 A126591 * A126593 A126594 A126595

KEYWORD

nonn,easy

AUTHOR

Zak Seidov, Mar 13 2007

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 13 01:23 EST 2019. Contains 329963 sequences. (Running on oeis4.)