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.

A306354 a(n) = gcd(n, A101337(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, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 3, 1, 1, 3, 1, 1, 9, 1, 1, 3, 8, 1, 2, 1, 4, 1, 2, 1, 16, 1, 25, 1, 1, 1, 1, 5, 1, 1, 1, 1, 12, 1, 2, 9, 4, 1, 6, 1, 4, 3, 7, 1, 1, 1, 1, 1, 1, 7, 1, 1, 16, 1, 2, 1, 4, 1, 2, 1, 8, 1, 9
Offset: 1

Views

Author

Ctibor O. Zizka, Feb 09 2019

Keywords

Comments

A101337(n) / n = r, r an integer, gives A306360. A101337(n) / n = 1 gives A005188. n / A101337(n) = s, s an integer, gives A306361. The motivation for this sequence was the question as to which numbers n have the property A101337(n) / n = r and the property n / A101337(n) = s?

Examples

			For n = 24, a(24) = gcd(24, 2*2 + 4*4) = gcd(24,20) = 4, thus a(24) = 4;
for n = 153, a(153) = gcd(153, 1*1*1 + 5*5*5 + 3*3*3) = gcd(153,153) = 153, thus a(153) = 153.
		

Crossrefs

Programs

  • Mathematica
    Array[GCD[#1, Total[#2^Length[#2]]] & @@ {#, IntegerDigits@ #} &, 90] (* Michael De Vlieger, Feb 09 2019 *)
  • PARI
    a(n) = my(d=digits(n)); gcd(n, sum(i=1, #d, d[i]^#d)); \\ Michel Marcus, Feb 12 2019
    
  • Python
    from math import gcd
    def A306354(n): return gcd(n,sum(int(d)**len(str(n)) for d in str(n))) # Chai Wah Wu, Jan 26 2022

A081653 Greatest common divisor of sums of decimal digits of n and of n-th prime.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 4, 1, 1, 1, 2, 1, 2, 1, 1, 2, 5, 1, 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 7, 1, 1, 2, 11, 1, 1, 2, 1, 1, 2, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 16, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 5, 1
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 25 2003

Keywords

Examples

			a(8) = GCD(A007953(8), A007953(A000040(8))) = GCD(8, A007953(19)) = GCD(8,1+9) = GCD(4*2,5*2) = 2.
		

Crossrefs

Programs

Formula

a(n) = GCD(A007953(n), A007605(n)).

A081652 Greatest common divisor of n and sum of decimal digits of n-th prime.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 7, 1, 8, 1, 1, 1, 4, 1, 2, 1, 1, 1, 2, 1, 4, 1, 5, 1, 1, 11, 1, 7, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 11, 1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 8, 1, 1, 1, 4, 1, 2, 1, 8, 1, 2, 1, 10, 1, 17, 1, 4
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 25 2003

Keywords

Examples

			a(16) = GCD(16, A007953(A000040(16))) = GCD(16, A007953(53)) = GCD(16,5+3) = GCD(8*2,8) = 8.
		

Crossrefs

Programs

  • Mathematica
    Table[GCD[n,Total[IntegerDigits[Prime[n]]]],{n,110}] (* Harvey P. Dale, Jul 12 2012 *)

Formula

a(n) = GCD(n, A007605(n)).

A348192 a(0) = 0; for n >= 1, a(n) = 1 + a(n - GCD(n, digital sum(n))).

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 2, 3, 4, 3, 4, 5, 2, 3, 3, 3, 4, 5, 3, 4, 4, 3, 5, 6, 4, 5, 6, 5, 6, 7, 4, 5, 6, 5, 5, 6, 5, 6, 6, 5, 7, 8, 5, 6, 6, 6, 7, 8, 6, 7, 8, 7, 8, 9, 7, 8, 8, 7, 9, 10, 8, 9, 9, 9, 8, 9, 8, 9, 10, 9, 10, 9, 10, 11, 9, 9, 10, 11, 9, 10, 10, 10, 10, 11, 10, 11, 12, 11, 12, 13, 12, 13
Offset: 0

Views

Author

Ctibor O. Zizka, Jan 25 2022

Keywords

Comments

Number of steps needed to reach zero when starting from k = n and repeatedly applying the map that replaces k by k - A066750(k).

Examples

			n = 12, a(12) = 1 + a(12 - GCD(12,3)) = 1 + a(9) = 1 + 1 + a(9 - GCD(9,9)) = 2 + a(0) = 2.
		

Crossrefs

Programs

  • Mathematica
    a[0] = 0; a[n_] := a[n] = 1 + a[n - GCD[n, Plus @@ IntegerDigits[n]]]; Array[a, 100, 0] (* Amiram Eldar, Jan 25 2022 *)
  • Python
    from itertools import count, islice
    from math import gcd
    def A348192_gen(): # generator of terms
        blist = [0]
        yield 0
        for n in count(1):
            blist.append(1+blist[n-gcd(n,sum(int(d) for d in str(n)))])
            yield blist[-1]
    A348192_list = list(islice(A348192_gen(),30)) # Chai Wah Wu, Jan 26 2022

Formula

a(0) = 0; for n >= 1, a(n) = 1 + a(n - A066750(n)).

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