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.

This page as a plain text file.
%I A349410 #57 Nov 18 2021 01:47:44
%S A349410 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,
%T A349410 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,
%U A349410 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
%N A349410 Length of cycle reached when iterating the mapping x-> n*A000005(x) on 1.
%F A349410 a(A000040(n)) = 1.
%e A349410 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.
%t A349410 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 *)
%o A349410 (Python)
%o A349410 from sympy import divisor_count
%o A349410 terms = []
%o A349410 for n in range(1, 101):
%o A349410     s, t = [1], True
%o A349410     while t:
%o A349410         for i in range(2, len(s)):
%o A349410             if s[-i] == s[-1]:
%o A349410                 t = False
%o A349410                 terms.append(i - 1)
%o A349410                 break
%o A349410         s.append(n*divisor_count(s[-1]))
%o A349410 print(terms) # _Gleb Ivanov_, Nov 17 2021
%o A349410 (PARI) f(n, x) = n*numdiv(x);
%o A349410 find(nm, v) = {forstep (n=#v-1, 1, -1, if (v[#v] == v[n], return(#v-n);););}
%o A349410 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
%Y A349410 Cf. A000005, A000040, A062011.
%K A349410 nonn
%O A349410 1,4
%A A349410 _Tejo Vrush_, Nov 16 2021