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.

A227219 Smallest triangular number ending in at least n 5's.

This page as a plain text file.
%I A227219 #23 May 04 2024 11:58:03
%S A227219 15,55,6555,2235555,717655555,13140555555,9206385555555,
%T A227219 1551745755555555,103835341555555555,26427628585555555555,
%U A227219 2262637355455555555555,8808604932555555555555,4704913988655555555555555,4704913988655555555555555,19391196055786555555555555555
%N A227219 Smallest triangular number ending in at least n 5's.
%C A227219 If a triangular number ends in like digits then it can only end in 0's, 1's, 5's or 6's.
%H A227219 Chai Wah Wu, <a href="/A227219/b227219.txt">Table of n, a(n) for n = 1..501</a>
%e A227219 a(3)=6555 because 6555 is the smallest triangular number ending in 3 '5's.
%t A227219 t = {}; Do[Do[x = n*(n + 1)/2;If[Mod[x, 10^m] == 5*(10^m - 1)/9, AppendTo[t, x]; Break[]], {n, 1, 10^m}], {m, 1, 10}]; t
%t A227219 a[n_] := Block[{x, y, s}, s = y /. List@ ToRules[ Reduce[(y+1)* y/2 == x*10^n + 5*(10^n - 1)/9 && y > 0 && x >= 0, {y, x}, Integers] /. C[1] -> 0]; Min[s*(s + 1)/2]]; Array[a, 20] (* _Giovanni Resta_, Sep 20 2013 *)
%o A227219 (Python)
%o A227219 from sympy import sqrt_mod_iter
%o A227219 def A227219(n):
%o A227219     k, a = 10**n<<1, 10*(10**n-1)//9
%o A227219     m = (a<<2)+1
%o A227219     return min(b for b in ((d>>1)*((d>>1)+1) for d in sqrt_mod_iter(m, k) if d&1) if b%k==a)>>1 # _Chai Wah Wu_, May 04 2024
%Y A227219 Cf. A000217, A187127, A227218, A227220.
%K A227219 nonn,base
%O A227219 1,1
%A A227219 _Shyam Sunder Gupta_, Sep 19 2013
%E A227219 a(1) corrected and a(11)-a(15) from _Giovanni Resta_, Sep 20 2013
%E A227219 Name clarified by _Michel Marcus_, Sep 05 2019