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

 

Logo


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). 21
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,7

COMMENTS

Number of ways of writing n as a sum of a square and twice a triangular number (zeros allowed). - Michael Somos, Aug 18 2003

a(A020757(n))=0; a(A020756(n))>0; a(A119345(n))=1; a(A118139(n))>1. - Reinhard Zumkeller, May 15 2006

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

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

LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 0..10000

V. Shevelev, Binary additive problems: recursions for numbers of representations.

V. Shevelev, Binary additive problems: theorems of Landau and Hardy-Littlewood type.

FORMULA

a(n) = ceiling(A008441(n)/2). - Reinhard Zumkeller, Nov 03 2009

G.f.: (Sum_{k>=0} x^(k^2 + k)) * (Sum_{k>=0} x^(k^2)). - Michael Somos, Aug 18 2003

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

a(n) = A025426(8n+2). - Max Alekseyev, Mar 09 2009

a(n) = (A002654(4n+1) + A010052(4n+1)) / 2. - Ant King, Dec 01 2010

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

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

Convolution of A005369 and A010052. - Michael Somos, Jul 28 2015

EXAMPLE

G.f. = 1 + x + x^2 + x^3 + x^4 + 2*x^6 + x^7 + x^9 + x^10 + x^11 + ...

MATHEMATICA

Length[PowersRepresentations[4 # + 1, 2, 2]] & /@ Range[0, 101] (* Ant King, Dec 01 2010 *)

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

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

a[ n_] := Length @ FindInstance[ {j >= 0, k >= 0, j^2 + k^2 + k == n}, {k, j}, Integers, 10^9]; (* Michael Somos, Jul 28 2015 *)

PROG

(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 */

(Haskell)

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

-- Reinhard Zumkeller, Jul 25 2014

CROSSREFS

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

Cf. A053692, A093518, A121444, A259285, A259287, A260415, A260516.

Cf. A005369, A010052.

Sequence in context: A198068 A121361 A191907 * A073484 A203947 A081396

Adjacent sequences:  A052340 A052341 A052342 * A052344 A052345 A052346

KEYWORD

nonn

AUTHOR

Christian G. Bower, Jan 23 2000

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy .

Last modified January 17 09:26 EST 2018. Contains 297801 sequences.