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

A111095 n = Sum_{b} c_b*b! in the factorial base rewritten by c_b-fold repetition of b, b=1,2,3,....

Original entry on oeis.org

1, 2, 12, 22, 122, 3, 13, 23, 123, 223, 1223, 33, 133, 233, 1233, 2233, 12233, 333, 1333, 2333, 12333, 22333, 122333, 4, 14, 24, 124, 224, 1224, 34, 134, 234, 1234, 2234, 12234, 334, 1334, 2334, 12334, 22334
Offset: 1

Views

Author

Keywords

Comments

The integer n has a unique "greedy" representation in the factorial base as n = Sum_{b>=1} c_b*b!, see A007623.
The number of coefficients c_b is A084558(n).
The current sequence starts from an empty string, scans the coefficients c_b in the order b=1,2,3,..., i.e., reads A007623(n) from the least to the most significant position, and appends b c_b times to the string. The resulting string is shown in the sequence as a standard decimal number a(n).

Examples

			a(39) = 12334 with A007623(39) = 1211, because 1! + 2! + 3! + 3! + 4! = 1 + 2 + 6 + 6 + 24 = 39
		

Crossrefs

Formula

A061602(a(n)) = n. - R. J. Mathar, Oct 30 2010

Extensions

Definition and comment shortened with reference to A007623 - R. J. Mathar, Oct 30 2010

A108933 Numbers n such that the absolute value of (n - sum of the factorials of its digits) is prime.

Original entry on oeis.org

3, 14, 20, 24, 25, 30, 37, 43, 50, 53, 59, 60, 67, 73, 79, 80, 97, 100, 105, 110, 115, 124, 125, 134, 138, 146, 151, 152, 158, 171, 172, 198, 201, 202, 225, 227, 235, 243, 249, 250, 255, 259, 260, 265, 295, 301, 302, 306, 314, 318, 320, 325, 327, 330, 343, 347
Offset: 1

Views

Author

Jason Earls, Jul 20 2005

Keywords

Comments

6*10^843-1 generates an 844-digit prime.

Examples

			a(5)=25 because |25-(2!+5!)| = 97, a prime.
		

Crossrefs

Cf. A108911.

Programs

  • Mathematica
    Select[Range[400],PrimeQ[Abs[#-Total[IntegerDigits[#]!]]]&] (* Harvey P. Dale, Oct 03 2017 *)

A241404 Sum of n and the sum of the factorials of its digits.

Original entry on oeis.org

2, 4, 9, 28, 125, 726, 5047, 40328, 362889, 12, 13, 15, 20, 39, 136, 737, 5058, 40339, 362900, 23, 24, 26, 31, 50, 147, 748, 5069, 40350, 362911, 37, 38, 40, 45, 64, 161, 762, 5083, 40364, 362925, 65, 66, 68, 73, 92, 189, 790, 5111, 40392, 362953, 171, 172, 174
Offset: 1

Views

Author

Vincenzo Librandi, Apr 21 2014

Keywords

Examples

			a(8) = 40328 because we have 8 + 8! = 40328.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:= n + Plus@@Factorial/@IntegerDigits[n]; Table[f[n], {n, 50}]
  • PARI
    a(n) = my(d = digits(n)); n + sum(i=1, #d, d[i]!); \\ Michel Marcus, Apr 21 2014

Formula

a(n) = n + A061602(n). - Michel Marcus, Apr 21 2014
Showing 1-4 of 4 results.