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.

Showing 1-2 of 2 results.

A070562 Fecundity of n.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, May 07 2002

Keywords

Comments

Start with x=n, repeatedly replace x by x + product of digits of x until the product is 0; fecundity = number of steps. a(0) = 0 by convention.

Examples

			1 -> 2 -> 4 -> 8 -> 16 -> 22 -> 26 -> 38 -> 62 -> 74 -> 102 has fecundity 10.
		

References

  • P. Tougne, Jeux Mathematiques column, Pour La Science (French edition of "Scientific American"), Vol. 82, Aug. 1984, Prob. 6, pp. 101, 104.

Crossrefs

Programs

  • Mathematica
    f[ n_ ] := Block[ {a=n,b,c=0}, While[ b=Times@@IntegerDigits[ a ]; b>0, a=a+b; c++ ]; c ]; f[ 0 ]=0; Table[ f[ n ], {n,0,100} ]
    f[n_] := Length@ FixedPointList[ # + Times @@ IntegerDigits@# &, n] - 2; Array[f, 105, 0] (* Robert G. Wilson v, Jun 27 2010 *)
  • PARI
    prodig(n) = local(s, d); if(n==0, s=0, s=1; while(n>0, d=divrem(n, 10); n=d[1 ]; s=s*d[2 ])); s for(n=0, 92, x=n; c=0; while((d=prodig(x))!=0, c++; x=x+d); print1(c, ", "))

Extensions

Edited and extended by Klaus Brockhaus, May 08 2002
Clarified the definition of fecundity and improved the Mathematica program. - T. D. Noe, Oct 06 2008
More terms from Robert G. Wilson v, Jun 27 2010

A070560 a(0) = 1; for n > 0, a(n) = (fecundity of n) + 2.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, May 07 2002

Keywords

Comments

Start with n, repeatedly replace x by x + product of digits of x until reach 0; fecundity = number of steps - 1.

Examples

			1 -> 2 -> 4 -> 8 -> 16 -> 22 -> 26 -> 38 -> 62 -> 74 -> 102 -> 0 has fecundity 10.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Length@ FixedPointList[ # + Times @@ IntegerDigits@# &, n]; f[0] = 1; Array[f, 105, 0] (* Robert G. Wilson v, Jun 27 2010 *)

Extensions

More terms from Robert G. Wilson v, Jun 27 2010
Showing 1-2 of 2 results.