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 72 results. Next

A031347 Multiplicative digital root of n (keep multiplying digits of n until reaching a single digit).

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, 0, 2, 4, 6, 8, 0, 3, 6, 9, 2, 5, 8, 2, 8, 4, 0, 4, 8, 2, 6, 0, 8, 6, 6, 8, 0, 5, 0, 5, 0, 0, 0, 5, 0, 0, 0, 6, 2, 8, 8, 0, 8, 8, 6, 0, 0, 7, 4, 2, 6, 5, 8, 8, 0, 8, 0, 8, 6, 8, 6, 0, 6
Offset: 0

Views

Author

Keywords

Comments

a(n) = 0 for almost all n. - Charles R Greathouse IV, Oct 02 2013
More precisely, a(n) = 0 asymptotically almost surely, namely, among others, for all numbers n which have a digit '0', and as n has more and more digits, it becomes increasingly less probable that no digit is equal to zero. (The set A011540 has density 1.) Thus the density of numbers for which a(n) > 0 is zero, although this happens for infinitely many numbers, for example all repunits n = (10^k - 1)/9 = A002275(k). - M. F. Hasler, Oct 11 2015

Crossrefs

Cf. A007954, A007953, A003001, A010888 (additive digital root of n), A031286 (additive persistence of n), A031346 (multiplicative persistence of n).
Numbers having multiplicative digital roots 0-9: A034048, A002275, A034049, A034050, A034051, A034052, A034053, A034054, A034055, A034056.

