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-5 of 5 results.

A238456 Triangular numbers t such that t+x+y is a square, where x and y are the two squares nearest to t.

Original entry on oeis.org

0, 2211, 5151, 1107816, 20959575, 4237107540, 1564279847151, 61066162885575, 2533192954461975, 2774988107938203, 90728963274006291, 18765679728507154152720
Offset: 1

Views

Author

Alex Ratushnyak, Feb 26 2014

Keywords

Comments

For triangular numbers t such that t*x*y is a square, see A001110 (t is both triangular and square).
a(13) > 5*10^22. - Giovanni Resta, Mar 02 2014

Examples

			The two squares nearest to triangular(101)=5151 are 71^2 and 72^2. Because 5151 + 71^2 + 72^2 = 15376 is a perfect square, 5151 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    sqQ[n_]:=Module[{c=Floor[Sqrt[n]]-1,x},x=Total[Take[SortBy[ Range[ c,c+3]^2, Abs[#-n]&],2]];IntegerQ[Sqrt[n+x]]]; Select[ Accumulate[ Range[ 0, 5000000]], sqQ] (* This will generate the first 7 terms of the sequence.  To generate more, increase the second constant within the Range function, but computations will take a long time. *) (* Harvey P. Dale, May 12 2014 *)
  • Python
    def isqrt(a):
        sr = 1 << (int.bit_length(int(a)) >> 1)
        while a < sr*sr:  sr>>=1
        b = sr>>1
        while b:
            s = sr + b
            if a >= s*s:  sr = s
            b>>=1
        return sr
    t = i = 0
    while 1:
        t += i
        i += 1
        s = isqrt(t)
        if s*s==t:  s-=1
        txy = t + 2*s*(s+1) + 1   # t + s^2 + (s+1)^2
        r = isqrt(txy)
        if r*r==txy:  print(str(t), end=',')

Extensions

a(12) from Giovanni Resta, Mar 02 2014

A239071 Numbers k such that k+x+y is a triangular number (A000217), where x and y are the two triangular numbers nearest to k.

Original entry on oeis.org

0, 2, 6, 11, 19, 39, 53, 84, 104, 122, 146, 195, 225, 285, 321, 352, 392, 434, 470, 516, 605, 657, 757, 815, 864, 926, 990, 1044, 1112, 1241, 1315, 1455, 1535, 1602, 1686, 1844, 1934, 2103, 2199, 2279, 2379, 2481, 2566, 2672, 2870, 2982, 3191, 3309, 3407, 3529
Offset: 1

Views

Author

Alex Ratushnyak, Mar 10 2014

Keywords

Comments

If k is a triangular number then y=k.
The sequence of terms that are triangular numbers begins: 0, 6, 990, 189420, 36709596, 7120958130, 1381422007290, 267988648725336, 51988415041636920, 10085484510081574110.
Those are the triangular numbers with indices from A011916. - Ivan Neretin, May 31 2015

Examples

			The two triangular numbers nearest to 11 are 10 and 15. Because 10+11+15=36 is a triangular number, 11 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    Module[{nn=3600,trnos},trnos=Accumulate[Range[100]];Join[{0},Select[ Range[ nn],OddQ[Sqrt[8(Total[Nearest[trnos,#,2]]+#) +1]]&]]] (* Harvey P. Dale, Dec 19 2020 *)
  • PARI
    isok(k) = {my(x = k-1); while (! ispolygonal(x, 3), x--); my(y = k); while (! ispolygonal(y, 3), y++); ispolygonal(k+x+y, 3);} \\ Michel Marcus, May 31 2015
  • Python
    def isqrt(a):
        sr = 1 << (int.bit_length(int(a)) >> 1)
        while a < sr*sr:  sr>>=1
        b = sr>>1
        while b:
            s = sr + b
            if a >= s*s:  sr = s
            b>>=1
        return sr
    def isTriang(x):
        x+=x
        r = isqrt(x)
        return r*(r+1)==x
    print('0', end=', ')
    for n in range(777):
        tn = n*(n+1)//2
        tn1 = (n+1)*(n+2)//2
        for t in range(tn+1, tn1+1):
            if isTriang(tn+t+tn1): print(str(t), end=',')
    

A238599 Numbers k such that k+x+y is a perfect cube, where x and y are the two cubes nearest to k.

Original entry on oeis.org

0, 29, 171, 476, 1015, 1044, 1907, 3142, 4815, 7093, 9882, 13313, 17452, 22580, 28393, 35118, 42821, 43120, 51939, 61874, 72991, 85835, 99604, 114759, 131366, 150192, 170009, 191482, 214677, 240625, 267588, 296477, 327358, 361568, 396775, 434178, 473843, 475306, 517455
Offset: 1

Views

Author

Alex Ratushnyak, Mar 01 2014

Keywords

Examples

			The two cubes nearest to 0 are 0 and 1, and, because 0+0+1 is a perfect cube, 0 is in the sequence.
The two cubes nearest to 1 are 0 and 1, and, because 1+0+1=2 is not a perfect cube, 1 is not in the sequence.
The two cubes nearest to 29 are 27 and 8, and, because 29+27+8=64=4^3 is a perfect cube, 29 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    pcQ[n_]:=Module[{cr=Surd[n,3]},IntegerQ[Surd[Total[Nearest[Range[ Floor[ cr]-1,Ceiling[cr]+1]^3,n,2]]+n,3]]]; Select[Range[0,520000],pcQ] (* Harvey P. Dale, Jul 25 2018 *)
  • Python
    def icbrt(a):
        sr = 1 << (int.bit_length(int(a)) >> 1)
        while a < sr*sr*sr:  sr>>=1
        b = sr>>1
        while b:
            s = sr + b
            if a >= s*s*s:  sr = s
            b>>=1
        return sr
    for k in range(1000000):
        s = icbrt(k)
        if k and s*s*s==k:  s-=1
        d1 = abs(k-s**3)
        d2 = abs(k-(s+1)**3)
        d3 = abs(k-(s-1)**3)
        kxy = k + s**3 + (s+1)**3
        if s and d3
    				
  • Sage
    def gen_a():
        n = 1
        while True:
            for t in range(n*(n*n + 3), (n+1)*(n*n + 2*n + 4) + 1):
                c = t + (2*n + 1)*(n*n + n + 1)
                if round(floor(c^(1/3)))^3 == c:
                    yield t
            n += 1               # Ralf Stephan, Mar 09 2014

A239203 Numbers k such that k+x+y is a square and k+u+v is a triangular number, where x and y are the two squares nearest to k, while u and v are the two triangular numbers nearest to k.

Original entry on oeis.org

0, 11, 218987, 55844736, 8299697699240, 2585386023324464
Offset: 1

Views

Author

Alex Ratushnyak, Mar 12 2014

Keywords

Comments

Intersection of A239071 and A238489.

Examples

			11 is in the sequence because the two squares nearest to 11 are 9 and 16 and 11+9+16=36 is a square, and also the two triangular numbers nearest to 11 are 10 and 15, and 11+10+15=36 is a triangular number.
Similarly, 218987 is in the sequence because 218987+467^2+468^2=656100 is a square, and 218987+triangular(661)+triangular(662)=657231 is a triangular number.
		

Crossrefs

Extensions

a(5)-a(6) from Lars Blomberg, Jan 12 2016

A269569 Numbers k such that k+s+c is a square, where s is the nearest square to k and c is the nearest cube to k.

Original entry on oeis.org

0, 2, 4, 8, 29, 37, 45, 56, 68, 80, 92, 99, 115, 235, 257, 279, 413, 593, 751, 791, 831, 909, 955, 1001, 1396, 1450, 1504, 1572, 1961, 2019, 2087, 2500, 2576, 3093, 3634, 3720, 4129, 4223, 4317, 4522, 4624, 4726, 5816, 5928, 6040, 7110, 7232, 7354, 7535, 7665, 8368, 8500
Offset: 1

Views

Author

Alex Ratushnyak, Feb 29 2016

Keywords

Examples

			The square nearest to 8 is 9, the cube nearest to 8 is 8. Because 8+8+9 is a square, 8 is in the sequence.
The square nearest to 29 is 25, the cube nearest to 29 is 27. Because 29+25+27 is a square, 29 is in the sequence.
		

Crossrefs

Showing 1-5 of 5 results.