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.

A374066 a(n) is the number of terms in the trajectory when the map x -> A067240(x) is iterated, starting from x = n until x = 0.

Original entry on oeis.org

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

Views

Author

Rafik Khalfi, Jun 27 2024

Keywords

Examples

			For n=11, the trajectory from n down to 0 comprises a(11) = 7 terms: 11 -> 10 -> 5 -> 4 -> 2 -> 1 -> 0.
		

Crossrefs

Programs

  • Maple
    f := proc(n)
        local e, j:
        e := ifactors(n)[2]:
        add((e[j][1] - 1) * e[j][1]^(e[j][2] - 1), j = 1 .. nops(e))
    end proc:
     A374066:= proc(n)
        local count, current:
        count := 1:
        current := n:
        while current <> 0 do
            current := f(current):
            count := count + 1
        end do:
        return count
    end proc:
    map(A374066, [$1..200]);
  • Mathematica
    f[p_, e_] := (p - 1)*p^(e - 1); s[n_] := s[n] = Plus @@ f @@@ FactorInteger[n]; a[n_] := Length[NestWhileList[s, n, # > 0 &]]; Array[a, 100] (* Amiram Eldar, Jun 27 2024 *)