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.

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

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

A364834 Sum of positive integers <= n which are multiples of 2 or 5.

Original entry on oeis.org

0, 2, 2, 6, 11, 17, 17, 25, 25, 35, 35, 47, 47, 61, 76, 92, 92, 110, 110, 130, 130, 152, 152, 176, 201, 227, 227, 255, 255, 285, 285, 317, 317, 351, 386, 422, 422, 460, 460, 500, 500, 542, 542, 586, 631, 677, 677, 725, 725, 775, 775, 827, 827, 881, 936
Offset: 1

Views

Author

DarĂ­o Clavijo, Aug 09 2023

Keywords

Comments

a(n) is odd iff 5 <= n mod 20 <= 14. - Saish S. Kambali, Aug 14 2023

Crossrefs

Programs

  • Mathematica
    Accumulate[Table[n * Boole[MemberQ[Mod[n, {2, 5}], 0]], {n, 0, 55}]] (* Amiram Eldar, Aug 09 2023 *)
  • PARI
    a(n) = vecsum(select(x->(!(x%2) || !(x%5)), [1..n])); \\ Michel Marcus, Aug 09 2023
  • Python
    sn = lambda k, n: ((n // k)*((n // k) + 1) * k) // 2
    a = lambda n: sn(2, n) + sn(5, n) - sn(10, n)
    print([a(n) for n in range(1, 56)])
    

Formula

a(n) = sn(n,2) + sn(n,5) - sn(n,10) where sn(n,d) = (an(n,d) * (an(n,d) + d))/(2*d) and an(n,d) = d * floor(n/d).
a(n) = Sum_{k=2..n} {k if gcd(k,10) > 1}.
Showing 1-3 of 3 results.