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

 

Logo

Annual appeal: Please make a donation to keep the OEIS running! Over 6000 articles have referenced us, often saying "we discovered this result with the help of the OEIS".
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A281706 Number of sets of three positive numbers <= n such that their sum is a square. 4
0, 0, 0, 0, 1, 2, 3, 5, 8, 11, 15, 20, 26, 33, 40, 48, 57, 67, 80, 93, 107, 121, 136, 153, 172, 193, 214, 236, 259, 284, 311, 340, 371, 402, 433, 466, 501, 538, 577, 618, 661, 705, 751, 798, 847, 897, 949, 1002, 1057, 1115, 1176, 1239, 1303, 1369, 1436, 1505 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,6

COMMENTS

Inspired by A278329.

a(n) >= a(n-1), first differences are nondecreasing.

LINKS

Alois P. Heinz and Robert G. Wilson v, Table of n, a(n) for n = 0..20000

EXAMPLE

a(1) .. a(3) = 0;

a(4) = 1 since 2+3+4 = 9;

a(5) = 2 since 2+3+4 = 1+3+5 = 9;

a(6) = 3 since 2+3+4 = 1+3+5 = 1+2+6 = 9;

a(7) = 5 since a(6) = 3 plus 3+6+7 = 4+5+7 = 16;

a(8) = 8 since a(7) = 5 plus 1+7+8 = 2+6+8 = 3+5+8 = 16; etc.

MAPLE

g:= (n, t)-> max(0, iquo(n-1, 2)-max(1, n-t)+1):

b:= n-> add(g(k^2-n, n-1), k=ceil(sqrt(n+3))..floor(sqrt(3*n-3))):

a:= proc(n) option remember; `if`(n=0, 0, a(n-1)+b(n)) end:

seq(a(n), n=0..100);

MATHEMATICA

f[n_] := Length@ Select[Plus @@@ Subsets[ Range@ n, {3}], Mod[ Sqrt[#], 1] == 0 &]; Array[f, 65] (* or *)

f = Compile[{{n, _Integer}}, Block[{a = 1, b = 2, c = 3, cnt = 0}, While[a < b, b = a +1; While[b < c, c = b +1; While[c < n +1, If[ Mod[ Sqrt[a + b + c], 1] == 0, cnt++]; c++]; b++]; a++]; cnt]]; Array[f, 65] (* or *)

g = Compile[{{n, _Integer}}, If[n < 4, 0, Block[{a = 1, b = 2, cnt = f[n -1]}, While[a < b, b = a +1; While[b < n, If[ Mod[ Sqrt[a + b + n], 1] == 0, cnt++]; b++]; a++]; cnt]]]; f[n_] := f[n] = g[n]; Array[f, 100]

CROSSREFS

Cf. A176615, A278329.

Column k=3 of A281871.

Sequence in context: A137179 A096777 A125811 * A071424 A008762 A101018

Adjacent sequences:  A281703 A281704 A281705 * A281707 A281708 A281709

KEYWORD

nonn,easy

AUTHOR

Alois P. Heinz and Robert G. Wilson v, Jan 28 2017

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 November 18 01:16 EST 2017. Contains 294837 sequences.