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-10 of 13 results. Next

A007954 Product of decimal digits of n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 0, 3, 6, 9, 12, 15, 18, 21, 24, 27, 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 0, 6, 12, 18, 24, 30, 36, 42, 48, 54, 0, 7, 14, 21, 28, 35, 42, 49, 56, 63, 0, 8, 16, 24, 32, 40, 48, 56, 64, 72, 0, 9, 18, 27, 36, 45, 54, 63, 72, 81, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0

Views

Author

R. Muller

Keywords

Comments

Moebius transform of A093811(n). a(n) = A093811(n) * A008683(n), where operation * denotes Dirichlet convolution, namely b(n) * c(n) = Sum_{d|n} b(d) * c(n/d). Simultaneously holds Dirichlet multiplication: a(n) * A000012(n) = A093811(n). - Jaroslav Krizek, Mar 22 2009
Apart from the 0's, all terms are in A002473. Further, for all m in A002473 there is some n such that a(n) = m, see A096867. - Charles R Greathouse IV, Sep 29 2013
a(n) = 0 asymptotically almost surely, namely for all n except for the set of numbers without digit '0'; this set is of density zero, since it is less and less probable to have no '0' as the number of digits of n grows. (See also A054054.) - M. F. Hasler, Oct 11 2015

Crossrefs

Cf. A031347 (different from A035930), A007953, A007602, A010888, A093811, A008683, A000012, A061076 (partial sums), A230099.
Cf. A051802 (ignoring zeros).

