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.

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