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.

A214587 Greatest common divisor of a number and its last decimal digit: a(n) = gcd(n, n mod 10).

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1, 2, 1, 2, 5, 2, 1, 2, 1, 20, 1, 2, 1, 4, 5, 2, 1, 4, 1, 30, 1, 2, 3, 2, 5, 6, 1, 2, 3, 40, 1, 2, 1, 4, 5, 2, 1, 8, 1, 50, 1, 2, 1, 2, 5, 2, 1, 2, 1, 60, 1, 2, 3, 4, 5, 6, 1, 4, 3, 70, 1, 2, 1, 2, 5, 2, 7, 2, 1, 80, 1, 2, 1, 4, 5
Offset: 0

Views

Author

Alex Ratushnyak, Jul 22 2012

Keywords

Examples

			a(69) = gcd(69,9) = 3.
		

Crossrefs

Cf. A068822.

Programs

  • Java
    import java.math.BigInteger;
    public class A214587 {
      public static void main (String[] args) {
        for (long n=0; n<222; n++) {
        BigInteger bn=BigInteger.valueOf(n), ld=BigInteger.valueOf(n%10);
        System.out.printf("%s, ", bn.gcd(ld).toString());
        }
      }
    }
  • Mathematica
    Table[GCD[n, Mod[n, 10]], {n, 0, 100}] (* T. D. Noe, Jul 24 2012 *)