cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-3 of 3 results.

A126592 Sum of numbers less than or equal to n which are multiples of 3 or 5.

Original entry on oeis.org

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
Offset: 1

Views

Author

Zak Seidov, Mar 13 2007

Keywords

Comments

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

Crossrefs

Programs

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

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

A126073 Sum of numbers <= n which are multiples of 3 or 5 but not 15.

Original entry on oeis.org

0, 0, 3, 3, 8, 14, 14, 14, 23, 33, 33, 45, 45, 45, 45, 45, 45, 63, 63, 83, 104, 104, 104, 128, 153, 153, 180, 180, 180, 180, 180, 180, 213, 213, 248, 284, 284, 284, 323, 363, 363, 405, 405, 405, 405, 405, 405, 453, 453, 503, 554, 554, 554, 608, 663, 663, 720, 720
Offset: 1

Views

Author

Zak Seidov, Mar 13 2007

Keywords

Comments

Sum of numbers m<=n such that mod(m,3)*mod(m,5)=0 and mod(m,15)>0.
First differences (fd) are
0,3,0,5,6,0,0,9,10,0,12,0,0,0,0,
0,18,0,20,21,0,0,24,25,0,27,0,0,0,0,
0,33,0,35,36,0,0,39,40,0,42,0,0,0,0,...
fd(1..15)={0,3,0,5,6,0,0,9,10,0,12,0,0,0,0}; for n>15
fd(n)=fd(n-15)+15 if fd(n-15)>0, fd(n)=0 otherwise.

Crossrefs

Programs

  • 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]-2*sn[n,15],{n,1000}]
    Accumulate[Table[If[Mod[n,3]Mod[n,5]==0&&Mod[n,15]>0,n,0],{n,60}]] (* Harvey P. Dale, Jul 19 2025 *)

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]-2*sn[n,15].

A335650 Numbers that are multiples of 2,3,5, or 7 but not multiples of the product of any combination of 2,3,5, and 7.

Original entry on oeis.org

2, 3, 4, 5, 7, 8, 9, 16, 22, 25, 26, 27, 32, 33, 34, 38, 39, 44, 46, 49, 51, 52, 55, 57, 58, 62, 64, 65, 68, 69, 74, 76, 77, 81, 82, 85, 86, 87, 88, 91, 92, 93, 94, 95, 99, 104, 106, 111, 115, 116, 117, 118, 119, 122, 123, 124, 125, 128, 129, 133, 134, 136, 141, 142
Offset: 1

Views

Author

Peter Andrew, Jun 15 2020

Keywords

Examples

			4 is a term because 4 = 2 * 2;
77 is a term because 77 = 7 * 11;
6 is not a term because 6 = 2 * 3;
21 is not a term because 21 = 3 * 7;
30 is not a term because 30 = 2 * 3 * 5;
210 is not a term because 210 = 2 * 3 * 5 * 7.
		

Crossrefs

Cf. A126590.

Programs

  • Haskell
    a335650 = [x | x <- [0..], (gcd x 210) `elem` [2,3,5,7]]
  • Maple
    q:= n-> is(igcd(n, 210) in {2,3,5,7}):
    select(q, [$0..200])[];  # Alois P. Heinz, Jun 16 2020
  • Mathematica
    Select[Range[150], Count[IntegerExponent[#, {2, 3, 5, 7}], 0] == 3 &] (* Amiram Eldar, Jun 16 2020 *)
Showing 1-3 of 3 results.