login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A229909 Triangular numbers t such that the following are three triangular numbers: x, y, x+y, where x and y are distances from t to the two nearest squares. 1
1, 2080, 8038045 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
No more terms through 10^34. - Jon E. Schoenfield, Feb 09 2014
LINKS
EXAMPLE
2080 is in the sequence because the following three are triangular numbers:
2080-2025 = 55,
2116-2080 = 36,
55 + 36 = 91.
2025 = 45^2 and 2116 = 46^2 are the nearest to 2080 squares.
MATHEMATICA
ttnQ[n_]:=Module[{s=Sqrt[n], x, y}, x=If[IntegerQ[s], n-(s-1)^2, n- Floor[ s]^2]; y=If[IntegerQ[s], (s+1)^2-n, Ceiling[s]^2-n]; AllTrue[ {Sqrt[ 8x+1], Sqrt[8y+1], Sqrt[8(x+y)+1]}, OddQ]]; Join[{1}, Select[Accumulate[ Range[10000]], ttnQ]] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, May 30 2015 *)
PROG
(Python)
import math
def isTriangular(a):
a+=a
sr = int(math.sqrt(a))
return (a==sr*(sr+1))
for n in range(1, 1000000000L):
tn = n*(n+1)/2 # = x+y = distance between squares
if tn&1:
k = tn>>1
k*= k # square below t
a = int(math.sqrt(k*2))
t = a*(a+1)/2
if t <= k:
a+=1
t+=a
ktn = k+tn # square above t
while t <= ktn: # check if x and y are triangular:
if isTriangular(t-k) and isTriangular(ktn-t):
print t
a+=1
t+=a
if (n&0xfffff)==0: print '.',
CROSSREFS
Sequence in context: A071235 A259414 A233088 * A323813 A323472 A224438
KEYWORD
nonn,bref,hard,more
AUTHOR
Alex Ratushnyak, Dec 19 2013
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 4 07:29 EDT 2024. Contains 374905 sequences. (Running on oeis4.)