login
A244590
a(n) = sum( floor(k*n/8), k=1..7 ).
0
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,3
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.
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]
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 *)
PROG
(Magma) [&+[Floor(k*n/8): k in [1..7]]: n in [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
CROSSREFS
Cf. A109004.
Sequence in context: A344598 A058271 A332935 * A310770 A268816 A161843
KEYWORD
nonn,easy
AUTHOR
Gary Detlefs, Jun 30 2014
EXTENSIONS
Some terms corrected by Bruno Berselli, Jul 01 2014
STATUS
approved