login
Largest prime factor in the subfactorial of n.
4

%I #10 Jul 31 2022 07:46:14

%S 2,3,11,53,103,163,41,16481,1468457,1456321,139241,1796801,

%T 34361893981,15549624751,461702183,65026777,893977617157,17562703393,

%U 482455223267,85836476923,352463,809358677,499243508845229,1802157757041847990541

%N Largest prime factor in the subfactorial of n.

%H Amiram Eldar, <a href="/A152024/b152024.txt">Table of n, a(n) for n = 3..81</a>

%H Dario Alpern, <a href="https://www.alpertron.com.ar/ECM.HTM">Factorization using the Elliptic Curve Method</a>.

%H Amiram Eldar, <a href="/A152024/a152024.txt">Table of prime factors of A000166(n) for n = 3..81</a> (calculated with Dario Alpern's ECM)

%F a(n) = A006530(A000166(n)). - _Amiram Eldar_, Jul 31 2022

%e For n=5 (the third member of the sequence), the number of derangements is 44, thus a(5) = 11, the largest prime factor of 44.

%t Table[FactorInteger[Subfactorial[n]][[-1, 1]], {n, 3, 30}] (* _Amiram Eldar_, Jul 31 2022 *)

%o (PARI) a(n) = {fn = factor(round(n!/exp(1))); fn[#fn[, 1], 1]} \\ _Michel Marcus_, Jun 01 2013

%Y Cf. A000166, A006530.

%K nonn

%O 3,1

%A Albert Moes (albertmoes(AT)freeler.nl), Nov 20 2008

%E Corrected and extended by _Michel Marcus_, Jun 01 2013