Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #20 Feb 01 2019 03:02:33
%S 1,1,1,2,1,2,3,1,2,6,1,2,9,1,2,8,5,6,5,1,4,18,3,3,13,7,4,10,5,6,15,3,
%T 8,12,2,6,33,9,3,12,9,10,17,3,8,42,7,6,21,9,6,22,17,9,9,5,16,54,5,6,
%U 57,13,8,17,9,18,29,8,9,30,11,12,69,13,7,17,12,22,23,8,26,78,9,8,43,25,12,36
%N a(n) is the number of triangular numbers, from among (T(1), T(2), T(3), ..., T(n)), which are coprime to T(n), where T(n) = n(n+1)/2 is the n-th triangular number.
%e T(10) = 10*11/2 = 55. The six triangular numbers which are coprime to 55 and are <= 55 are T(1)=1, T(2)=3, T(3)=6, T(6)=21, T(7)=28 and T(8)=36. So a(10) = 6.
%p a:=proc(n) local ct,i: ct:=0: for i from 1 to n do if gcd(i*(i+1)/2,n*(n+1)/2)=1 then ct:=ct+1 else ct:=ct fi: od: ct: end: seq(a(n),n=1..100); # _Emeric Deutsch_, Mar 24 2007
%o (PARI) a(n) = sum(k=1, n, gcd(n*(n+1)/2, k*(k+1)/2) == 1); \\ _Michel Marcus_, Feb 01 2019
%Y Cf. A000217.
%K nonn
%O 1,4
%A _Leroy Quet_, Mar 08 2007
%E More terms from _Emeric Deutsch_, Mar 24 2007