login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A052423 Highest common factor of nonzero digits of n. 4

%I

%S 1,2,3,4,5,6,7,8,9,1,1,1,1,1,1,1,1,1,1,2,1,2,1,2,1,2,1,2,1,3,1,1,3,1,

%T 1,3,1,1,3,4,1,2,1,4,1,2,1,4,1,5,1,1,1,1,5,1,1,1,1,6,1,2,3,2,1,6,1,2,

%U 3,7,1,1,1,1,1,1,7,1,1,8,1,2,1,4,1,2,1,8,1,9,1,1,3,1,1,3,1,1,9,1,1,1

%N Highest common factor of nonzero digits of n.

%C a(A069715(n)) = 1. - _Reinhard Zumkeller_, Apr 14 2014

%H Reinhard Zumkeller, <a href="/A052423/b052423.txt">Table of n, a(n) for n = 1..10000</a>

%e a(46)=2 because highest common factor of 4 and 6 is 2.

%o (PARI) a(n) = {digs = digits(n, 10); hcf = digs[1]; for (i = 2, #digs, if (digs[i], hcf = gcd(hcf, digs[i]));); return (hcf);} \\ _Michel Marcus_, Jul 27 2013

%o (Haskell)

%o a052423 n = f n n where

%o f x 1 = 1

%o f x y | x < 10 = gcd x y

%o | otherwise = if d == 1 then 1 else f x' (gcd d y)

%o where (x', d) = divMod x 10

%o -- _Reinhard Zumkeller_, Apr 14 2014

%Y Cf. A007954.

%K base,easy,nonn

%O 1,2

%A _Henry Bottomley_, Mar 17 2000

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified November 13 17:34 EST 2019. Contains 329106 sequences. (Running on oeis4.)