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-2 of 2 results.

A126590 Multiples of 3 or 5 but not both.

Original entry on oeis.org

3, 5, 6, 9, 10, 12, 18, 20, 21, 24, 25, 27, 33, 35, 36, 39, 40, 42, 48, 50, 51, 54, 55, 57, 63, 65, 66, 69, 70, 72, 78, 80, 81, 84, 85, 87, 93, 95, 96, 99, 100, 102, 108, 110, 111, 114, 115, 117, 123, 125, 126, 129, 130, 132, 138, 140, 141, 144, 145, 147, 153, 155, 156
Offset: 1

Views

Author

Zak Seidov, Mar 13 2007

Keywords

Comments

Numbers n such that (n mod 3)*(n mod 5) = 0 and n mod 15 > 0.

Examples

			3, 5, 6, 9, 10, 12, (not 15), 18, 20, 21, 24, 25, 27, (not 30), 33, etc.
		

Crossrefs

Programs

  • Magma
    I:=[3,5,6,9,10,12,18]; [n le 7 select I[n] else Self(n-1) + Self(n-6) - Self(n-7): n in [1..70]]; // G. C. Greubel, Mar 06 2018
  • Mathematica
    s={}; Do[m3=Mod[n,3]; m5=Mod[n,5]; m15=Mod[n,15]; If[m3*m5==0&&m15>0,AppendTo[s,n]],{n,200}]; s
  • PARI
    is(n)=isprime(gcd(n,15)) \\ Charles R Greathouse IV, Oct 11 2013
    

Formula

a(n) = a(n-1) + a(n-6) - a(n-7). - Charles R Greathouse IV, Oct 11 2013

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).
Showing 1-2 of 2 results.