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.

A002217 Starting with n, repeatedly calculate the sum of prime factors (with repetition) of the previous term, until reaching 0 or a fixed point: a(n) is the number of terms in the resulting sequence.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			20 -> 2+2+5 = 9 -> 3+3 = 6 -> 2+3 = 5, so a(20) = length of sequence {20,9,6,5} = 4.
		

References

  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A001414 (sum of prime factors of n), A029908 (fixed point that is reached).

Programs

  • Mathematica
    sopfr[n_] := Times @@@ FactorInteger[n] // Total;
    a[1] = 2; a[n_] := Length[ FixedPointList[sopfr, n]] - 1;
    Array[a, 105] (* Jean-François Alcover, Feb 09 2018 *)

Extensions

More terms and better description from Reinhard Zumkeller, Apr 08 2003
Incorrect comment removed by Harvey P. Dale, Aug 16 2011