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

A242868 Numbers n such that sum of the factorial of digits of n is semiprime.

Original entry on oeis.org

3, 14, 15, 16, 17, 18, 22, 24, 25, 27, 28, 40, 41, 42, 50, 51, 52, 60, 61, 70, 71, 72, 80, 81, 82, 102, 104, 105, 107, 108, 112, 114, 115, 117, 118, 120, 121, 123, 125, 126, 128, 132, 140, 141, 144, 145, 146, 147, 148, 150, 151, 152, 154, 156, 157, 158, 162, 164
Offset: 1

Views

Author

K. D. Bajpai, May 24 2014

Keywords

Examples

			a(4) = 16:  1! + 6! = 1 + 720 = 721 = 7 * 103 which is semiprime.
a(9) = 25:  2! + 5! = 2 + 120 = 122 = 2 * 61 which is semiprime.
		

Crossrefs

Programs

  • Maple
    with(numtheory):A242868:= proc() local a; a:=add( i!,i = convert((n), base, 10))(n);if bigomega(a)=2 then RETURN (n);fi; end: seq(A242868 (), n=1..300);
  • Mathematica
    Select[Range[200],PrimeOmega[Total[IntegerDigits[#]!]]==2&] (* Harvey P. Dale, Jul 30 2015 *)

A173688 Numbers m such that the sum of square of factorial of decimal digits is prime.

Original entry on oeis.org

10, 11, 12, 13, 14, 15, 19, 20, 21, 30, 31, 40, 41, 50, 51, 90, 91, 100, 101, 110, 111, 123, 132, 133, 134, 135, 138, 143, 144, 147, 153, 156, 158, 165, 168, 169, 174, 177, 183, 185, 186, 196, 203, 213, 230, 231, 302, 303, 304, 305, 308, 312, 313, 314, 315, 318, 320
Offset: 1

Views

Author

Michel Lagneau, Nov 25 2010

Keywords

Comments

Let the decimal expansion of m = d(0)d(1)...d(p). Numbers such that Sum_{k=0..p} (d(k)!)^2 is prime.

Examples

			a(5) = 14 is in the sequence because (1!)^2 + (4!)^2 = 1 + 24^2 = 577 and 577 is prime.
		

Crossrefs

Programs

  • Maple
    with(numtheory):for n from 1 to 500 do:l:=length(n):n0:=n:s:=0:for m from 1
      to l do:q:=n0:u:=irem(q,10):v:=iquo(q,10):n0:=v :s:=s+(u!)^2:od: if type(s,prime)=true
      then printf(`%d, `,n):else fi:od:
  • Mathematica
    Select[Range[400],PrimeQ[Total[(IntegerDigits[#]!)^2]]&]  (* Harvey P. Dale, Mar 23 2011 *)
  • Python
    from itertools import count, islice, combinations_with_replacement
    from math import factorial
    from sympy import isprime
    from sympy.utilities.iterables import multiset_permutations
    def A173688_gen(): # generator of terms
        for l in count(0):
            for i in range(1,10):
                fi = factorial(i)**2
                yield from sorted(int(str(i)+''.join(map(str,k))) for j in combinations_with_replacement(range(10), l) for k in multiset_permutations(j) if isprime(fi+sum(map(lambda n:factorial(n)**2,j))))
    A173688_list = list(islice(A173688_gen(),50)) # Chai Wah Wu, Feb 23 2023

A242855 Catalan numbers C(n) such that sum of the factorials of digits of C(n) is prime.

Original entry on oeis.org

2, 16796, 263747951750360, 1002242216651368, 104088460289122304033498318812080, 22033725021956517463358552614056949950, 1000134600800354781929399250536541864362461089950800, 216489185503133990863274261791925599831188392742851863147080
Offset: 1

Views

Author

K. D. Bajpai, May 24 2014

Keywords

Comments

The n-th Catalan number C(n) = (2*n)!/(n!*(n+1)!).
The next term, a(9), has 66 digits which is too large to display in data section.
The 102nd term, a(102), having 992 digits, is the last term in b-file.
a(103) has 1021 digits, hence not included in b-file.
Intersection of A000108 and A165451.

Examples

			16796 = (2*10)!/(10!*(10+1)!) is 10th Catalan number: 1!+6!+7!+9!+6! = 369361 which is prime.
263747951750360 = (2*28)!/(28!*(28+1)!) is 28th Catalan number: 2!+6!+3!+7!+4!+7!+9!+5!+1!+7!+5!+0!+3!+6!+0! = 379721 which is prime.
		

Crossrefs

Programs

  • Maple
    with(numtheory):A242855:= proc() if isprime(add( i!,i = convert(((2*n)!/(n!*(n+1)!)), base, 10))((2*n)!/(n!*(n+1)!))) then RETURN ((2*n)!/(n!*(n+1)!)); fi; end: seq(A242855 (), n=1..50);
  • Mathematica
    Select[CatalanNumber[Range[150]],PrimeQ[Total[IntegerDigits[#]!]]&] (* Harvey P. Dale, Apr 30 2025 *)

A242831 Triangular numbers T such that sum of the factorials of digits of T is prime.

Original entry on oeis.org

10, 21, 136, 153, 351, 630, 780, 3403, 3570, 5671, 6441, 6670, 7503, 9870, 10011, 13366, 14535, 16653, 20301, 23220, 33153, 34716, 36046, 36315, 37950, 43660, 46360, 56616, 66430, 93096, 93961, 95703, 112101, 139656, 144453, 159895, 166753, 169653, 187578
Offset: 1

Views

Author

K. D. Bajpai, May 23 2014

Keywords

Comments

The n-th triangular number T(n) = n * (n+1)/2.
Intersection of A165451 and A000217.

Examples

			16*(16+1)/2 = 136 is triangular number. 1! + 3! + 6! = 727 which is prime. Hence 136 appears in the sequence.
35*(35+1)/2 = 630 is triangular number. 6! + 3! + 0! = 727 which is prime. Hence 630 appears in the sequence.
		

Crossrefs

Programs

  • Maple
    A242831:= proc()  if isprime(add( i!,i = convert((x*(x+1)/2), base, 10))(x*(x+1)/2))then RETURN ((x*(x+1)/2)); fi; end: seq(A242831 (), x=1..1000);

A358998 Nonprimes whose sum of factorials of digits is a prime.

Original entry on oeis.org

10, 12, 20, 21, 30, 100, 110, 111, 122, 133, 134, 135, 136, 143, 153, 155, 178, 187, 202, 212, 220, 221, 303, 304, 305, 306, 314, 315, 316, 330, 340, 341, 350, 351, 360, 361, 403, 413, 430, 505, 513, 515, 530, 531, 550, 551, 603, 630, 708, 718, 780, 781, 807
Offset: 1

Views

Author

Carole Dubois, Feb 11 2023

Keywords

Examples

			134 is in the sequence because it is not prime and 1! + 3! + 4! = 1 + 6 + 24 = 31 which is a prime number.
202 is also in the sequence because it is not prime and 2! + 0! + 2! = 5 prime.
		

Crossrefs

Cf. A061602, A084405 (Primes such that the sum of the factorials of the digits is also prime).

Programs

  • Mathematica
    Select[Range[1000], ! PrimeQ[#] && PrimeQ[Total[IntegerDigits[#]!]] &] (* Amiram Eldar, Feb 11 2023 *)
  • Python
    from sympy import isprime
    from math import factorial
    S=[]
    nomb=200
    i=0
    while len(S) < nomb:
        i+=1
        if isprime(i):
            continue
        som=0
        for j in range(len(str(i))):
            som+=factorial(int(ix[j]))
        if  not isprime(som):
            continue
        S.append(i)
    
  • Python
    from sympy import isprime
    from math import factorial
    def f(n): return sum(factorial(int(d)) for d in str(n))
    def ok(n): return not isprime(n) and isprime(f(n))
    print([k for k in range(900) if ok(k)]) # Michael S. Branicky, Feb 11 2023

Formula

A165451 INTERSECT A002808. - R. J. Mathar, Feb 23 2023
Showing 1-6 of 6 results.