login
Final digits of the smallest triangular number starting with n!.
2

%I #8 Dec 25 2017 14:28:07

%S 0,1,6,15,90,10,3,9003,45300,9570,5840220,533564010,5384225220,

%T 412190739351,244816773411,682660400311,275258914747246,

%U 710284752537711,152042178127701610,6144469158651504786,8516189439015621936

%N Final digits of the smallest triangular number starting with n!.

%e a(7) = 3 because the smallest triangular number starting with 7!=5040 is 50403 and so the last digit is 3.

%o (PARI) { A096565(n) = my(k,t); k=1; while(1, t=sqrtint(n!*8*10^k)+1; if(t%2==0,t++); t=(t^2-1)/8; if( t\10^k == n!, return(t%10^k)); k++ ); } \\ _Max Alekseyev_, Apr 25 2009

%Y Cf. A096564.

%K base,nonn

%O 1,3

%A _Jason Earls_, Jun 26 2004

%E Extended by _Max Alekseyev_, Apr 25 2009