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-3 of 3 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

A070257 Fecundity of n sets a new record.

Original entry on oeis.org

1, 187, 3237326, 3515987, 22572473, 516675965, 516963965, 41863638649, 35632297938395
Offset: 1

Views

Author

Jason Earls, May 09 2002

Keywords

Comments

a(9) > 10^11. - Donovan Johnson, Jun 23 2011
a(10) > 2.75*10^14. - Giovanni Resta, Jun 04 2013

Crossrefs

Extensions

a(5)-a(7) from Donovan Johnson, Jul 29 2009
a(8) from Donovan Johnson, Jun 23 2011
a(9) from Giovanni Resta, Jun 04 2013

A337789 Numbers k such that trajectory of k under repeated calculation of fecundity (x -> A070562(x)) eventually reaches 0.

Original entry on oeis.org

0, 1, 5, 10, 15, 18, 20, 21, 22, 24, 27, 30, 35, 40, 42, 44, 46, 48, 50, 51, 55, 59, 60, 63, 64, 66, 67, 69, 70, 74, 75, 77, 80, 83, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 115, 118, 120, 121, 122, 124, 127
Offset: 1

Views

Author

Robert Bilinski, Sep 21 2020

Keywords

Examples

			5 is a term in the sequence because the fecundity of 5 is 1, the fecundity of 1 is 10 and the fecundity of 10 is 0.
7 is not a term in the sequence because the fecundity of 7 is 7 and therefore the fecundity will never become 0.
		

Crossrefs

Programs

  • Maple
    fec:= proc(n) local k, x,t;
      x:= n;
      for k from 0 do
        t:= convert(convert(x,base,10),`*`);
        if t = 0 then return k fi;
        x:= x+t
      od
    end proc:
    filter:= proc(n) local v; option remember;
        v:= fec(n);
        if v = 0 then true
        elif v = n then false
        else procname(v)
        fi
    end proc:
    select(filter, [$0..1000]); # Robert Israel, Apr 12 2021
  • Mathematica
    fec[n_] := Length @ FixedPointList[# + Times @@ IntegerDigits[#] &, n] - 2; Select[Range[0, 100], FixedPoint[fec, #] == 0 &] (* Amiram Eldar, Sep 22 2020 *)
  • Python
    from math import prod
    from functools import lru_cache
    def pd(n): return prod(map(int, str(n)))
    def A070562(n):
      s = 0
      while pd(n) != 0: n, s = n + pd(n), s + 1
      return s
    @lru_cache(maxsize=None)
    def ok(n):
      fn = A070562(n)
      if fn == 0: return True
      if fn == n: return False
      return ok(fn)
    print(list(filter(ok, range(128)))) # Michael S. Branicky, Apr 12 2021

Extensions

More terms from Amiram Eldar, Sep 22 2020
Offset changed by Robert Israel, Apr 12 2021
Showing 1-3 of 3 results.