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.

Showing 1-1 of 1 results.

A365762 Greatest common divisor of n and the product of its digits.

Original entry on oeis.org

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

Views

Author

Simon R Blow, Sep 18 2023

Keywords

Comments

This sequence will contain all numbers whose prime factors are exclusively <10 (7-smooth numbers, A002473).

Examples

			a(11)=1 as 1*1=1; 11 and 1 share 1 as a gcd.
a(15)=5 as 1*5=5; 15 and 5 share 5 as a gcd.
a(10)=10 as 1*0=0; 10 and 0 share 10 as a gcd.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=GCD[n,Product[Part[IntegerDigits[n],i],{i,IntegerLength[n]}]]; Array[a,100] (* Stefano Spezia, Sep 20 2023 *)
  • PARI
    a(n) = gcd(n, vecprod(digits(n))); \\ Michel Marcus, Sep 20 2023
  • Python
    from math import gcd, prod
    def a(n): return gcd(n, prod(map(int, str(n))))
    print([a(n) for n in range(1, 101)])
    
Showing 1-1 of 1 results.