login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A214587
Greatest common divisor of a number and its last decimal digit: a(n) = gcd(n, n mod 10).
2
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,3
EXAMPLE
a(69) = gcd(69,9) = 3.
MATHEMATICA
Table[GCD[n, Mod[n, 10]], {n, 0, 100}] (* T. D. Noe, Jul 24 2012 *)
PROG
(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());
}
}
}
CROSSREFS
Cf. A068822.
Sequence in context: A278946 A322629 A190599 * A365762 A010889 A053831
KEYWORD
nonn,base
AUTHOR
Alex Ratushnyak, Jul 22 2012
STATUS
approved