OFFSET
1,2
COMMENTS
Sequence is believed to be infinite. If a(31) exists, it will be greater than 10^10.
a(31)=22663524351. - Jon E. Schoenfield, Feb 07 2014
EXAMPLE
a(1) = 0.
a(2) must be a triangular number such that (a(1)+a(2))/2 is triangular. Thus, a(1) = 6.
a(3) must be a triangular number such that (a(1)+a(2)+a(3))/3 is triangular. Thus, a(3) = 3.
...and so on
PROG
(Python)
def Tri(x):
..for n in range(10**10):
....if x == n*(n+1)/2:
......return True
....if x < n*(n+1)/2:
......return False
..return False
def TriAve(init):
..print(init)
..lst = []
..lst.append(init)
..n = 1
..while n*(n+1)/2 < 10**10:
....if n*(n+1)/2 not in lst:
......if Tri(((sum(lst)+int(n*(n+1)/2))/(len(lst)+1))):
........print(int(n*(n+1)/2))
........lst.append(int(n*(n+1)/2))
........n = 1
......else:
........n += 1
....else:
......n += 1
CROSSREFS
KEYWORD
nonn
AUTHOR
Derek Orr, Jan 25 2014
EXTENSIONS
More terms from Jon E. Schoenfield, Feb 07 2014
STATUS
approved