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.

User: Stefan Gog

Stefan Gog's wiki page.

Stefan Gog has authored 2 sequences.

A329983 For any n > 0, define the sequence b(1) = n, b(i+1) = (b(i) * i) mod (b(i) + i); a(n) is the least i such that b(i) = 0, or -1 if 0 is never reached.

Original entry on oeis.org

1, 13, 3, 85, 13, 85, 7, 58, 4, 13, 7, 85, 5, 7, 13, 58, 58, 85, 85, 13, 5, 85, 7, 291, 13, 85, 58, 85, 58, 7, 85, 291, 85, 85, 13, 58, 13, 58, 291, 11, 6, 58, 13, 7, 13, 85, 7, 291, 58, 85, 9, 85, 7, 13, 13, 58, 85, 13, 9, 58, 291, 291, 13, 11
Offset: 0

Author

Stefan Gog, Nov 26 2019

Keywords

Crossrefs

Cf. A308651.

Programs

  • PARI
    f(m, n) = (m*n) % (m+n);
    a(n) = {my(i=1); while (n, n = f(n, i); i++;); i;} \\ Michel Marcus, Nov 28 2019
  • Python
    def k(a,b):
        return ((a*b)%(a+b))
    numberList=[]
    def repeat(a):
        i=1
        while a!=0:
            a= k(a,i)
            i=i+1
        numberList.append(i)
    for x in range(10000):
        repeat(x)
    print(numberList)
    

A308651 a(n+1) = k(a(n), n), where k(m, n) = (m*n) mod (m+n) and with a(1) = 5.

Original entry on oeis.org

5, 5, 3, 3, 5, 5, 8, 11, 12, 3, 4, 14, 12, 6, 4, 3, 10, 8, 14, 2, 18, 27, 6, 22, 22, 33, 32, 38, 8, 10, 20, 8, 16, 38, 68, 11, 20, 56, 60, 63, 48, 10, 4, 31, 14, 40, 34, 59, 50, 74, 104, 34, 48, 19, 4, 43, 32, 44, 2, 57, 27, 63, 31, 73, 14, 41, 31, 19, 74, 101, 59, 29, 68, 29, 86, 10, 72, 31, 20, 95, 75, 147, 146, 210, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1

Author

Stefan Gog, Aug 23 2019

Keywords

Programs

  • Mathematica
    a[1] = 5; a[n_] := a[n] = Mod[a[n - 1] * (n - 1), a[n - 1] + n - 1]; Array[a, 100] (* Amiram Eldar, Aug 29 2019 *)
  • Python
    def k(a,b):
        return (a*b)%(a+b)
    a = [5]
    for n in range(1, 100):
        a.append(k(a[-1], n))
    print(a)

Formula

a(k) = 0 for k >= 85. - Jinyuan Wang, Aug 26 2019
5 is one of the first starting values that produces rather long sequence until collapses to zero.