Programs

  • Haskell
    a007954 n | n < 10 = n
              | otherwise = m * a007954 n' where (n', m) = divMod n 10
    -- Reinhard Zumkeller, Oct 26 2012, Mar 14 2011
    
  • Magma
    [0] cat [&*Intseq(n): n in [1..110]]; // Vincenzo Librandi, Jan 03 2020
    
  • Maple
    A007954 := proc(n::integer)
        if n = 0 then
            0;
        else
            mul( d,d=convert(n,base,10)) ;
        end if;
    end proc: # R. J. Mathar, Oct 02 2019
  • Mathematica
    Array[Times @@ IntegerDigits@ # &, 108, 0] (* Robert G. Wilson v, Mar 15 2011 *)
  • PARI
    A007954(n)= { local(resul = n % 10); n \= 10; while( n > 0, resul *= n %10; n \= 10; ); return(resul); } \\ R. J. Mathar, May 23 2006, edited by M. F. Hasler, Apr 23 2015
    
  • PARI
    A007954(n)=prod(i=1,#n=Vecsmall(Str(n)),n[i]-48) \\ (...eval(Vec(...)),n[i]) is about 50% slower; (...digits(n)...) about 6% slower. \\ M. F. Hasler, Dec 06 2009
    
  • PARI
    a(n)=if(n,factorback(digits(n)),0) \\ Charles R Greathouse IV, Apr 14 2020
    
  • Python
    from math import prod
    def a(n): return prod(map(int, str(n)))
    print([a(n) for n in range(108)]) # Michael S. Branicky, Jan 16 2022
  • Scala
    (0 to 99).map(.toString.toCharArray.map( - 48).scanRight(1)( * ).head) // Alonso del Arte, Apr 14 2020
    

Formula

A000035(a(A014261(n))) = 1. - Reinhard Zumkeller, Nov 30 2007
a(n) = abs(A187844(n)). - Reinhard Zumkeller, Mar 14 2011
a(n) > 0 if and only if A054054(n) > 0. a(n) = d in {1, ..., 9} if n = (10^k - 1)/9 + (d - 1)*10^m = A002275(k) + (d - 1)*A011557(m) for some k > m >= 0. The statement holds with "if and only if" for d in {1, 2, 3, 5, 7}. For d = 4, 6, 8 or 9, one has a(n) = d if n = (10^k - 1)/9 + (a - 1)*10^m + (b - 1)*10^p with integers k > m > p >= 0 and a, b > 0 such that d = a*b. - M. F. Hasler, Oct 11 2015
From Robert Israel, May 17 2016: (Start)
G.f.: Sum_{n >= 0} Product_{j = 0..n} Sum_{k = 1..9} k*x^(k*10^j).
G.f. satisfies A(x) = (x + 2*x^2 + ... + 9*x^9)*(1 + A(x^10)). (End)
a(n) <= 9^(1 + log_10(n/9)). - Lucas A. Brown, Jun 22 2023

Extensions

Error in term 25 corrected, Nov 15 1995

A230103 Number of m such that m + (product of digits of m) equals n.

Original entry on oeis.org

1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 0, 1, 1, 1, 0, 2, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 2, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 3, 0, 0, 0, 1, 1, 1, 0, 1, 0, 2, 0, 2, 0, 0, 1, 1, 1, 1, 0, 2, 0, 0, 0, 2, 1, 0, 0, 1, 0, 3, 1, 0, 0, 0, 1, 2, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 2, 0, 2, 1, 3
Offset: 0

Views

Author

N. J. A. Sloane, Oct 13 2013

Keywords

Comments

Number of times n appears in A230099.

Crossrefs

Programs

  • Maple
    # Maple code for A230099, A230103, A230104, A230105
    with(LinearAlgebra):
    read transforms; # to get digprod
    M:=1000;
    lis1:=Array(0..M);
    lis2:=Array(0..M);
    ctmax:=4;
    for i from 0 to ctmax do ct[i]:=Array(0..M); od:
    for n from 0 to M do
    m:=n+digprod(n);
    lis1[n]:=m;
    if (m <= M) then lis2[m]:=lis2[m]+1; fi;
    od:
    t1:=[seq(lis1[i],i=0..M)]; # A230099
    t2:=[seq(lis2[i],i=0..M)]; # A230103
    COMPl(t1); # A230104
    for i from 1 to M do h:=lis2[i];
    if h <= ctmax then ct[h]:=[op(ct[h]),i]; fi; od:
    len:=nops(ct[0]); [seq(ct[0][i],i=1..len)]; # A230104 again
    len:=nops(ct[1]); [seq(ct[1][i],i=1..len)]; # A230105
  • PARI
    a(n) = if (n==0, return(1)); sum(k=1, n, k+vecprod(digits(k)) == n); \\ Michel Marcus, Sep 18 2020
    
  • Python
    from math import prod
    def b(n): return n + prod(map(int, str(n)))
    def a(n): return sum(1 for m in range(n+1) if b(m) == n)
    print([a(n) for n in range(103)]) # Michael S. Branicky, Jan 09 2023
    
  • Python
    # faster version for initial segment of sequence
    from math import prod
    from collections import Counter
    def b(n): return n + prod(map(int, str(n)))
    def aupto(n):
        c = Counter(b(m) for m in range(n+1))
        return [c[k] for k in range(n+1)]
    print(aupto(102)) # Michael S. Branicky, Jan 09 2023

A230104 Numbers k such that m + (product of digits of m) is never equal to k.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 25, 27, 31, 33, 36, 37, 39, 43, 48, 49, 51, 52, 53, 57, 59, 61, 63, 64, 69, 71, 72, 73, 76, 77, 79, 82, 83, 84, 87, 91, 93, 96, 97, 99, 111, 113, 115, 117, 119, 121, 127, 131, 133, 136, 137, 139, 148, 149, 151, 153, 157, 159, 163, 164, 169, 171, 172, 173, 176, 177, 179, 182, 183
Offset: 1

Views

Author

N. J. A. Sloane, Oct 13 2013

Keywords

Comments

Numbers missing from A230099.

Crossrefs

Programs

  • PARI
    f(n) = if (n, n + vecprod(digits(n)), 0); \\ A230104
    isok(m) = for(i=1, m, if (f(i) == m, return(0))); return(1); \\ Michel Marcus, Jan 09 2023
    
  • Python
    from math import prod
    def b(n): return n + prod(map(int, str(n)))
    def aupto(n): return sorted(set(range(n+1)) - set(b(m) for m in range(n+1)))
    print(aupto(183)) # Michael S. Branicky, Jan 09 2023

A337718 Numbers that can be written as (m + product of digits of m) for some m.

Original entry on oeis.org

0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 23, 24, 26, 28, 29, 30, 32, 34, 35, 38, 40, 41, 42, 44, 45, 46, 47, 50, 54, 55, 56, 58, 60, 62, 65, 66, 67, 68, 70, 74, 75, 78, 80, 81, 85, 86, 88, 89, 90, 92, 94, 95, 98, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109
Offset: 1

Views

Author

Bernard Schott, Sep 16 2020

Keywords

Comments

Every integer that contains a digit 0 is a term (A011540).
When R_m with m >= 1 is in A002275, then R_m + 1 is a term (A047855 \ {1}).
Near similar:
-> Not-Colombian (A176995) are numbers that can be written as (m + sum of digits of m) for some m.
-> Bogotá numbers (A336826) are numbers that can be written as (m * product of digits of m) for some m.

Examples

			10 = 5 + 5 = 10 + (1*0) and 22 = 16 + (1*6) are terms.
		

Crossrefs

Subsequences: A011540, A047855 \ {1}.
Range of A230099.
Cf. A176995 (not Colombian), A336826 (Bogotá numbers).

Programs

  • Mathematica
    m = 100; Select[Union[Table[n + Times @@ IntegerDigits[n], {n, 0, m}]], # <= m &] (* Amiram Eldar, Sep 16 2020 *)
  • PARI
    isok(m) = {if (m==0, return (1)); for (k=1, m,  if (k+vecprod(digits(k)) == m, return (1)););} \\ Michel Marcus, Sep 17 2020
    
  • Python
    from math import prod
    def b(n): return n + prod(map(int, str(n)))
    def aupto(n): return sorted(set(b(m) for m in range(n+1) if b(m) <= n))
    print(aupto(109)) # Michael S. Branicky, Jan 09 2023

A066567 Numbers that when incremented by the product of their digits produce a square.

Original entry on oeis.org

2, 8, 13, 63, 91, 100, 128, 185, 215, 221, 337, 400, 448, 456, 549, 551, 559, 681, 900, 1024, 1089, 1151, 1185, 1215, 1221, 1327, 1348, 1437, 1600, 1651, 1897, 2025, 2112, 2191, 2196, 2209, 2293, 2304, 2392, 2401, 2448, 2500, 2539, 2544, 2551, 2596, 2601
Offset: 1

Views

Author

Amarnath Murthy, Dec 18 2001

Keywords

Examples

			63 belongs to this sequence as 63 + 6*3 = 81 = 9^2.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := n + Apply[ Times, IntegerDigits[n]]; Select[ Range[ 2500], IntegerQ[ Sqrt[ f[ # ]]] & ]
    Select[Range[3000],IntegerQ[Sqrt[#+Times@@IntegerDigits[#]]]&] (* Harvey P. Dale, Sep 15 2024 *)
  • PARI
    isok(k) = issquare(k+vecprod(digits(k))); \\ Harry J. Smith, Mar 05 2010

Extensions

More terms from Robert G. Wilson v, Dec 22 2001
Offset changed from 0 to 1 by Harry J. Smith, Mar 05 2010

A230102 a(0)=1; thereafter a(n+1) = a(n) + (product of digits of a(n)).

Original entry on oeis.org

1, 2, 4, 8, 16, 22, 26, 38, 62, 74, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102
Offset: 0

Views

Author

N. J. A. Sloane, Oct 12 2013

Keywords

Comments

Never gets above 102.

Crossrefs

Programs

  • Haskell
    a230102 n = a230102_list !! n
    a230102_list = iterate a230099 1  -- Reinhard Zumkeller, Oct 13 2013
  • Mathematica
    NestList[#+Times@@IntegerDigits[#]&,1,50] (* Harvey P. Dale, Jul 30 2023 *)

A230105 Numbers n such that m + (product of digits of m) = n has exactly one solution m.

Original entry on oeis.org

0, 2, 4, 6, 8, 22, 23, 24, 28, 29, 30, 32, 34, 35, 40, 41, 42, 44, 45, 46, 47, 54, 55, 56, 58, 65, 66, 67, 68, 75, 78, 81, 85, 88, 89, 90, 92, 94, 95, 101, 103, 105, 106, 108, 112, 114, 122, 124, 125, 128, 129, 132, 135, 141, 143, 144, 145, 146, 147, 152, 154, 155, 156, 158, 161, 165, 166, 167, 168, 175, 178, 181, 185
Offset: 1

Views

Author

N. J. A. Sloane, Oct 13 2013

Keywords

Comments

Numbers n such that A230103(n) = 1.

Crossrefs

Programs

  • Python
    from math import prod
    from collections import Counter
    def b(n): return n + prod(map(int, str(n)))
    def aupto(n):
        c = Counter(b(m) for m in range(n+1))
        return [k for k in range(n+1) if c[k] == 1]
    print(aupto(185)) # Michael S. Branicky, Jan 09 2023

A009101 Fixed point when iterating the function f on n, where f(x) = x + product of digits of x.

Original entry on oeis.org

0, 102, 102, 102, 102, 10, 102, 102, 102, 102, 10, 102, 102, 102, 102, 20, 102, 102, 102, 60, 20, 110, 102, 110, 102, 50, 102, 140, 60, 110, 30, 70, 102, 50, 70, 50, 102, 170, 102, 102, 40, 140, 50, 80, 60, 140, 70, 110, 80, 150, 50, 170, 102, 202, 102, 80, 170, 110, 170
Offset: 0

Views

Author

Keywords

Comments

Starting at n and iterating f, a(n) is the first number reached that contains the digit zero.
Record values of the number of steps to obtain a(n) are 10 for n = 1, 27 for n = 187, 28 for n = 3237326, 32 for n = 3515987, 33 for n = 22572473. It is conjectured that a(n) is obtained in a finite number of steps for every n.
Comment from Adam Kabela, Nov 19 2013: (Start)
The number of steps is finite for every n. The idea is for large k, 9^k < 10^(k-1). The x+f(x) is not increasing fast enough. At some point for high k, in one step the first digit is increased by at most 1. But 9+1= 10. Hence a zero appears sooner or later for every starting x. (The idea is mentioned for example in the XKCD Forum, see link below.) The argument holds not just in base 10 but in other bases too. (End)
Comment from N. J. A. Sloane, Nov 19 2013: (Start)
The XKCD Forum mentioned by Kabela says "If it is unbounded, then there is a first element in the sequence above 10^n for any n. The previous number had n digits, so the digit product that was added to get above 10^n is at most 9^n. Therefore the current number is at most 10^n+9^n. For n>21, this number begins with the digits "10", so from then on the product of the digits is zero and the sequence no longer increases." (End)

Examples

			f(5) = 10, f(10) = 10, hence a(5) = 10.
f(19) = 28, f(28) = 44, f(44) = 60, f(60) = 60, hence a(19) = 60.
		

Crossrefs

Cf. A007954 (product of digits of n), A230099.

Programs

  • Maple
    a:= n-> (m-> `if`(m=0, n, a(n+m)))(mul(i, i=convert(n, base, 10))):
    seq(a(n), n=0..58);  # Alois P. Heinz, Jun 21 2022
  • Mathematica
    Table[FixedPoint[#+Times@@IntegerDigits[#]&,n],{n,0,60}] (* Harvey P. Dale, Oct 11 2012 *)
  • Python
    from math import prod
    def f(x): return x + prod(map(int, str(x)))
    def a(n):
        x, fx = n, f(n)
        while x != fx: x, fx = fx, f(fx)
        return x
    print([a(n) for n in range(60)]) # Michael S. Branicky, Jun 21 2022

Extensions

Additional comments from Klaus Brockhaus, Mar 12 2006
Edited by N. J. A. Sloane, Aug 19 2008 at the suggestion of R. J. Mathar

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

Original entry on oeis.org

0, 11, 10, 10, 9, 2, 9, 8, 8, 7, 1, 9, 8, 8, 7, 2, 7, 7, 6, 4, 1, 6, 6, 5, 6, 3, 5, 6, 3, 4, 1, 4, 5, 3, 3, 2, 4, 4, 4, 3, 1, 5, 2, 3, 2, 4, 2, 3, 2, 5, 1, 6, 4, 9, 3, 2, 5, 3, 3, 2, 1, 3, 3, 6, 6, 3, 2, 2, 8, 6, 1, 5, 5, 3, 2, 2, 7, 6, 4, 3, 1, 5, 3, 2, 8, 4, 4, 4, 5, 4, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1
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 the product of digits reaches 0; fecundity = number of steps - 1.
Equivalently, with A230099 = f, a(n) is the number k of distinct values that are obtained with iterations: n, f(n), f(f(n)), f(f(f(n))), ... until a term of this sequence contains a 0. - Bernard Schott, Jul 31 2023

Examples

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

Crossrefs

Programs

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

Formula

a(n) = 1 iff n positive is in A011540. - Bernard Schott, Jul 31 2023

Extensions

More terms from Robert G. Wilson v, Jun 27 2010

A230106 Number of m such that m + (product of nonzero digits of m) equals n.

Original entry on oeis.org

0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 2, 0, 2, 0, 2, 0, 2, 0, 1, 0, 2, 1, 1, 0, 2, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 2, 0, 0, 1, 1, 0, 2, 1, 1, 1, 0, 0, 2, 0, 0, 0, 1, 2, 1, 0, 1, 0, 1, 0, 2, 0, 0, 1, 2, 1, 1, 0, 1, 0, 0, 0, 2, 1, 0, 1, 1, 0, 2, 1, 0, 0, 0, 1, 2, 0, 2, 1, 0, 0, 1, 0, 1, 1, 0, 0, 2, 1, 1, 1, 3
Offset: 0

Views

Author

N. J. A. Sloane, Oct 13 2013

Keywords

Comments

Number of times n appears in A063114.

Crossrefs

Programs

  • Maple
    # Maple code for A063114, A230106, A063425, A096922
    with(LinearAlgebra):
    read transforms; # to get digprod0
    M:=1000;
    lis1:=Array(0..M);
    lis2:=Array(0..M);
    ctmax:=4;
    for i from 0 to ctmax do ct[i]:=Array(0..M); od:
    for n from 0 to M do
    m:=n+digprod0(n);
    lis1[n]:=m;
    if (m <= M) then lis2[m]:=lis2[m]+1; fi;
    od:
    t1:=[seq(lis1[i],i=0..M)]; # A063114
    t2:=[seq(lis2[i],i=0..M)]; # A230106
    COMPl(t1); # A063425
    for i from 1 to M do h:=lis2[i];
    if h <= ctmax then ct[h]:=[op(ct[h]),i]; fi; od:
    len:=nops(ct[0]); [seq(ct[0][i],i=1..len)]; # A063425 again
    len:=nops(ct[1]); [seq(ct[1][i],i=1..len)]; # A096922

Extensions

a(1) corrected by Zak Seidov, Oct 24 2013
Showing 1-10 of 13 results. Next