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.

A187333 a(n) = floor(n/5) + floor(2n/5) + floor(3n/5) + floor(4n/5).

Original entry on oeis.org

0, 0, 2, 4, 6, 10, 10, 12, 14, 16, 20, 20, 22, 24, 26, 30, 30, 32, 34, 36, 40, 40, 42, 44, 46, 50, 50, 52, 54, 56, 60, 60, 62, 64, 66, 70, 70, 72, 74, 76, 80, 80, 82, 84, 86, 90, 90, 92, 94, 96, 100, 100, 102, 104, 106, 110, 110, 112, 114, 116, 120, 120, 122, 124, 126, 130, 130, 132, 134, 136, 140, 140, 142, 144, 146, 150
Offset: 0

Views

Author

Clark Kimberling, Mar 08 2011

Keywords

Crossrefs

Cf. A187326.

Programs

  • Mathematica
    Table[Floor[n/5]+Floor[2n/5]+Floor[3n/5]+Floor[4n/5], {n,0,120}]
    Table[Total[Floor/@((Range[4]n)/5)],{n,0,80}] (* or *) LinearRecurrence[ {1,0,0,0,1,-1},{0,0,2,4,6,10},80] (* Harvey P. Dale, Oct 19 2018 *)

Formula

a(n) = floor(n/5)+floor(2n/5)+floor(3n/5)+floor(4n/5).
G.f.: 2*x^2*(1+x+x^2+2*x^3) / ( (x^4+x^3+x^2+x+1)*(x-1)^2 ). - R. J. Mathar, Mar 08 2011

A187331 a(n) = Sum_{k=1..4} floor(k*n/4).

Original entry on oeis.org

0, 1, 4, 6, 10, 11, 14, 16, 20, 21, 24, 26, 30, 31, 34, 36, 40, 41, 44, 46, 50, 51, 54, 56, 60, 61, 64, 66, 70, 71, 74, 76, 80, 81, 84, 86, 90, 91, 94, 96, 100, 101, 104, 106, 110, 111, 114, 116, 120, 121, 124, 126, 130, 131, 134, 136, 140, 141, 144, 146, 150, 151, 154, 156, 160, 161, 164
Offset: 0

Views

Author

Clark Kimberling, Mar 08 2011

Keywords

Crossrefs

Cf. A187332 (complement), A187326 (= a(n) - n), A187333.

Programs

  • Mathematica
    t=Table[Sum[Floor[k*n/4], {k,1,4}],{n,0,200}]  (* A187331 *)
    Complement[Range[Length[t]], t]                (* A187332 *)
  • PARI
    A187331(n)=n\4+n\2+3*n\4+n \\ M. F. Hasler, Nov 21 2017

Formula

From Chai Wah Wu, Jun 07 2016: (Start)
a(n) = a(n-1) + a(n-4) - a(n-5) for n > 4.
G.f.: x*(4*x^3 + 2*x^2 + 3*x + 1)/(x^5 - x^4 - x + 1). (End)
a(n) = n + A187326(n), where A187326(n) = [n/4] + [n/2] + [3n/4], [.] = floor. - M. F. Hasler, Nov 21 2017

A244590 a(n) = sum( floor(k*n/8), k=1..7 ).

Original entry on oeis.org

0, 0, 4, 7, 12, 14, 18, 21, 28, 28, 32, 35, 40, 42, 46, 49, 56, 56, 60, 63, 68, 70, 74, 77, 84, 84, 88, 91, 96, 98, 102, 105, 112, 112, 116, 119, 124, 126, 130, 133, 140, 140, 144, 147, 152, 154, 158, 161, 168, 168
Offset: 0

Views

Author

Gary Detlefs, Jun 30 2014

Keywords

Comments

This sequence is G(n,8) where G(n,m) = sum(floor(k*n/m), k=1..m-1). This function is referenced in A109004 and is used in the following formula for gcd(n,m): gcd(n,m) = n+m-n*m+2*G(n,m).
Listed sequences of this form are:
G(n,2) ... A004526;
G(3,n) ... A130481;
G(n,4) ... A187326;
G(n,5) ... A187333;
G(n,6) ... A187336;
G(n,7) ... A187337;
G(n,k*n)/k = n*(n-1)/2 = G(n,n+k)-G(n,k).
It is of interest to note that this alternate form of gcd(n,m) will be undefined if m is a function having a zero in it. For example, gcd(n, n mod 4) would be undefined but gcd(n mod 4, n) would be defined.

Crossrefs

Cf. A109004.

Programs

  • Magma
    [&+[Floor(k*n/8): k in [1..7]]: n in [0..50]]; // Bruno Berselli, Jul 01 2014
    
  • Maple
    G:=(n,m)-> sum(floor(k*n/m), k=1..m-1): seq(G(n,8), n = 0..60);
  • Mathematica
    Table[Sum[Floor[k n/8], {k, 1, 7}], {n, 0, 50}] (* Bruno Berselli, Jul 01 2014 *)
  • Sage
    [sum(floor(k*n/8) for k in (1..7)) for n in (0..50)] # Bruno Berselli, Jul 01 2014

Formula

a(n) = sum( floor(k*n/8), k=1..7 ).
a(n) = ( gcd(n,8) - (n+8) + n*8 )/2.
G.f.: x^2*(4 + 3*x + 5*x^2 + 2*x^3 + 4*x^4 + 3*x^5 + 7*x^6)/((1 + x)*(1 - x)^2*(1 + x^2)*(1 + x^4)). [Bruno Berselli, Jul 01 2014]

Extensions

Some terms corrected by Bruno Berselli, Jul 01 2014
Showing 1-3 of 3 results.