login
Smallest triangular number divisible by 10^n.
2

%I #20 Jul 26 2022 01:35:53

%S 10,300,195000,43950000,4106400000,396606000000,25271610000000,

%T 83084100000000,22661209000000000,1596879960000000000,

%U 3344565630000000000000,3344565630000000000000,3344565630000000000000,1795096118003100000000000000,33778738696128000000000000000

%N Smallest triangular number divisible by 10^n.

%H Chai Wah Wu, <a href="/A228188/b228188.txt">Table of n, a(n) for n = 1..501</a>

%F a(n) = A228191(n)*(A228191(n)+1)/2. - _Chai Wah Wu_, Jul 25 2022

%e a(2)=300 because 300 is the smallest triangular number divisible by 10^2.

%t sol[k_, u_] := Block[{x}, Min[x /. List@ToRules[Reduce[Mod[x + u, 2*2^k] == 0 && Mod[x + 1 - u, 5^k] == 0 && x > 0, {x}, Integers] /. C[1] -> 0]]]; a[n_] := Min[sol[n, 0], sol[n, 1]]; p = a /@ Range[15]; p*(p+1)/2

%o (Python)

%o from sympy.ntheory.modular import crt

%o def A228188(n): return (k:=int(min(crt(m:=(1<<(n+1),5**n),(0,-1))[0], crt(m,(-1,0))[0])))*(k+1)>>1 # _Chai Wah Wu_, Jul 25 2022

%Y Cf. A000217, A228191.

%K nonn,base

%O 1,1

%A _Shyam Sunder Gupta_, Aug 15 2013