%I #17 Feb 07 2014 19:34:54
%S 1,55,28,136,6670,1378,18528,3828,3,3403,39340,75466,12403,179101,
%T 24310,6,22791,290703,37675,679195,10,66430,550107865,23981275,
%U 188170300,30548836,2303731,721801,28474831,311538241,13741903,37130653,441149289778,278657028
%N Sequence of distinct least positive triangular numbers such that the arithmetic mean of the first n terms is also a triangular number. Initial term is 1.
%C Sequence is believed to be infinite.
%e a(1) = 1.
%e a(2) is the least triangular number such that (a(1)+a(2))/2 is also triangular. So, a(2) = 55.
%e a(3) is the least triangular number such that (a(1)+a(2)+a(3))/3 is also triangular. So, a(3) = 28.
%e ...and so on.
%o (Python)
%o def Tri(x):
%o ..for n in range(10**10):
%o ....if x == n*(n+1)/2:
%o ......return True
%o ....if x < n*(n+1)/2:
%o ......return False
%o ..return False
%o def TriAve(init):
%o ..print(init)
%o ..lst = []
%o ..lst.append(init)
%o ..n = 1
%o ..while n*(n+1)/2 < 10**10:
%o ....if n*(n+1)/2 not in lst:
%o ......if Tri(((sum(lst)+int(n*(n+1)/2))/(len(lst)+1))):
%o ........print(int(n*(n+1)/2))
%o ........lst.append(int(n*(n+1)/2))
%o ........n = 1
%o ......else:
%o ........n += 1
%o ....else:
%o ......n += 1
%Y Cf. A000217.
%K nonn
%O 1,2
%A _Derek Orr_, Jan 25 2014
%E Qualifier "positive" added to definition (otherwise, a(4) would be 0) by _Jon E. Schoenfield_, Feb 07 2014
%E a(33)-a(34) from _Jon E. Schoenfield_, Feb 07 2014
|