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.

A349410 Length of cycle reached when iterating the mapping x-> n*A000005(x) on 1.

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 3, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 1, 4, 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 5, 1, 2, 4, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 4, 1, 2, 1, 2, 1, 2, 3, 3, 2, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 2, 2, 2, 1, 3, 1, 2, 1, 4, 2, 2, 1, 2, 1, 1, 2, 2, 1, 2, 2, 1, 1, 1, 3, 2
Offset: 1

Views

Author

Tejo Vrush, Nov 16 2021

Keywords

Examples

			For n = 9, 1 --> 9 --> 27 --> 36 --> 81 --> 45 --> 54 --> 72 --> 108 --> 108. The cycle reached has just one term: 108. Therefore, a(9) = 1.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{s = NestWhileList[n * DivisorSigma[0, #] &, 1, UnsameQ, All]}, Differences[Position[s, s[[-1]]]][[1, 1]]]; Array[a, 100] (* Amiram Eldar, Nov 17 2021 *)
  • PARI
    f(n, x) = n*numdiv(x);
    find(nm, v) = {forstep (n=#v-1, 1, -1, if (v[#v] == v[n], return(#v-n);););}
    a(n) = {my(list = List(), found=0, m=n); listput(list, m); while (! found, my(nm = f(n, m)); listput(list, nm); found = find(nm, list); m = nm;); found;} \\ Michel Marcus, Nov 17 2021
  • Python
    from sympy import divisor_count
    terms = []
    for n in range(1, 101):
        s, t = [1], True
        while t:
            for i in range(2, len(s)):
                if s[-i] == s[-1]:
                    t = False
                    terms.append(i - 1)
                    break
            s.append(n*divisor_count(s[-1]))
    print(terms) # Gleb Ivanov, Nov 17 2021
    

Formula

a(A000040(n)) = 1.