Factorion

Factorion

A factorion is a natural number that equals the sum of the factorials of its decimal digits. For example, 145 is a factorion because 1! + 4! + 5! = 1 + 24 + 120 = 145.

There are just four factorions and they are 1, 2, 145 and 40585 OEIS|id=A014080.

Upper bound

If "n" is a natural number of "d" digits that is a factorion, then 10"d" − 1 ≤ "n" ≤ 9!"d" and this fails to hold for "d" ≥ 8. Thus "n" has 7 digits at most and the first upper bound is 9,999,999. But the maximum sum of factorials of digits for a 7 digit number is 9!7 = 2540160, which is the second upper bound.

Code

Some Haskell code to compute factorions. Be sure to compile it with -O2 or your memory will be exhausted.

main = print $ filter (isFactorion 10) [1..2540160] factList = scanl (*) 1 [1..] quickFact n = factList !! n digitlist 0 _ = [] digitlist num base = let digit = mod num base in digit : digitlist (div (num - digit) base) base sumOfFactOfDigits base n = sum $ map quickFact $ digitlist n base isFactorion base n = n = sumOfFactOfDigits base n

And the code to compute the list of all factorions.

import Data.Char (digitToInt) main = print $ [i | i <- [1..2540160] , i = (sum $ map (i -> product [1..i] ) $ map digitToInt $ show i)]

References

* [http://www.daviddarling.info/encyclopedia/F/factorion.html factorion at daviddarling.info/encyclopedia]
* [http://mathworld.wolfram.com/Factorion.html factorion at Wolfram MathWorld]


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Factorion — Un factorion est un entier naturel qui est égal à la somme des factorielles de ses chiffres. Par exemple, 145 est un factorion en écriture décimale car 1! + 4! + 5! = 1 + 24 + 120 = 145. En écriture décimale, il n y a que quatre factorions, ce… …   Wikipédia en Français

  • Clifford A. Pickover — Nationality United States of America Fields …   Wikipedia

  • Factorial — n n! 0 1 1 1 2 2 3 6 4 24 5 120 6 720 7 …   Wikipedia

  • 145 (number) — 145 is the natural number following 144 and preceding 146. In mathematics * Although composite, 145 is a pseudoprime.* Given 145, the Mertens function returns 0.* 145 is a pentagonal number and a centered square number.* 145 = 12^2 + 1^2 = 8^2 +… …   Wikipedia

  • List of mathematics articles (F) — NOTOC F F₄ F algebra F coalgebra F distribution F divergence Fσ set F space F test F theory F. and M. Riesz theorem F1 Score Faà di Bruno s formula Face (geometry) Face configuration Face diagonal Facet (mathematics) Facetting… …   Wikipedia

  • 40000 (number) — Number number = 40000 range = 10000 100000 cardinal = 40000 ordinal = th ordinal text = thirty thousandth factorization = 2^6 cdot 5^4 bin = 1001110001000000 oct = 116100 hex = 9C4040,000 (forty thousand) is the number that comes after 39,999 and …   Wikipedia

  • 145 (nombre) — Cet article est relatif au nombre 145. Pour l année, voir 145. 145 (nombre) Cardinal Cent quarante cinq Ordinal Cent quarante cinquième 145e Préfixe grec …   Wikipédia en Français

  • 40585 — (quarante mille cinq cent quatre vingt cinq) est le plus grand nombre entier égal à la somme des factorielles de ses chiffres en écriture décimale : 40585 = 4! + 0! + 5! + 8! + 5! Il n existe que trois autres nombres possédant la même… …   Wikipédia en Français

  • Liste des articles de mathematiques — Projet:Mathématiques/Liste des articles de mathématiques Cette page recense les articles relatifs aux mathématiques, qui sont liés aux portails de mathématiques, géométrie ou probabilités et statistiques via l un des trois bandeaux suivants  …   Wikipédia en Français

  • Clifford A. Pickover — Clifford Alan Pickover (* 15. August 1957) ist ein US amerikanischer Autor populärwissenschaftlicher Bücher über Mathematik und Naturwissenschaften sowie Wissenschaftsjournalist. Inhaltsverzeichnis 1 Biographie 2 Schriften 2.1 Sachbücher …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”