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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A101428 Number of ways to write n as an ordered sum of a triangular number (A000217) and a square (A000290). 2
1, 2, 1, 1, 2, 1, 1, 2, 0, 1, 3, 1, 1, 0, 1, 2, 2, 1, 0, 3, 0, 1, 2, 0, 1, 2, 2, 0, 2, 1, 1, 2, 1, 0, 0, 1, 2, 4, 0, 1, 2, 0, 1, 0, 1, 2, 3, 0, 0, 2, 1, 1, 2, 1, 1, 2, 1, 1, 0, 2, 0, 2, 0, 0, 4, 1, 1, 2, 0, 0, 4, 1, 1, 0, 1, 1, 0, 1, 1, 2, 1, 2, 3, 0, 1, 2, 0, 2, 0, 0, 0, 4, 2, 0, 2, 1, 1, 0, 0, 0, 3, 1, 2, 2, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,2

COMMENTS

0 is both a triangular number and a square number.

First occurrence of k beginning at 0: 8, 2, 1, 10, 37, 136, 235, 1549, 631, 2314, 2116, 11026, 3997, 148240, 19045, 20827, 25876, 893116, 67951, ?19?, 35974, 187444, 1542655, 354061, 131905, ?25?, ?26?, 835399, 323767, ?29?, 611560, ?31?, 515629, ?33?, ?34?, ?35?, 1187146, ?37?, ?38?, ?39?, 1474939, ..., . - Robert G. Wilson v, Mar 30 2014

LINKS

G. C. Greubel, Table of n, a(n) for n = 0..1000

FORMULA

G.f.: sum(i>=0, x^(i^2) ) * sum(i>=0, x^(i*(i+1)/2) ). - Ralf Stephan, May 17 2014

EXAMPLE

Examples: n=1 gives the a(1)=2 cases 1=1+0=0+1; a(26)=2 because 26=25+1=16+10.

MAPLE

A000217 := proc(n) n*(n+1)/2 ; end:

A101428 := proc(n)

local a, y, t ;

a := 0 ;

for y from 0 do

t := A000217(y) ;

if n-t < 0 then

RETURN(a) ;

else

if issqr(n-t) then

a := a+1 ;

fi;

fi;

od:

end:

for n from 0 to 100 do printf("%a, ", A101428(n)) ; od:

MATHEMATICA

t = FoldList[#1 + #2 &, 0, Range@ 15]; s = Range[0, 10]^2, a = Sort@ Flatten@ Table[ s[[j]] + t[[k]], {j, 15}, {k, 11}]; Table[Count[a, n], {n, 0, 104}] (* or *)

triQ[n_] := IntegerQ@ Sqrt[8n + 1]; f[n_] := Block[{c = k = 0, lmt = 2 + Floor[Sqrt[n]]}, While[k < lmt, If[ triQ[n - k^2], c++]; k++]; c]; Array[f, 105, 0] (* Robert G. Wilson v, Mar 30 2014 *)

CROSSREFS

Cf. A000925, A115171, A115172, A115173, A115174, A115175, A115176, A115177, A144642.

Sequence in context: A140218 A193805 A159704 * A023586 A023584 A015182

Adjacent sequences:  A101425 A101426 A101427 * A101429 A101430 A101431

KEYWORD

nonn

AUTHOR

R. J. Mathar, Jan 03 2009

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 June 27 11:25 EDT 2017. Contains 288788 sequences.