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-5 of 5 results.

A061602 Sum of factorials of the digits of n.

Original entry on oeis.org

1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 2, 2, 3, 7, 25, 121, 721, 5041, 40321, 362881, 3, 3, 4, 8, 26, 122, 722, 5042, 40322, 362882, 7, 7, 8, 12, 30, 126, 726, 5046, 40326, 362886, 25, 25, 26, 30, 48, 144, 744, 5064, 40344, 362904, 121, 121, 122, 126
Offset: 0

Views

Author

Amarnath Murthy, May 19 2001

Keywords

Comments

Numbers n such that a(n) = n are known as factorions. It is known that there are exactly four of these [in base 10]: 1, 2, 145, 40585. - Amarnath Murthy
The sum of factorials of the digits is the same for 0, 1, 2 in any base. - Alonso del Arte, Oct 21 2012

Examples

			a(24) = (2!) + (4!) = 2 + 24 = 26.
a(153) = 127 because 1! + 5! + 3! = 1 + 120 + 6 = 127.
		

Crossrefs

Cf. A061603, A108911, A193163, A165451 (places of primes).

Programs

  • Magma
    a061602:=func< n | n eq 0 select 1 else &+[ Factorial(d): d in Intseq(n) ] >; [ a061602(n): n in [0..60] ]; // Klaus Brockhaus, Nov 23 2010
    
  • Maple
    A061602 := proc(n)
            add(factorial(d),d=convert(n,base,10)) ;
    end proc: # R. J. Mathar, Dec 18 2011
  • Mathematica
    a[n_] := Total[IntegerDigits[n]! ]; Table[a[n], {n, 1, 53}] (* Saif Hakim (saif7463(AT)gmail.com), Apr 23 2006 *)
  • PARI
    a(n) = { if(n==0, 1, my(d=digits(n)); sum(i=1, #d, d[i]!)) } \\ Harry J. Smith, Jul 25 2009
    
  • Python
    import math
    def A061602(n):
        s=0
        for i in str(n):
            s+=math.factorial(int(i))
        return s # Indranil Ghosh, Jan 11 2017
    
  • R
    i=0
    values <- c()
    while (i<1000) {
      values[i+1] <- A061602(i)
      i=i+1
    }
    plot(values)
    A061602 <- function(n) {
      sum=0;
      numberstring <- paste0(i)
      numberstring_split <- strsplit(numberstring, "")[[1]]
      for (number in numberstring_split) {
        sum = sum+factorial(as.numeric(number))
      }
      return(sum)
    }
    # Raphaël Deknop, Nov 08 2021

Extensions

Corrected and extended by Vladeta Jovovic, May 19 2001
Link and amended comment by Mark Hudson (mrmarkhudson(AT)hotmail.com), Nov 12 2004

A014080 Factorions: equal to the sum of the factorials of their digits in base 10 (cf. A061602).

Original entry on oeis.org

1, 2, 145, 40585
Offset: 1

Views

Author

Keywords

Comments

Poole (1971) showed that there are no further terms. - N. J. A. Sloane, Mar 17 2019
Base 6 also has four factorions, as does base 15. - Alonso del Arte, Oct 20 2012
This is row 10 of the table A193163. - M. F. Hasler, Nov 25 2015

Examples

			1! + 4! + 5! = 1 + 24 + 120 = 145, so 145 is in the sequence.
		

References

  • J.-M. De Koninck, Ces nombres qui nous fascinent, Entry 145, p. 50, Ellipses, Paris 2008.
  • P. Kiss, A generalization of a problem in number theory, Math. Sem. Notes Kobe Univ., 5 (1977), no. 3, 313-317. MR 0472667 (57 #12362).
  • Clifford A. Pickover, A Passion for Mathematics, Wiley, 2005; see pp. 68, 305.
  • Alfred S. Posamentier, Math Charmers, Tantalizing Tidbits for the Mind, Prometheus Books, NY, 2003, pages 38, 62-63.
  • Joe Roberts, "The Lure of the Integers", page 35.
  • D. Wells, Curious and interesting numbers, Penguin Books, p. 125.

Crossrefs

Programs

  • J
    (#~ (= +/@:!@:("."0)@":"0)) i.1e5 NB. Stephen Makdisi, May 14 2016
    
  • Mathematica
    Select[Range[50000], Plus @@ (IntegerDigits[ # ]!) == # &] (* Alonso del Arte, Jan 14 2008 *)
  • Python
    from itertools import count, islice
    def A014080_gen(): # generator of terms
        return (n for n in count(1) if sum((1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880)[int(d)] for d in str(n)) == n)
    A014080_list = list(islice(A014080_gen(),4)) # Chai Wah Wu, Feb 18 2022

Formula

If n has digits (d1,d2,...,dk) base 10, then n is on this list if and only if n = d1! + d2! + ... + dk!.

A214285 List of amicable sums-of-factorial-of-digits pairs (A,B): A equals the sum of the factorials of B's digits in base 10, and vice versa.

Original entry on oeis.org

871, 45361, 872, 45362
Offset: 1

Views

Author

Jaeyool Park, Jul 10 2012

Keywords

Comments

Number pairs (A,B), A <> B, such that A061602(A)=B and A061602(B)=A, indicating where the mapping of A to the sum of the factorials of its digits has a cycle of length 2.
Peter Kiss (1977) showed there are no further terms. - N. J. A. Sloane, Mar 17 2019

Examples

			8! + 7! + 1! = 45361, 4! + 5! + 3! + 6! + 1! = 871.
		

References

  • P. Kiss, A generalization of a problem in number theory, Math. Sem. Notes Kobe Univ., 5 (1977), no. 3, 313-317. MR 0472667 (57 #12362).

Crossrefs

A306955 Let f map k to the sum of the factorials of the digits of k (A061602); sequence lists numbers such that f(f(f(k)))=k.

Original entry on oeis.org

1, 2, 145, 169, 1454, 40585, 363601
Offset: 1

Views

Author

N. J. A. Sloane, Mar 17 2019

Keywords

Comments

Kiss showed that there are no further terms and in fact there are no further cycles other than those shown in A014080 and A254499.

Examples

			The map f sends 169 to 363601 to 1454 to 169 ...
		

References

  • P. Kiss, A generalization of a problem in number theory, Math. Sem. Notes Kobe Univ., 5 (1977), no. 3, 313-317. MR 0472667 (57 #12362).

Crossrefs

Cf. A061602.
The fixed points and loops of length 2 can be found in A014080, A214285, and A254499.

Programs

  • Mathematica
    f[k_] := Total[IntegerDigits[k]!]; Select[Range[400000], Nest[f, #, 3] == # &] (* Amiram Eldar, Mar 17 2019 *)
  • PARI
    a061602(n) = my(d=digits(n)); sum(i=1, #d, d[i]!)
    is(n) = a061602(a061602(a061602(n)))==n \\ Felix Fröhlich, May 18 2019

A343269 a(n) is the smallest integer whose orbit length is n under iteration of the map r -> A061602(r).

Original entry on oeis.org

1, 0, 169, 78, 69, 26, 24, 4, 22, 5, 122, 25, 14, 127, 6, 3, 12, 33, 136, 256, 57, 247, 148, 38, 1478, 368, 79, 1458, 48, 44, 29, 7, 13, 34, 9, 8, 23, 234, 37, 337, 58, 46, 139, 138, 369, 239, 267, 36, 334, 289, 3555, 49, 144, 45, 229, 2569, 22888, 136789, 334479, 1479, 1233466
Offset: 1

Views

Author

Lamine Ngom, Apr 10 2021

Keywords

Comments

A303935 provides the orbit's lengths, i.e., the number of needed steps, starting from a given number, to reach a value that already exists in trajectory.
This sequence is infinite. Actually, given a number x whose orbit's length is k, one can always build a number y whose orbit's length is (k+1).
For instance, just consider either the number 10^(x-1), or Rx (the repunit of length x), or any other x-digit binary string, all of them leading to the number x after application of the mapping function: A061602(y) = x.
Indeed, none of them will correspond to the smallest integer m such that A303935(m) = k + 1.
In fact, it becomes computationally hard to determine further terms since, as in the Collatz mapping function and other similar problems, there is no predictable way to define the exact complete path without calculating all intermediary orbit's components until one reaches a previously calculated or encountered number.
a(59) = 334479, a(60) = 1479, a(61) = 1233466, next terms = ?

Examples

			a(6) = 26 because A303935(26) = 6, and 26 is the smallest nonnegative integer m such that A303935(m) = 6.
		

Crossrefs

Cf. A303935 (orbit's length), A061602 (sum of factorials of digits), A014080 (factorions).
Showing 1-5 of 5 results.