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.

A377643 a(n) is the number of terms in the trajectory when the map x -> 2+sopfr(x) is iterated, starting from x = n until x = 8, with sopfr = A001414.

Original entry on oeis.org

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

Views

Author

Rafik Khalfi, Nov 03 2024

Keywords

Examples

			For n=1, the trajectory from n down to 8 comprises a(1) = 7 terms: 1 -> 2 -> 4 -> 6 -> 7 -> 9 -> 8.
		

Crossrefs

Cf. A001414 (sopfr).

Programs

  • Maple
    f := proc(n)
      add(op(1, i) * op(2, i), i = ifactors(n)[2]):
    end proc:
    g := proc(n)
      2 + f(n):
    end proc:
    A377643 := proc(n)
    local k, result:
     k := 1:
    result := n:
    while result <> 8 do
    result := g(result):
    k := k + 1:
    end do:
    k:
    end proc:
    A377643(8) := 1:
    map(A377643, [$1..100]);
  • Mathematica
    s[n_] := 2 + Plus @@ Times @@@ FactorInteger[n]; s[1] = 2; a[n_] := Length@ NestWhileList[s, n, # != 8 &]; Array[a, 100] (* Amiram Eldar, Nov 07 2024 *)