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.

A226789 Triangular numbers obtained as the concatenation of n+1 and n.

This page as a plain text file.
%I A226789 #18 Oct 22 2021 23:57:10
%S A226789 10,21,26519722651971,33388573338856,69954026995401,80863378086336
%N A226789 Triangular numbers obtained as the concatenation of n+1 and n.
%C A226789 There are only six terms less than 10^20.
%e A226789 26519722651971 is the concatenation of 2651972 and 2651971 and a triangular number, because 26519722651971 = 7282818*7282819/2.
%t A226789 TriangularQ[n_] := IntegerQ[Sqrt[1 + 8*n]]; t = {}; Do[s = FromDigits[Join[IntegerDigits[n+1], IntegerDigits[n]]]; If[TriangularQ[s], AppendTo[t, s]], {n, 100000}]; t (* _T. D. Noe_, Jun 18 2013 *)
%o A226789 (PARI)
%o A226789 concatint(a,b)=eval(concat(Str(a),Str(b)))
%o A226789 istriang(x)=issquare(8*x+1)
%o A226789 {for(n=1,10^7,a=concatint(n+1,n);if(istriang(a),print(a)))}
%o A226789 (Python)
%o A226789 from math import isqrt
%o A226789 def istri(n): t = 8*n+1; return isqrt(t)**2 == t
%o A226789 def afind(klimit, kstart=0):
%o A226789     strk = "0"
%o A226789     for k in range(kstart, klimit+1):
%o A226789         strkp1 = str(k+1)
%o A226789         t = int(strkp1 + strk)
%o A226789         if istri(t):
%o A226789             print(t, end=", ")
%o A226789         strk = strkp1
%o A226789 afind(81*10**5) # _Michael S. Branicky_, Oct 21 2021
%o A226789 (Python) # alternate version
%o A226789 def isconcat(n):
%o A226789     if n < 10: return False
%o A226789     s = str(n)
%o A226789     mid = (len(s)+1)//2
%o A226789     lft, rgt = int(s[:mid]), int(s[mid:])
%o A226789     return lft - 1 == rgt
%o A226789 def afind(tlimit, tstart=0):
%o A226789     for t in range(tstart, tlimit+1):
%o A226789         trit = t*(t+1)//2
%o A226789         if isconcat(trit):
%o A226789             print(trit, end=", ")
%o A226789 afind(13*10**6) # _Michael S. Branicky_, Oct 21 2021
%Y A226789 Cf. A003098, A068899, A226742, A226772, A226788.
%K A226789 nonn,base,more
%O A226789 1,1
%A A226789 _Antonio Roldán_, Jun 18 2013