[go: up one dir, main page]

login
Revision History for A242306 (Bold, blue-underlined text is an addition; faded, red-underlined text is a deletion.)

Showing all changes.
Number of terms in the squares-greedy sum for n.
(history; published version)
#4 by N. J. A. Sloane at Tue May 20 23:48:12 EDT 2014
STATUS

proposed

approved

#3 by Clark Kimberling at Fri May 16 16:21:42 EDT 2014
STATUS

editing

proposed

#2 by Clark Kimberling at Sun May 11 17:22:51 EDT 2014
NAME

allocated Number of terms in the squares-greedy sum for Clark Kimberlingn.

DATA

1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 2, 2, 2, 2, 3, 3, 3, 3, 2, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 2, 2, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 4, 4, 2, 2, 2, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 4, 4, 2, 3, 2, 2, 2, 2, 3, 3

OFFSET

2,4

COMMENTS

Greedy sums and related numbers are defined at A242305.

LINKS

Clark Kimberling, <a href="/A242306/b242306.txt">Table of n, a(n) for n = 2..2000</a>

EXAMPLE

n ... squares-greedy sum for n

1 ... (undefined)

2 ... 1 = 1

3 ... 1 = 1

4 ... 1 = 1

5 ... 5 = 4 + 1

6 ... 5 = 4 + 1

7 ... 5 = 4 + 1

8 ... 5 = 4 + 1

9 ... 5 = 4 + 1

10 .. 10 = 9 + 1

11 .. 10 = 9 + 1

12 .. 10 = 9 + 1

13 .. 13 = 9 + 4

14 .. 14 = 9 + 4 + 1

MATHEMATICA

z = 200; s = Table[n^2, {n, 1, z}]; s1 = Table[n, {n, 1, z}]; t = Table[{s1[[n]], #, Total[#] == s1[[n]]} &[DeleteCases[-Differences[FoldList[If[#1 - #2 >= 0, #1 - #2, #1] &, s1[[n]],

Reverse[Select[s, # < s1[[n]] &]]]], 0]], {n, z}]

r[n_] := s1[[n]] - Total[t[[n]][[2]]];

tr = Table[r[n], {n, 2, z}] (* A242305 *)

c = Table[Length[t[[n]][[2]]], {n, 2, z}] (* A242306 *)

f = 1 + Flatten[Position[tr, 0]] (* A242307 *) (* Peter J. C. Moses, May 06 2014 *)

CROSSREFS
KEYWORD

allocated

nonn,easy

AUTHOR

Clark Kimberling, May 11 2014

STATUS

approved

editing

#1 by Clark Kimberling at Sat May 10 15:11:45 EDT 2014
NAME

allocated for Clark Kimberling

KEYWORD

allocated

STATUS

approved