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.

Showing 1-4 of 4 results.

A226772 Triangular numbers obtained as the concatenation of n and 2n.

Original entry on oeis.org

36, 1326, 2346, 3570, 125250, 223446, 12502500, 22234446, 1250025000, 2066441328, 2222344446, 2383847676, 3673573470, 125000250000, 222223444446, 5794481158896, 12500002500000, 12857132571426, 22222234444446, 49293309858660, 804878916097578, 933618918672378, 971908519438170
Offset: 1

Views

Author

Antonio Roldán, Jun 18 2013

Keywords

Comments

Includes 125*10^(2*k+1)+25*10^k and (10^k+2)*(1+(10^k-1)*2/9) for k >= 1. - Robert Israel, Nov 09 2020

Examples

			If n=23, 2n=46, n//2n = 2346 = 68*69/2, a triangular number.
		

Crossrefs

Programs

  • Maple
    F:= proc(d) local D,R,M,m,w,x,x1,x2;
       R:= NULL;
       M:= 10^d/2+1;
       D:= numtheory:-divisors(M);
       for m in D do if igcd(m,M/m)=1 then
         for w in [chrem([-1,1],[8*m,M/m]), chrem([1,-1],[8*m,M/m])] do
         x:= (w^2-1)/8;
         x1:= x mod 10^d;
         x2:= floor(x/10^d);
         if x1 = 2*x2 and x1 >= 10^(d-1) then R:= R, x fi
       od fi od;
       op(sort([R]))
    end proc:
    36, seq(F(d),d=2..10); # Robert Israel, Nov 09 2020
  • Mathematica
    TriangularQ[n_] := IntegerQ[Sqrt[1 + 8*n]]; t = {}; Do[s = FromDigits[Join[IntegerDigits[n], IntegerDigits[2*n]]]; If[TriangularQ[s], AppendTo[t, s]], {n, 100000}]; t (* T. D. Noe, Jun 18 2013 *)
  • PARI
    concatint(a,b)=eval(concat(Str(a),Str(b)))
    istriang(x)=issquare(8*x+1)
    {for(n=1,10^5,a=concatint(n,2*n);if(istriang(a),print(a)))}

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

Original entry on oeis.org

45, 78, 4950, 5253, 295296, 369370, 415416, 499500, 502503, 594595, 652653, 760761, 22542255, 49995000, 50025003, 88278828, 1033010331, 1487714878, 4999950000, 5000250003, 490150490151, 499999500000, 500002500003, 509949509950, 33471093347110, 49999995000000, 50000025000003
Offset: 1

Views

Author

Antonio Roldán, Jun 18 2013

Keywords

Examples

			If n=295, n//n+1 = 295296 = 768*769/2, a triangular number.
		

Crossrefs

Programs

  • Mathematica
    TriangularQ[n_] := IntegerQ[Sqrt[1 + 8*n]]; t = {}; Do[s = FromDigits[Join[IntegerDigits[n], IntegerDigits[n+1]]]; If[TriangularQ[s], AppendTo[t, s]], {n, 100000}]; t (* T. D. Noe, Jun 18 2013 *)
    Select[FromDigits[Join[Flatten[IntegerDigits[#]]]]&/@Partition[ Range[ 5000010],2,1], OddQ[Sqrt[8#+1]]&] (* Harvey P. Dale, Jun 11 2015 *)
  • PARI
    concatint(a,b)=eval(concat(Str(a),Str(b)))
    istriang(x)=issquare(8*x+1)
    {for(n=1,10^7,a=concatint(n,n+1);if(istriang(a),print(a)))}

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

Original entry on oeis.org

10, 21, 26519722651971, 33388573338856, 69954026995401, 80863378086336
Offset: 1

Views

Author

Antonio Roldán, Jun 18 2013

Keywords

Comments

There are only six terms less than 10^20.

Examples

			26519722651971 is the concatenation of 2651972 and 2651971 and a triangular number, because 26519722651971 = 7282818*7282819/2.
		

Crossrefs

Programs

  • Mathematica
    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 *)
  • PARI
    concatint(a,b)=eval(concat(Str(a),Str(b)))
    istriang(x)=issquare(8*x+1)
    {for(n=1,10^7,a=concatint(n+1,n);if(istriang(a),print(a)))}
    
  • Python
    from math import isqrt
    def istri(n): t = 8*n+1; return isqrt(t)**2 == t
    def afind(klimit, kstart=0):
        strk = "0"
        for k in range(kstart, klimit+1):
            strkp1 = str(k+1)
            t = int(strkp1 + strk)
            if istri(t):
                print(t, end=", ")
            strk = strkp1
    afind(81*10**5) # Michael S. Branicky, Oct 21 2021
    
  • Python
    # alternate version
    def isconcat(n):
        if n < 10: return False
        s = str(n)
        mid = (len(s)+1)//2
        lft, rgt = int(s[:mid]), int(s[mid:])
        return lft - 1 == rgt
    def afind(tlimit, tstart=0):
        for t in range(tstart, tlimit+1):
            trit = t*(t+1)//2
            if isconcat(trit):
                print(trit, end=", ")
    afind(13*10**6) # Michael S. Branicky, Oct 21 2021

A380792 a(n) is the largest triangular number that is the concatenation of two n-digit numbers 2*x and x.

Original entry on oeis.org

21, 9045, 890445, 88904445, 8889044445, 888890444445, 88888904444445, 8888889044444445, 888888890444444445, 88888888904444444445, 8888888889044444444445, 973609801090486804900545, 88888888888904444444444445, 8888888888889044444444444445, 931379640537060465689820268530
Offset: 1

Views

Author

Robert Israel, Feb 04 2025

Keywords

Comments

a(n) is the largest triangular number of the form (2*10^n+1)*x where 10^(n-1) <= x < 10^n / 2.
For n >= 2, (2*10^n+1)*(4*(10^n-1)/9+1) = t * (t+1)/2 where t = (4*10^n + 2)/3, so this is a triangular number of that form. Thus a(n) >= (2*10^n+1)*(4*(10^n-1)/9+1).

Examples

			a(3) = 890445 because 890445 = 1334 * 1335/2 is a triangular number and is the concatenation of the two 3-digit numbers 890 = 2*445 and 445, and no larger number works.
		

Crossrefs

Programs

  • Maple
    g:= proc(d) local a,b,n, ymax,x,y;
          ymax:= -1;
          for a in numtheory:-divisors(2*(2*10^d+1)) do
            b:= 2*(2*10^d+1)/a;
            if igcd(a,b)>1 then next fi;
            n:= chrem([0,-1],[a,b]);
            x:= n*(n+1)/2;
            y:= x/(2*10^d+1);
            if y < 10^(d-1) or 2*y >= 10^d then next fi;
            if y > ymax then ymax:= y fi
          od;
          (2*10^d+1)*ymax
    end proc:
    map(g, [$1..25]);
Showing 1-4 of 4 results.