login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A238456 Triangular numbers t such that t+x+y is a square, where x and y are the two squares nearest to t. 2
0, 2211, 5151, 1107816, 20959575, 4237107540, 1564279847151, 61066162885575, 2533192954461975, 2774988107938203, 90728963274006291, 18765679728507154152720 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

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

LINKS

Table of n, a(n) for n=1..12.

EXAMPLE

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.

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 *)

PROG

(Python)

def isqrt(a):

    sr = 1L << (long.bit_length(long(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)+', ',

CROSSREFS

Cf. A000217, A000290, A001110, A238489.

Sequence in context: A305880 A031545 A191679 * A031725 A077693 A253735

Adjacent sequences:  A238453 A238454 A238455 * A238457 A238458 A238459

KEYWORD

nonn,hard,more

AUTHOR

Alex Ratushnyak, Feb 26 2014

EXTENSIONS

a(12) from Giovanni Resta, Mar 02 2014

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 29 05:39 EDT 2020. Contains 333105 sequences. (Running on oeis4.)