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-5 of 5 results.

A052423 Highest common factor of nonzero digits of n.

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Henry Bottomley, Mar 17 2000

Keywords

Examples

			a(46) = 2 because the highest common factor of 4 and 6 is 2.
a(47) = 1 because the highest common factor of 4 and 7 is 1.
		

Crossrefs

Cf. A007954.

Programs

  • Haskell
    a052423 n = f n n where
       f x 1 = 1
       f x y | x < 10    = gcd x y
             | otherwise = if d == 1 then 1 else f x' (gcd d y)
             where (x', d) = divMod x 10
    -- Reinhard Zumkeller, Apr 14 2014
    
  • Maple
    a:= n-> igcd(subs(0=[][], convert(n, base, 10))[]):
    seq(a(n), n=1..100);  # Alois P. Heinz, Apr 04 2020
  • Mathematica
    Table[Apply[GCD, IntegerDigits[n]], {n, 100}] (* Alonso del Arte, Apr 02 2020 *)
  • PARI
    a(n) = my(d=digits(n)); gcd(select(x->(x!=0), d)); \\ Michel Marcus, Apr 04 2020
  • Scala
    def euclGCD(a: Int, b: Int): Int = b match { case 0 => a; case n => Math.abs(euclGCD(b, a % b)) }
    def digitGCD(n: Int) = n.toString.toCharArray.map( - 48).scanLeft(0)(euclGCD(, _)).last
    (1 to 100).map(digitGCD()) // _Alonso del Arte, Apr 02 2020
    

Formula

a(A069715(n)) = 1. - Reinhard Zumkeller, Apr 14 2014

A248499 Numbers m that are coprime to A059995(m): floor(m/10).

Original entry on oeis.org

1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 27, 29, 31, 32, 34, 35, 37, 38, 41, 43, 45, 47, 49, 51, 52, 53, 54, 56, 57, 58, 59, 61, 65, 67, 71, 72, 73, 74, 75, 76, 78, 79, 81, 83, 85, 87, 89, 91, 92, 94, 95, 97, 98, 101, 103, 107, 109, 111, 112
Offset: 1

Views

Author

Stanislav Sykora, Oct 07 2014

Keywords

Comments

Definition of "being coprime" and special-case conventions are as in Wikipedia. In particular, when m < 10 then floor(m/10) = 0, and zero is coprime only to 1. The complementary sequence is A248500. Note: The first 57 terms a(n) coincide with A069715, but the two sequences are different.
The limit mean density of these numbers exists and equals 1223/2100 = A250031(10)/A250033(10). - Stanislav Sykora, Dec 08 2014

Examples

			1 is a term because gcd(1,0) = 1.
123 is not a term because gcd(123,12) = 3.
165 is a term because 165 and 16 are coprime.
		

Crossrefs

Programs

  • Mathematica
    Select[ Range@ 120, GCD[#, Floor[#/10]] == 1 &] (* Robert G. Wilson v, Oct 22 2014 *)
  • PARI
    a=vector(20000);
    i=n=0;while(i++,if(gcd(i,i\10)==1,a[n++]=i;if(n==#a,break)));a

Formula

{ m : gcd(m, floor(m/10)) = 1 }.

A240913 Numbers m such that GCD of digits of m is 1 and no digit of m is 1.

Original entry on oeis.org

23, 25, 27, 29, 32, 34, 35, 37, 38, 43, 45, 47, 49, 52, 53, 54, 56, 57, 58, 59, 65, 67, 72, 73, 74, 75, 76, 78, 79, 83, 85, 87, 89, 92, 94, 95, 97, 98, 203, 205, 207, 209, 223, 225, 227, 229, 230, 232, 233, 234, 235, 236, 237, 238, 239, 243, 245, 247, 249
Offset: 1

Views

Author

Reinhard Zumkeller, Apr 14 2014

Keywords

Comments

A052423(a(n)) = 1.

Crossrefs

Subsequence of A069715.

Programs

  • Haskell
    a240913 n = a240913_list !! (n-1)
    a240913_list = filter (not . elem '1' . show) a069715_list
    
  • Mathematica
    gcdQ[n_]:=Module[{idn=IntegerDigits[n]},!MemberQ[idn,1]&&GCD@@idn==1]; Select[ Range[300],gcdQ] (* Harvey P. Dale, Dec 17 2014 *)
  • PARI
    is(n)=my(d=Set(digits(n))); setsearch(d,1)==0 && gcd(d)==1 \\ Charles R Greathouse IV, Nov 01 2014

A350494 Divide n by the greatest common divisor of the nonzero digits of n.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 21, 11, 23, 12, 25, 13, 27, 14, 29, 10, 31, 32, 11, 34, 35, 12, 37, 38, 13, 10, 41, 21, 43, 11, 45, 23, 47, 12, 49, 10, 51, 52, 53, 54, 11, 56, 57, 58, 59, 10, 61, 31, 21, 32, 65, 11, 67
Offset: 1

Views

Author

Rémy Sigrist, Jan 01 2022

Keywords

Examples

			a(42) = 42 / gcd(4, 2) = 42 / 2 = 21.
		

Crossrefs

Programs

  • PARI
    a(n) = n / gcd(digits(n))
    
  • Python
    from math import gcd
    def a(n): return n//gcd(*[int(d) for d in str(n)])
    print([a(n) for n in range(1, 68)]) # Michael S. Branicky, Jan 01 2022

Formula

a(n) = n / A052423(n).
a(n) = n iff n belongs to A069715.
a(a(n)) = a(n).

A078453 Numbers in which all the digits are coprime to each other.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 23, 25, 27, 29, 31, 32, 34, 35, 37, 38, 41, 43, 45, 47, 49, 51, 52, 53, 54, 56, 57, 58, 59, 61, 65, 67, 71, 72, 73, 74, 75, 76, 78, 79, 81, 83, 85, 87, 89, 91, 92, 94, 95, 97, 98
Offset: 1

Views

Author

Amarnath Murthy, Nov 28 2002

Keywords

Crossrefs

Cf. A069715.

Programs

  • Mathematica
    Join[Range[0,9],Select[Range[10,98],GCD@@IntegerDigits[#]==1 &]] (* Stefano Spezia, Dec 23 2022 *)
  • Python
    from math import gcd
    from functools import reduce
    def ok(n):
        d = list(map(int, str(n)))
        return len(d) == 1 or reduce(gcd, d) == 1
    print([k for k in range(100) if ok(k)]) # Michael S. Branicky, Dec 23 2022
Showing 1-5 of 5 results.