login
This site is supported by donations to The OEIS Foundation.

 

Logo

Annual Appeal: Today, Nov 11 2014, is the 4th anniversary of the launch of the new OEIS web site. 70,000 sequences have been added in these four years, all edited by volunteers. Please make a donation (tax deductible in the US) to help keep the OEIS running.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A052343 Number of ways to write n as the unordered sum of two triangular numbers (zero allowed). 18

%I

%S 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 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 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 Number of ways to write n as the unordered sum of two triangular numbers (zero allowed).

%C Number of ways of writing n as a sum of a square and twice a triangular number (zeros allowed).

%C a(A020757(n))=0; a(A020756(n))>0; a(A119345(n))=1; a(A118139(n))>1. - _Reinhard Zumkeller_, May 15 2006

%C Also, number of ways to write 4n+1 as the unordered sum of two squares of nonnegative integers. - _Vladimir Shevelev_, Jan 21 2009

%C The average value of a(n) for n<=x is pi/4+O(1/sqrt(x)). - _Vladimir Shevelev_, Feb 06 2009

%H Reinhard Zumkeller, <a href="/A052343/b052343.txt">Table of n, a(n) for n = 0..10000</a>

%H V. Shevelev, <a href="http://www.arxiv.org/abs/0901.3102">Binary additive problems: recursions for numbers of representations</a>.

%H V. Shevelev, <a href="http://www.arxiv.org/abs/0902.1046">Binary additive problems: theorems of Landau and Hardy-Littlewood type</a>.

%F a(n) = ceiling(A008441(n)/2). - _Reinhard Zumkeller_, Nov 03 2009

%F G.f.: (Sum_{k>=0} x^(k^2+k))(Sum_{k>=0} x^(k^2)).

%F Recurrence: a(n) = sum_{1<=k<=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 a(n) = A025426(8n+2). - _Max Alekseyev_, Mar 09 2009

%F a(n) = (A002654(4n+1) + A010052(4n+1)) / 2. - _Ant King_, Dec 01 2010

%t Length[PowersRepresentations[4 # + 1, 2, 2]] & /@ Range[0, 101] (* _Ant King_, Dec 01 2010 *)

%t 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 *)

%o (PARI) a(n)=if(n<0,0,sum(i=0,(sqrtint(4*n+1)-1)\2,issquare(n-i-i^2)))

%o (Haskell)

%o a052343 = (flip div 2) . (+ 1) . a008441

%o -- _Reinhard Zumkeller_, Jul 25 2014

%Y Cf. A000217, A052344-A052348, A053587, A056303, A056304.

%K nonn

%O 0,7

%A _Christian G. Bower_, Jan 23 2000

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

Content is available under The OEIS End-User License Agreement .

Last modified November 24 10:51 EST 2014. Contains 249895 sequences.