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 A052343 #48 Aug 30 2025 20:29:49 %S A052343 1,1,1,1,1,0,2,1,0,1,1,1,1,1,0,1,2,0,1,0,1,2,1,0,1,1,0,1,1,1,1,2,0,0, %T A052343 1,0,2,1,1,1,0,0,2,1,0,1,2,0,1,1,0,2,0,0,0,2,2,1,1,0,1,1,0,0,1,1,2,1, %U A052343 0,1,1,0,2,1,0,0,2,0,1,1,0,3,0,1,1,0,0,1,1,0,1,2,1,1,2,0,0,1,0,1,1,1 %N A052343 Number of ways to write n as the unordered sum of two triangular numbers (zero allowed). %C A052343 Number of ways of writing n as a sum of a square and twice a triangular number (zeros allowed). - _Michael Somos_, Aug 18 2003 %C A052343 a(A020757(n))=0; a(A020756(n))>0; a(A119345(n))=1; a(A118139(n))>1. - _Reinhard Zumkeller_, May 15 2006 %C A052343 Also, number of ways to write 4n+1 as the unordered sum of two squares of nonnegative integers. - _Vladimir Shevelev_, Jan 21 2009 %C A052343 The average value of a(n) for n <= x is Pi/4 + O(1/sqrt(x)). - _Vladimir Shevelev_, Feb 06 2009 %H A052343 Reinhard Zumkeller, <a href="/A052343/b052343.txt">Table of n, a(n) for n = 0..10000</a> %H A052343 Vladimir Shevelev, <a href="https://arxiv.org/abs/0901.3102">Binary additive problems: recursions for numbers of representations</a>, arXiv:0901.3102 [math.NT], 2009-2013. %H A052343 Vladimir Shevelev, <a href="https://arxiv.org/abs/0902.1046">Binary additive problems: theorems of Landau and Hardy-Littlewood type</a>, arXiv:0902.1046 [math.NT], 2009-2012. %F A052343 a(n) = ceiling(A008441(n)/2). - _Reinhard Zumkeller_, Nov 03 2009 %F A052343 G.f.: (Sum_{k>=0} x^(k^2 + k)) * (Sum_{k>=0} x^(k^2)). - _Michael Somos_, Aug 18 2003 %F A052343 Recurrence: a(n) = Sum_{k=1..r(n)} r(2n-k^2+k) - C(r(n),2) - a(n-1) - a(n-2) - ... - a(0), n>=1,a (0)=1, where r(n)=A000194(n+1) is the nearest integer to square root of n+1. For example, since r(6)=3, a(6) = r(12) + r(10) + r(6) - C(3,2) - a(5) - ... - a(0) = 4 + 3 + 3 - 3 - 0 - 1 - 1 - 1 - 1 - 1 = 2. - _Vladimir Shevelev_, Feb 06 2009 %F A052343 a(n) = A025426(8n+2). - _Max Alekseyev_, Mar 09 2009 %F A052343 a(n) = (A002654(4n+1) + A010052(4n+1)) / 2. - _Ant King_, Dec 01 2010 %F A052343 a(2*n + 1) = A053692(n). a(4*n + 1) = A259287(n). a(4*n + 3) = A259285(n). a(6*n + 1) = A260415(n). a(6*n + 4) = A260516(n). - _Michael Somos_, Jul 28 2015 %F A052343 a(3*n) = A093518(n). a(3*n + 1) = A121444(n). a(9*n + 2) = a(n). a(9*n + 5) = a(9*n + 8) = 0. - _Michael Somos_, Jul 28 2015 %F A052343 Convolution of A005369 and A010052. - _Michael Somos_, Jul 28 2015 %e A052343 G.f. = 1 + x + x^2 + x^3 + x^4 + 2*x^6 + x^7 + x^9 + x^10 + x^11 + ... %p A052343 A052343 := proc(n) %p A052343 local a,t1idx,t2idx,t1,t2; %p A052343 a := 0 ; %p A052343 for t1idx from 0 do %p A052343 t1 := A000217(t1idx) ; %p A052343 if t1 > n then %p A052343 break; %p A052343 end if; %p A052343 for t2idx from t1idx do %p A052343 t2 := A000217(t2idx) ; %p A052343 if t1+t2 > n then %p A052343 break; %p A052343 elif t1+t2 = n then %p A052343 a := a+1 ; %p A052343 end if; %p A052343 end do: %p A052343 end do: %p A052343 a ; %p A052343 end proc: # _R. J. Mathar_, Apr 28 2020 %t A052343 Length[PowersRepresentations[4 # + 1, 2, 2]] & /@ Range[0, 101] (* _Ant King_, Dec 01 2010 *) %t A052343 d1[k_]:=Length[Select[Divisors[k],Mod[#,4]==1&]];d3[k_]:=Length[Select[Divisors[k],Mod[#,4]==3&]];f[k_]:=d1[k]-d3[k];g[k_]:=If[IntegerQ[Sqrt[4k+1]],1/2 (f[4k+1]+1),1/2 f[4k+1]];g[#]&/@Range[0,101] (* _Ant King_, Dec 01 2010 *) %t A052343 a[ n_] := Length @ Select[ Table[ Sqrt[n - i - i^2], {i, 0, Quotient[ Sqrt[4 n + 1] - 1, 2]}], IntegerQ]; (* _Michael Somos_, Jul 28 2015 *) %t A052343 a[ n_] := Length @ FindInstance[ {j >= 0, k >= 0, j^2 + k^2 + k == n}, {k, j}, Integers, 10^9]; (* _Michael Somos_, Jul 28 2015 *) %o A052343 (PARI) {a(n) = if( n<0, 0, sum(i=0, (sqrtint(4*n + 1) - 1)\2, issquare(n - i - i^2)))}; /* _Michael Somos_, Aug 18 2003 */ %o A052343 (Haskell) %o A052343 a052343 = (flip div 2) . (+ 1) . a008441 %o A052343 -- _Reinhard Zumkeller_, Jul 25 2014 %Y A052343 Cf. A000217, A052344, A052345 (greedy inverse), A052346, A052347, A052348, A053587, A056303, A056304. %Y A052343 Cf. A053692, A093518, A121444, A259285, A259287, A260415, A260516. %Y A052343 Cf. A005369, A010052. %K A052343 nonn,changed %O A052343 0,7 %A A052343 _Christian G. Bower_, Jan 23 2000