Programs

  • Haskell
    a031347 = until (< 10) a007954
    -- Reinhard Zumkeller, Oct 17 2011, Sep 22 2011
    
  • Maple
    A007954 := proc(n) return mul(d, d=convert(n,base,10)): end: A031347 := proc(n) local m: m:=n: while(length(m)>1)do m:=A007954(m): od: return m: end: seq(A031347(n),n=0..100); # Nathaniel Johnston, May 04 2011
  • Mathematica
    mdr[n_] := NestWhile[Times @@ IntegerDigits@# &, n, UnsameQ, All]; Table[ mdr[n], {n, 0, 104}] (* Robert G. Wilson v, Aug 04 2006 *)
    Table[NestWhile[Times@@IntegerDigits[#] &, n, # > 9 &], {n, 0, 90}] (* Harvey P. Dale, Mar 10 2019 *)
  • PARI
    A031347(n)=local(resul); if(n<10, return(n) ); resul = n % 10; n = (n - n%10)/10; while( n > 0, resul *= n %10; n = (n - n%10)/10; ); return(A031347(resul))
    for(n=1,80, print1(A031347(n),",")) \\ R. J. Mathar, May 23 2006
    
  • PARI
    A031347(n)={while(n>9,n=prod(i=1,#n=digits(n),n[i]));n} \\ M. F. Hasler, Dec 07 2014
    
  • Python
    from operator import mul
    from functools import reduce
    def A031347(n):
        while n > 9:
           n = reduce(mul, (int(d) for d in str(n)))
        return n
    # Chai Wah Wu, Aug 23 2014
    
  • Python
    from math import prod
    def A031347(n):
        while n > 9: n = prod(map(int, str(n)))
        return n
    print([A031347(n) for n in range(100)]) # Michael S. Branicky, Apr 17 2024
    
  • Scala
    def iterDigitProd(n: Int): Int = n.toString.length match {
      case 1 => n
      case  => iterDigitProd(n.toString.toCharArray.map( - 48).scanRight(1)( * ).head)
    }
    (0 to 99).map(iterDigitProd) // Alonso del Arte, Apr 11 2020

Formula

a(n) = d in {1, ..., 9} if (but not only if) n = (10^k - 1)/9 + (d - 1)*10^m = A002275(k) + (d - 1)*A011557(m) for some k > m >= 0. - M. F. Hasler, Oct 11 2015

A031346 Multiplicative persistence: number of iterations of "multiply digits" needed to reach a number < 10.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			For n = 999: A007954(999) = 729, A007954(729) = 126, A007954(126) = 12 and A007954(12) = 2. The fourth iteration of "multiply digits" yields a single-digit number, so a(999) = 4. - _Felix Fröhlich_, Jul 17 2016
		

References

  • M. Gardner, Fractal Music, Hypercards and More Mathematical Recreations from Scientific American, Persistence of Numbers, pp. 120-1; 186-7, W. H. Freeman NY 1992.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 35.

Crossrefs

Cf. A007954 (product of decimal digits of n).
Cf. A010888 (additive digital root of n).
Cf. A031286 (additive persistence of n).
Cf. A031347 (multiplicative digital root of n).
Cf. A263131 (ordinal transform).
Cf. A003001.

Programs

  • Magma
    f:=func; a:=[]; for n in [0..100] do s:=0; k:=n; while k ge 10 do s:=s+1; k:=f(k); end while; Append(~a,s); end for; a; // Marius A. Burtea, Jan 12 2020
  • Maple
    A007954 := proc(n) return mul(d, d=convert(n, base, 10)): end: A031346 := proc(n) local k,m: k:=0:m:=n: while(length(m)>1)do m:=A007954(m):k:=k+1: od: return k: end: seq(A031346(n),n=0..100); # Nathaniel Johnston, May 04 2011
  • Mathematica
    Table[Length[NestWhileList[Times@@IntegerDigits[#]&,n,#>=10&]],{n,0,100}]-1 (* Harvey P. Dale, Aug 27 2016 *)
  • PARI
    a007954(n) = my(d=digits(n)); prod(i=1, #d, d[i])
    a(n) = my(k=n, i=0); while(#Str(k) > 1, k=a007954(k); i++); i \\ Felix Fröhlich, Jul 17 2016
    
  • Python
    from operator import mul
    from functools import reduce
    def A031346(n):
        mp = 0
        while n > 9:
            n = reduce(mul, (int(d) for d in str(n)))
            mp += 1
        return mp
    # Chai Wah Wu, Aug 23 2014
    

Formula

Probably bounded, see A003001. - Charles R Greathouse IV, Nov 15 2022

A133500 The powertrain or power train map: Powertrain(n): if abcd... is the decimal expansion of a number n, then the powertrain of n is the number n' = a^b*c^d* ..., which ends in an exponent or a base according as the number of digits is even or odd. a(0) = 0 by convention.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1, 3, 9, 27, 81, 243, 729, 2187, 6561, 19683, 1, 4, 16, 64, 256, 1024, 4096, 16384, 65536, 262144, 1, 5, 25, 125, 625, 3125, 15625, 78125, 390625, 1953125, 1, 6, 36, 216, 1296
Offset: 0

Views

Author

J. H. Conway, Dec 03 2007

Keywords

Comments

We take 0^0 = 1.
The fixed points are in A135385.
For 1-digit or 2-digit numbers this is the same as A075877. - R. J. Mathar, Mar 28 2012
a(A221221(n)) = A133048(A221221(n)) = A222493(n). - Reinhard Zumkeller, May 27 2013

Examples

			20 -> 2^0 = 1,
21 -> 2^1 = 2,
24 -> 2^4 = 16,
39 -> 3^9 = 19683,
623 -> 6^2*3 = 108,
etc.
		

Crossrefs

Cf. A075877, A133501 (number of steps to reach fixed point), A133502, A135385 (the conjectured list of fixed points), A135384 (numbers which converge to 2592). For records see A133504, A133505; for the fixed points that are reached when this map is iterated starting at n, see A287877.
Cf. also A133048 (powerback), A031346 and A003001 (persistence).
Cf. also A031298, A007376.

Programs

  • Haskell
    a133500 = train . reverse . a031298_row where
       train []       = 1
       train [x]      = x
       train (u:v:ws) = u ^ v * (train ws)
    -- Reinhard Zumkeller, May 27 2013
    
  • Maple
    powertrain:=proc(n) local a,i,n1,n2,t1,t2; n1:=abs(n); n2:=sign(n); t1:=convert(n1, base, 10); t2:=nops(t1); a:=1; for i from 0 to floor(t2/2)-1 do a := a*t1[t2-2*i]^t1[t2-2*i-1]; od: if t2 mod 2 = 1 then a:=a*t1[1]; fi; RETURN(n2*a); end; # N. J. A. Sloane, Dec 03 2007
  • Mathematica
    ptm[n_]:=Module[{idn=IntegerDigits[n]},If[EvenQ[Length[idn]],Times@@( #[[1]]^ #[[2]] &/@Partition[idn,2]),(Times@@(#[[1]]^#[[2]] &/@ Partition[ Most[idn],2]))Last[idn]]]; Array[ptm,70,0] (* Harvey P. Dale, Jul 15 2019 *)
  • Python
    def A133500(n):
        s = str(n)
        l = len(s)
        m = int(s[-1]) if l % 2 else 1
        for i in range(0,l-1,2):
            m *= int(s[i])**int(s[i+1])
        return m # Chai Wah Wu, Jun 16 2017

A064869 The minimal number which has multiplicative persistence 5 in base n.

Original entry on oeis.org

244140624, 3629, 1601, 1535, 394, 679, 317, 1099, 127, 135, 582, 187, 168, 157, 201, 159, 230, 215, 180, 185, 246, 181, 188, 195, 198, 323, 239, 255, 259, 267, 239, 287, 295, 293, 310, 313, 280, 377, 375, 395, 347, 360, 321, 370, 439, 431, 458, 355, 362
Offset: 5

Views

Author

Sascha Kurz, Oct 09 2001

Keywords

Comments

The persistence of a number is the number of times you need to multiply the digits together before reaching a single digit. a(3) and a(4) seem not to exist.

Examples

			a(9)=394 because 394=[477]->[237]->[46]->[26]->[13]->[3] and no smaller n has persistence 5 in base 9.
		

Crossrefs

Formula

a(n) = 6*n-floor(n/120) for n > 119.

A006050 Smallest number of additive persistence n.

Original entry on oeis.org

0, 10, 19, 199, 19999999999999999999999
Offset: 0

Views

Author

Keywords

Comments

The next term a(5) is 1 followed by 2222222222222222222222 9's.

References

  • Meimaris Antonios, On the additive persistence of a number in base p, Preprint, 2015.
  • H. J. Hindin, The additive persistence of a number, J. Rec. Math., 7 (No. 2, 1974), 134-135.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    lst = {0, 10}; Do[AppendTo[lst, 2*10^((lst[[-1]] - 1)/9) - 1], {3}]; lst (* Arkadiusz Wesolowski, Oct 17 2012 *)
    Join[{0},NestList[2*10^((#-1)/9)-1&,10,3]] (* Harvey P. Dale, May 08 2020 *)

Formula

For n>1 a(n) = 2*10^((a(n-1)-1)/9)-1.

A014120 Smallest number of persistence n over product-of-nonzero-digits function.

Original entry on oeis.org

0, 10, 25, 39, 77, 679, 6788, 68889, 2677889, 26888999, 3778888999, 267777777889999, 77777777788888888888899999, 37777777777777777777777777778888889999999999999999999
Offset: 0

Views

Author

Keywords

Comments

Comments from Marc Lapierre, Sep 09 2020, updated Feb 19 2025: (Start)
Let d(b) denote a string of b copies of the digit d. For example, 3(5) would represent 33333.
Here are recent discoveries and the initials of the discoverers:
14 2(1)6(1)7(1)8(99)9(10) by WW
15 6(1)7(157)8(46)9(25) by WW
16 3(1)7(54)8(82)9(353) by WW
17 3(1)7(27)8(622)9(399) by WW
18 3(1)7(140)8(258)9(1946) by WW
19 2(1)7(122)8(498)9(4297) by ML
20 2(1)7(723)8(211)9(9825) by ML
Conjectured terms follow:
21 2(1)6(1)7(822)8(29)9(22601) by CC
22 2(1)7(325)8(1678)9(49461) by CC
23 2(1)7(1199)8(662)9(110077) by CC
24 7(1335)8(1609)9(241857) by CC
25 4(1)7(155)8(1135)9(540199) by CC
26 6(1)7(124)8(762)9(1192494) by CC
27 4(1)7(94)8(583)9(2616367) by CC
28 3(1)5(6)9(5788986) by CC
29 7(20)8(24)9(12878515) by CC
30 8(67)9(29136478) by CC
31 7(9)8(17)9(64768493) by CC
32 6(1)7(8)8(5)9(144417969) by CC
33 6(1)7(2)8(8)9(324379548) by CC
34 2(1)6(1)7(1)8(31)9(728759871) by CC
35 2(1)6(1)8(555702)9(1553958443) by CC
36 3(1)8(10311016)9(3652133953) by CC
37 2(1)6(1)8(1482224)9(9136624827) by CC
38 3(1)8(1469099)9(19262606200) by CC
39 8(30408394)9(42905304588) by CC
WW=Wilfred Whiteside & Phil Carmody (see link)
ML=Marc Lapierre
CC=Christophe Clavier
It seems a safe conjecture that this sequence is infinite.
(End)

Crossrefs

Cf. A003001.

Extensions

Edited by N. J. A. Sloane, Sep 11 2020 following suggestions from Marc Lapierre, Sep 09 2020

A064867 The minimal number which has multiplicative persistence 3 in base n.

Original entry on oeis.org

26, 63, 68, 23, 27, 31, 35, 39, 43, 46, 50, 54, 58, 62, 66, 69, 73, 77, 81, 85, 89, 92, 96, 100, 104, 108, 112, 115, 119, 123, 127, 131, 135, 138, 142, 146, 150, 154, 158, 161, 165, 169, 173, 177, 181, 184, 188, 192
Offset: 3

Views

Author

Sascha Kurz, Oct 08 2001

Keywords

Comments

The persistence of a number is the number of times you need to multiply the digits together before reaching a single digit.

Examples

			a(3) = 26 because 26 = [222]->[22]->[11]->[1] and no fewer n has persistence 3 in base 3.
		

Crossrefs

Programs

  • Mathematica
    With[{m = 3}, Table[Block[{k = 1}, While[Length@ FixedPointList[Times @@ IntegerDigits[#, n] &, k, 100] != m + 2, k++]; k], {n, 3, 5}]]~Join~Array[4 # - Floor[#/6] &, 45, 6] (* Michael De Vlieger, Aug 30 2021 *)

Formula

a(n) = 4*n-floor(n/6) for n > 5.
From Chai Wah Wu, Mar 07 2025: (Start)
a(n) = a(n-1) + a(n-6) - a(n-7) for n > 12.
G.f.: x^3*(48*x^9 - x^8 - 33*x^7 - 22*x^6 + 4*x^5 + 4*x^4 - 45*x^3 + 5*x^2 + 37*x + 26)/(x^7 - x^6 - x + 1). (End)

A064868 The minimal number which has multiplicative persistence 4 in base n.

Original entry on oeis.org

2344, 172, 131, 174, 52, 77, 75, 83, 75, 81, 89, 95, 101, 104, 110, 133, 143, 127, 133, 119, 124, 129, 134, 139, 144, 149, 154, 159, 164, 169, 174, 179, 184, 189, 194, 199, 204, 209, 214, 219, 224, 229, 234, 238, 243, 248, 253, 258, 263, 268, 273, 278, 283
Offset: 5

Views

Author

Sascha Kurz, Oct 09 2001

Keywords

Comments

The persistence of a number is the number of times you need to multiply the digits together before reaching a single digit. a(3) and a(4) do not seem to exist.

Examples

			a(6) = 172 because 172 = [444]->[144]->[24]->[12]->[2] and no lesser n has persistence 4 in base 6.
		

Crossrefs

Programs

  • Mathematica
    With[{m = 4, r = 24}, Table[Block[{k = 1}, While[Length@ FixedPointList[Times @@ IntegerDigits[#, n] &, k] != m + 2, k++]; k], {n, m + 1, r}]~Join~Array[(m + 1) # - Floor[#/r] &, 34, r + 1]] (* Michael De Vlieger, Aug 30 2021 *)
  • PARI
    pers(nn, b) = {ok = 0; p = 0; until (ok, d = digits(nn, b); if (#d == 1, ok = 1, p++); nn = prod(k=1, #d, d[k]); if (nn == 0, ok = 1);); return (p);}
    a(n) = {i=0; while (pers(i, n) != 4, i++); return (i);} \\ Michel Marcus, Jun 30 2013

Formula

a(n) = 5*n-floor(n/24) for n > 23.
From Chai Wah Wu, Mar 07 2025: (Start)
a(n) = a(n-1) + a(n-24) - a(n-25) for n > 48.
G.f.: x^5*(18*x^43 - x^42 + 21*x^41 - 5*x^40 - 18*x^39 - x^38 + 2*x^37 - x^36 - x^35 - 3*x^34 - x^33 + 13*x^32 - 3*x^31 + 7*x^30 - 20*x^29 + 127*x^28 - 38*x^27 + 46*x^26 + 2177*x^25 - 2339*x^24 + 5*x^23 + 5*x^22 + 5*x^21 + 5*x^20 - 14*x^19 + 6*x^18 - 16*x^17 + 10*x^16 + 23*x^15 + 6*x^14 + 3*x^13 + 6*x^12 + 6*x^11 + 8*x^10 + 6*x^9 - 8*x^8 + 8*x^7 - 2*x^6 + 25*x^5 - 122*x^4 + 43*x^3 - 41*x^2 - 2172*x + 2344)/(x^25 - x^24 - x + 1). (End)

Extensions

Example modified by Harvey P. Dale, Oct 19 2022

A046500 Smallest prime with multiplicative persistence n.

Original entry on oeis.org

2, 11, 29, 47, 277, 769, 8867, 186889, 2678789, 26899889, 3778888999, 277777788888989
Offset: 0

Views

Author

Patrick De Geest, Sep 15 1998

Keywords

Comments

The persistence of a number is the number of times you need to multiply the digits together before reaching a single digit.

Examples

			47 -> 28 -> 16 -> 6 has persistence 3.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Length[NestWhileList[Times@@IntegerDigits[#]&,n,#>9&]]-1; t={}; i=1; Do[While[a[p=Prime[i]]!=n,i++]; AppendTo[t,p],{n,0,9}]; t (* Jayanta Basu, Jun 02 2013 *)

Extensions

a(10)-a(11) found by Jud McCranie

A046510 Numbers with multiplicative persistence value 1.

Original entry on oeis.org

10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 30, 31, 32, 33, 40, 41, 42, 50, 51, 60, 61, 70, 71, 80, 81, 90, 91, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 130, 131, 132, 133
Offset: 1

Views

Author

Patrick De Geest, Sep 15 1998

Keywords

Comments

Numbers 0 to 9 have a multiplication persistence of 0, not 1. - Daniel Mondot, Mar 12 2022

Examples

			24 -> 2 * 4 = [ 8 ] -> one digit in one step.
		

Crossrefs

Numbers with multiplicative persistence m: this sequence (m=1), A046511 (m=2), A046512 (m=3), A046513 (m=4), A046514 (m=5), A046515 (m=6), A046516 (m=7), A046517 (m=8), A046518 (m=9), A352531 (m=10), A352532 (m=11).

Programs

  • Mathematica
    Select[Range[10, 121], IntegerLength[Times @@ IntegerDigits[#]] <= 1 &] (* Jayanta Basu, Jun 26 2013 *)
  • PARI
    isok(n) = my(d=digits(n)); (#d > 1) && (#digits(prod(k=1, #d, d[k])) <= 1); \\ Michel Marcus, Apr 12 2018 and Mar 13 2022
    
  • Python
    from math import prod
    def ok(n): return n > 9 and prod(map(int, str(n))) < 10
    print([k for k in range(134) if ok(k)]) # Michael S. Branicky, Mar 13 2022

Extensions

Incorrect terms 0 to 9 removed by Daniel Mondot, Mar 12 2022
Showing 1-10 of 72 results. Next