login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A109004 Table of gcd(n,m) read by antidiagonals, n >= 0, m >= 0. 24
0, 1, 1, 2, 1, 2, 3, 1, 1, 3, 4, 1, 2, 1, 4, 5, 1, 1, 1, 1, 5, 6, 1, 2, 3, 2, 1, 6, 7, 1, 1, 1, 1, 1, 1, 7, 8, 1, 2, 1, 4, 1, 2, 1, 8, 9, 1, 1, 3, 1, 1, 3, 1, 1, 9, 10, 1, 2, 1, 2, 5, 2, 1, 2, 1, 10, 11, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 11, 12, 1, 2, 3, 4, 1, 6, 1, 4, 3, 2, 1, 12, 13, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 13 (list; table; graph; refs; listen; history; text; internal format)
OFFSET
0,4
REFERENCES
L. E. Dickson, History of the Theory of Numbers. Carnegie Institute Public. 256, Washington, DC, Vol. 1, 1919; Vol. 2, 1920; Vol. 3, 1923, see vol. 1, p. 335.
R. L. Graham, D. E. Knuth and O. Patashnik, Concrete Mathematics, Addison-Wesley, 2nd ed., 1994, ch. 4.
D. E. Knuth, The Art of Computer Programming, Addison-Wesley, section 4. 5. 2
LINKS
Marcelo Polezzi, A Geometrical Method for Finding an Explicit Formula for the Greatest Common Divisor, The American Mathematical Monthly, Vol. 104, No. 5 (May, 1997), pp. 445-446.
FORMULA
a(n, m) = a(m, n) = a(m, n-m) = a(m, n mod m), n >= m.
a(n, m) = n + m - n*m + 2*Sum_{k=1..m-1} floor(k*n/m).
Multiplicative in both parameters with a(p^e, m) = gcd(p^e, m). - David W. Wilson, Jun 12 2005
EXAMPLE
0;
1, 1;
2, 1, 2;
3, 1, 1, 3;
4, 1, 2, 1, 4;
5, 1, 1, 1, 1, 5;
6, 1, 2, 3, 2, 1, 6;
...
MATHEMATICA
a[n_, m_] := GCD[n, m]; Table[a[n - m, m], {n, 0, 10}, {m, 0, n}]//Flatten (* G. C. Greubel, Jan 04 2018 *)
PROG
(PARI) {a(n, m) = gcd( n, m)}
(PARI) {a(n, m) = local(x); n = abs(n); m = abs(m); if( !m, n, -2 * sum( k=1, m, x = k * n / m; x - floor( x) - 1/2))} /* Michael Somos, May 22 2011 */
CROSSREFS
Rows, columns and diagonals: A089128, A109007, A109008, A109009, A109010, A109011, A109012, A109013, A109014, A109015.
A003989 is (1, 1) based.
Sequence in context: A137152 A328902 A159335 * A103823 A355246 A136642
KEYWORD
nonn,easy,mult,tabl
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 18 22:56 EDT 2024. Contains 370952 sequences. (Running on oeis4.)