This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A160651 #22 May 28 2018 10:42:37 %S A160651 1,2,2,3,2,2,4,2,4,2,4,4,2,4,2,4,4,2,4,2,3,6,2,8,2,2,4,4,8,2,2,4,2,4, %T A160651 2,2,8,4,4,2,4,8,2,4,4,4,6,2,4,6,2,4,4,6,4,4,4,4,6,4,2,8,4,4,4,2,8,4, %U A160651 4,2,2,6,2,4,4,4,4,4,12,2,4,4,2,4,2,2,8,2,8,4,2,8,4,8,4,8,8,2,4,2,2,8,2,6,2 %N A160651 a(n) is the number of triangular nonnegative integers that are each equal to n(n+1)/2 - m(m+1)/2, for some m's where 0 <= m <= n. %H A160651 Alois P. Heinz, <a href="/A160651/b160651.txt">Table of n, a(n) for n = 0..10000</a> %F A160651 a(n) == 1 (mod 2) <=> n in { A001652 }. - _Alois P. Heinz_, May 27 2018 %e A160651 For n = 6, the values of n(n+1)/2 - m(m+1)/2, 0 <= m <= n, are 21, 20, 18, 15, 11, 6, and 0. Of these, 21, 15, 6, and 0 are triangular numbers, so a(6) = 4. %p A160651 a:= n-> add(`if`(issqr(4*(n+m+1)*(n-m)+1), 1, 0), m=0..n): %p A160651 seq(a(n), n=0..100); # _Alois P. Heinz_, May 27 2018 %o A160651 (PARI) a(n) = sum(m=0, n, ispolygonal(n*(n+1)/2 - m*(m+1)/2, 3)); \\ _Michel Marcus_, May 27 2018 %Y A160651 Cf. A000217, A001652, A049777, A049780. %K A160651 nonn %O A160651 0,2 %A A160651 _Leroy Quet_, May 21 2009 %E A160651 Extended by _Ray Chandler_, Jun 16 2009