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

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!.

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

A173447 The number of iterations for the map r -> A061602(r), starting with n, needed to reach the end of the first cycle.

Original entry on oeis.org

1, 0, 0, 15, 7, 9, 14, 31, 35, 34, 1, 1, 16, 32, 12, 9, 14, 31, 35, 34, 16, 16, 8, 36, 6, 11, 5, 7, 32, 30, 32, 32, 36, 17, 33, 30, 47, 38, 23, 7, 12, 12, 6, 33, 29, 53, 41, 38, 28, 51, 9, 9, 11, 30, 53, 9, 23, 20, 40, 23, 14
Offset: 0

Views

Author

Michel Lagneau, Nov 22 2010

Keywords

Comments

The sequence counts the iterations needed to reach a cycle (or loop) of numbers.
The reference (below) proves that the sequence of this numbers is finite and complete.
For n=1, the cycle is (1, 1, 1, ...). For each integer n > 1, the iterations enter one of the following 6 loops:
2, 2, 2, ...
145, 145, 145, ...
169, 363601, 1454, 169, ...
871, 45361, 871, ...
872, 45362, 872, ...
40585, 40585, 40585, ...
The set of numbers occurring in the 7 loops is {1, 2, 145, 169, 871, 872, 1454, 40585, 45361, 45362, 363601}.

Examples

			a(0) = 1 because 0 -> 1;
a(1) = 0 because 1 -> 1;
a(2) = 0 because 2 -> 2;
a(4) = 7 because 4 -> 24 -> 26 -> 722 -> 5044 -> 169 -> 363601 -> 1454, with 7 iterations because 1454 -> 169;
a(40585) = 0 because 40585 -> 40585.
		

References

  • Jean-Marie De Koninck, Armel Mercier, 1001 problemes en theorie classique des nombres - Entry 258, p. 41. Ellipses, 2004.

Crossrefs

Cf. A061602.

Programs

  • Magma
    a061602:=func< n | n eq 0 select 1 else &+[ Factorial(d): d in Intseq(n) ] >;
    a173447:=function(n); T:=[]; count:=0; a:=n; while a notin T do Append(~T, a); a:=a061602(a); count+:=1; end while; return count-1; end function; [ a173447(n): n in [0..60] ];
  • Maple
    A061602 := proc(n) if n = 0 then 1; else add(d!,d=convert(n,base,10)) ; end if; end proc:
    A173447 := proc(n) trck := [n] ; while true do m := A061602(op(-1,trck)) ; if m in trck then return nops(trck)-1 ;  else trck := [op(trck),m] ; end if;  end do: end proc:
    seq(A173447(n),n=0..50) ;

Extensions

Reduced to three lines of numbers; rephrased in terms of A061602; replaced program by a structured version - R. J. Mathar, Nov 23 2010
Terms, offset, and example corrected by D. S. McNeil, Nov 23 2010

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

A188284 Finite sequence of numbers n such that iterations for the map r -> A061602(r) starting with n ends with the same number n.

Original entry on oeis.org

1, 2, 145, 169, 871, 872, 1454, 40585, 45361, 45362, 363601
Offset: 1

Views

Author

Jaroslav Krizek, Mar 26 2011

Keywords

Comments

See A173447 = the number of iterations for the map r -> A061602(r), A061602 = sum of factorials of the digits of n.
Superset of A014080 (factorions).

Examples

			Number 169 is in sequence because 169 -> 363601 -> 1454 -> 169.
		

Crossrefs

A071064 Numbers divisible by the sum of factorials of their digits [A061602(n)] and also terminate in the sum of factorials of their digits.

Original entry on oeis.org

1, 2, 145, 2125, 2310, 3210, 10125, 10234, 10310, 11125, 11310, 12312, 13010, 13110, 13211, 13212, 21312, 23111, 23112, 30010, 30110, 31010, 31110, 31212, 32112, 40585, 52130, 111312, 113112, 131112, 133240, 135250, 153250, 200213
Offset: 1

Views

Author

Jason Earls, May 26 2002

Keywords

Examples

			a(8)=10234: 1!+0!+2!+3!+4! = 34 and 10234/34 = 301.
		

Crossrefs

Cf. A061602.

Programs

  • Mathematica
    dsfQ[n_]:=Module[{f=Total[IntegerDigits[n]!]},Divisible[n,f]&&Mod[ n,10^IntegerLength[f]]==f]; Select[Range[201000],dsfQ] (* Harvey P. Dale, Jul 05 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).

A165451 Sum of factorial of digits is prime.

Original entry on oeis.org

2, 10, 11, 12, 13, 20, 21, 30, 31, 100, 101, 110, 111, 122, 133, 134, 135, 136, 143, 153, 155, 163, 178, 187, 202, 212, 220, 221, 303, 304, 305, 306, 313, 314, 315, 316, 330, 331, 340, 341, 350, 351, 360, 361, 403, 413, 430, 431, 503, 505, 513, 515, 530, 531
Offset: 1

Views

Author

Rémy Sigrist, Sep 20 2009

Keywords

Examples

			1!+3!+5! = 127 and 127 is prime, so 135 appears in the sequence.
		

Crossrefs

Cf. A061602.

Programs

  • PARI
    digfac(n)=local(s=0); while(n,s=s+((n%10)!);n=n\10);return(s)
    for(n=1,1000,if(isprime(digfac(n)),print1(n,", ")))
    
  • 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 A165451_gen(): # generator of terms
        for l in count(0):
            for i in range(1,10):
                fi = factorial(i)
                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(factorial,j))))
    A165451_list = list(islice(A165451_gen(),50)) # Chai Wah Wu, Feb 23 2023

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

Showing 1-10 of 44 results. Next