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

A188283 Numbers k such that iterations for the map r -> A061602(r) starting with k ends with a fixed point (factorions A014080).

Original entry on oeis.org

0, 1, 2, 10, 11, 145, 154, 223, 232, 322, 405, 415, 450, 451, 504, 514, 540, 541, 569, 596, 659, 695, 956, 965, 1023, 1032, 1123, 1132, 1203, 1213, 1223, 1230, 1231, 1232, 1302, 1312, 1320, 1321, 1322, 1449, 1494, 1569, 1596, 1659, 1695, 1944, 1956, 1965, 2003
Offset: 1

Views

Author

Jaroslav Krizek, Mar 26 2011

Keywords

Comments

If k is a term, then (10^k - 1)/9 is also a term. - Jinyuan Wang, Nov 07 2020

Examples

			Number 405 is in sequence because 405 -> 145 -> 145 -> ...
		

Crossrefs

Supersequence of A014080 (factorions).

Programs

  • PARI
    is(k) = {my(t=k, v=List([k])); while(t=sum(i=1, #d=digits(t), d[i]!), if(t==v[#v], return(1), if(sum(i=1, #v-1, t==v[i]), return(0))); listput(v, t)); } \\ Jinyuan Wang, Nov 07 2020

Extensions

Missing terms a(1) and a(8)-a(10) added by Jaroslav Krizek, Jan 28 2012
Name corrected and more terms from Jinyuan Wang, Nov 07 2020

A244090 Numbers n such that n is a factorion (A014080, equal to the sum of the factorials of its digits), in at least one base b.

Original entry on oeis.org

1, 2, 7, 25, 26, 48, 49, 121, 122, 144, 145, 240, 721, 722, 726, 1440, 1441, 1442, 5041, 5042, 5162, 5760
Offset: 1

Views

Author

Anthony Sand, Jun 20 2014

Keywords

Comments

The bases in which n = func(n) are 2, 2, 4, 6, 6, 11, 5, 24, 24, 28, 10, 47, 120, 120, 240, 239, 15, 15, 720, 720, 27, 822. Note multiple bases for some n, e.g. 25 = 4! + 1! in base 6 and 25 = 1! + 4! in base 21; 721 = 6! + 1! in base 120 and 721 = 1! + 6! in base 715.

Examples

			1 = 1! = 1 (base>=2).
2 = 1! + 0! = 1 + 1 = 10 (b=2).
7 = 1! + 3! = 1 + 6 = 13 (b=4).
25 = 4! + 1! = 24 + 1 = 41 (b=6).
26 = 4! + 2! = 24 + 2 = 42 (b=6).
48 = 4! + 4! = 24 + 24 = 44 (b=11).
49 = 1! + 4! + 4! = 1 + 24 + 24 = 144 (b=5).
121 = 5! + 1! = 120 + 1 = 51 (b=24).
122 = 5! + 2! = 120 + 2 = 52 (b=24).
144 = 5! + 4! = 120 + 24 = 54 (b=28).
145 = 1! + 4! + 5! = 1 + 24 + 120 (b=10).
240 = 5! + 5! = 120 + 120 = 55 (b=47).
		

Crossrefs

Programs

  • PARI
    isok(n) = {if (n==1, return (1)); for (b=2, n, d = digits(n, b); if (sum(i=1, #d, d[i]!) == n, return (1));); return (0);} \\ Michel Marcus, Jun 21 2014

Formula

s = 0; for digit(i=1..j) of n in base b, s = s + digit(i)!.

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

A193163 Irregular table read by rows, in which row n lists the factorions in base n, for n >= 2.

Original entry on oeis.org

1, 2, 1, 2, 1, 2, 7, 1, 2, 49, 1, 2, 25, 26, 1, 2, 1, 2, 1, 2, 41282, 1, 2, 145, 40585, 1, 2, 26, 48, 40472, 1, 2, 1, 2, 519326767, 1, 2, 12973363226, 1, 2, 1441, 1442, 1, 2, 2615428934649, 1, 2, 40465, 43153254185213, 43153254226251, 1, 2, 1, 2, 1, 2, 1, 2
Offset: 2

Views

Author

Karl W. Heuer, Aug 06 2011

Keywords

Comments

Because 1 and 2 are factorions in any base, these mark the start of a new row.

Examples

			49 is in row 5 because 49 = 1! + 4! + 4! and is "144" in base 5.
The first few rows are:
1, 2 (binary)
1, 2 (ternary)
1, 2, 7 (quartal)
1, 2, 49 (quintal)
1, 2, 25, 26 (hexal)
1, 2 (heptal)
1, 2 (octal)
1, 2, 41282 (nonal)
1, 2, 145, 40585 (decimal)
1, 2, 26, 48, 40472 (undecimal)
1, 2 (duodecimal)
1, 2, 519326767, etc.
		

Crossrefs

A108911 Difference between n and the sum of the factorials of its digits.

Original entry on oeis.org

0, 0, -3, -20, -115, -714, -5033, -40312, -362871, 8, 9, 9, 6, -11, -106, -705, -5024, -40303, -362862, 17, 18, 18, 15, -2, -97, -696, -5015, -40294, -362853, 23, 24, 24, 21, 4, -91, -690, -5009, -40288, -362847, 15, 16, 16, 13, -4, -99, -698, -5017, -40296, -362855, -71, -70, -70, -73
Offset: 1

Views

Author

Keywords

Comments

Null values are at n = 1, 2, 145, 40585 (A014080). Twin values are at n = 1, 2; 11, 12; 21, 22; ... 10*i + 1, 10*i + 2. Not in sequence: 7, 10, 14, ... Nice polar diagrams repeating themselves with normalized angle to 9! and radius = a(n).
The sequence can be seen as the difference between the natural numbers in the decimal system (n_dec = N0*(10^0) + N1*(10^1) + N2*(10^2)...) and their values in a non-positional number system based on the factorials of the digits (n_fact = N0*(N0 - 1)! + N1*(N1 - 1)! + N2*(N2 - 1)! ...). See also A111095. Note that a(np) - a(n) is congruent to 0 mod 9 if n and np are different for the permutation of the digits. Example (a(5971) - a(1957))/9 = 446. The property can be easily derived by remembering that np - n is congruent to 0 mod 9. - Giorgio Balzarotti, Oct 15 2005

Examples

			For n = 35, a(35) = -91 because 35 - (3! + 5!) = 35 - (6 + 120) = -91.
		

Crossrefs

Programs

  • Magma
    [n-&+[Factorial(d): d in Intseq(n)]: n in [1..60]]; // Bruno Berselli, Oct 25 2018
  • Maple
    a:= n-> n-add(i!, i=convert(n, base, 10)):
    seq(a(n), n=1..100);  # Alois P. Heinz, Oct 24 2018
  • Mathematica
    f[n_] := n - Plus @@ Factorial /@ IntegerDigits[n]; Table[f[n], {n, 53}] (* Ray Chandler, Jul 24 2005 *)
  • PARI
    a(n) = my(d = digits(n)); n - sum(i=1, #d, d[i]!); \\ Michel Marcus, Apr 21 2014
    

Formula

a(n) = n - (N0! + N1! + N2! + ...) if n = N0*10^0 + N1*10^1 + N2*10^2 ...
a(n) = n - A061602(n). - Michel Marcus, Apr 21 2014

Extensions

Extended by Ray Chandler, Jul 24 2005

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

A254499 Amicable factorions.

Original entry on oeis.org

1, 2, 145, 871, 872, 40585, 45361, 45362
Offset: 1

Views

Author

Michel Lagneau, Jan 31 2015

Keywords

Comments

The members of a pair of numbers p and q are called amicable factorions if each is equal to the sum of the factorials of the base-10 digits of the other. The only six pairs (p,q) are (1, 1), (2, 2), (145, 145), (871,45361), (872, 45362), (40585, 40585).
Peter Kiss (1977) showed there are no further terms. - N. J. A. Sloane, Mar 17 2019

Examples

			871 and 45361 are in the sequence because:
871 => 8!+7!+1! = 40320 +5040 + 1 = 45361;
45361 => 4!+5!+3!+6!+1! = 24 + 120 + 6 + 720 + 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

A014080 and A214285 are subsets.

Programs

  • Mathematica
    Select[Range[10^6], Plus @@ (IntegerDigits[Plus @@ (IntegerDigits[ # ]!) ]!) == # &]

Formula

n such that f(f(n))=n, where f(k)=A061602(k).

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

A173573 3-Factorions: equal to the sum of the triple factorials of their digits in base 10.

Original entry on oeis.org

1, 2, 3, 4, 81, 82, 83, 84
Offset: 1

Views

Author

Keywords

Comments

Sequence is complete. - Giovanni Resta, Mar 21 2013

Examples

			81 -> 8!!! + 1!!! = 8*5*2 + 1 = 80 + 1 = 81.
		

Crossrefs

Programs

  • Maple
    P:=proc(n,m) local a,b,i,j,k,x,w; for i from 1 by 1 to n do a:=0; b:=0; w:=0; k:=i; while k>0 do w:=k-(trunc(k/10)*10); j:=w; x:=w-m; if w=0 then b:=1; else while x>0 do j:=j*x; x:=x-m; od; b:=j; fi; a:=a+b; k:=trunc(k/10); od; if a=i then lprint(i,a); fi; od; end: P(1000,3);
  • Mathematica
    stfQ[n_]:=n==Total[Times@@Range[#,1,-3]&/@IntegerDigits[n]]; Select[Range[100],stfQ] (* Harvey P. Dale, May 31 2023 *)

A173577 7-Factorions: equal to the sum of the 7-fold factorials of their digits in base 10.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 19
Offset: 1

Views

Author

Keywords

Examples

			19 -> 1!!!!!!! + 9!!!!!!! = 1 + 9*2 = 1 + 18 = 19.
		

Crossrefs

Programs

  • Maple
    P:=proc(n,m) local a,b,i,j,k,x,w; for i from 1 by 1 to n do a:=0; b:=0; w:=0; k:=i; while k>0 do w:=k-(trunc(k/10)*10); j:=w; x:=w-m; if w=0 then b:=1; else while x>0 do j:=j*x; x:=x-m; od; b:=j; fi; a:=a+b; k:=trunc(k/10); od; if a=i then lprint(i,a); fi; od; end: P(1000,7);

Extensions

Definition corrected by Paolo P. Lava, Feb 24 2010
Showing 1-10 of 28 results. Next