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.

A226742 Triangular numbers obtained as the concatenation of 2*k and k.

Original entry on oeis.org

21, 105, 2211, 9045, 222111, 306153, 742371, 890445, 1050525, 22221111, 88904445, 107905395, 173808690, 2222211111, 8889044445, 12141260706, 15754278771, 222222111111, 888890444445, 22222221111111, 36734701836735, 65306123265306
Offset: 1

Views

Author

Antonio Roldán, Jun 18 2013

Keywords

Comments

Includes (2*10^k+1)*(10^k-1)/9 and (2*10^k+1)*(4*10^k+5)/9 for k >= 1. - Robert Israel, Feb 06 2025

Examples

			If k=111, 2k=222, 2k//k = 222111 = 666*667/2, a triangular number.
		

Crossrefs

Programs

  • Maple
    g:= proc(d) local a, b, n, Res, x, y;
          Res:= NULL:
          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 y >= 10^d  then next fi;
            Res:= Res, (2*10^d+1)*y
          od;
          op(sort([Res]))
    end proc:
    map(g, [$1..10]); # Robert Israel, Feb 06 2025
  • Mathematica
    TriangularQ[n_] := IntegerQ[Sqrt[1 + 8*n]]; t = {}; Do[s = FromDigits[Join[IntegerDigits[2*n], 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^5,a=concatint(2*n,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

A226752 Possible total sums of three 3-digit primes that together use all nonzero digits 1-9.

Original entry on oeis.org

999, 1089, 1107, 1197, 1269, 1287, 1323, 1341, 1359, 1377, 1413, 1431, 1449, 1467, 1521, 1539, 1557, 1593, 1611, 1629, 1647, 1683, 1701, 1737, 1773, 1791, 1809, 1827, 1863, 1881, 1899, 1917, 1953, 1971, 1989, 2007, 2043, 2061, 2133, 2151, 2223, 2241, 2331, 2421
Offset: 1

Views

Author

Harvey P. Dale, Jun 16 2013

Keywords

Comments

Split permutations of the digits 1 through 9 into three-digit parts, treat each part as a number, and total those numbers. The sequence contains all of the possible sums.

Examples

			149 + 263 + 587 = 999, and 149, 263, and 587 are all primes, so 999 is a (the smallest) term of the sequence.  653 + 827 + 941 = 2421, and 653, 827, and 941 are all primes, so 2421 is a (the largest) term of the sequence.
		

References

  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers (Rev. ed. 1997), p. 149 (entry for 999).

Crossrefs

Programs

  • Mathematica
    Union[Transpose[Join[#,{Total[#]}]&/@(FromDigits/@Partition[#,3]&/@ Select[Permutations[Range[9]],And@@PrimeQ[FromDigits/@ Partition[ #,3]]&])][[4]]]
  • Python
    from sympy import isprime
    from itertools import permutations
    aset = set()
    for p in permutations("123456789"):
        p = [int("".join(p[i*3:(i+1)*3])) for i in range(3)]
        if all(isprime(pi) for pi in p): aset.add(sum(p))
    print(sorted(aset)) # Michael S. Branicky, Jun 28 2021

Extensions

Name clarified by Tanya Khovanova, Jul 05 2021
Showing 1-4 of 4 results.