A256913 Enhanced squares representations for k = 0, 1, 2, ..., concatenated.
0, 1, 2, 3, 4, 4, 1, 4, 2, 4, 3, 4, 3, 1, 9, 9, 1, 9, 2, 9, 3, 9, 4, 9, 4, 1, 9, 4, 2, 16, 16, 1, 16, 2, 16, 3, 16, 4, 16, 4, 1, 16, 4, 2, 16, 4, 3, 16, 4, 3, 1, 25, 25, 1, 25, 2, 25, 3, 25, 4, 25, 4, 1, 25, 4, 2, 25, 4, 3, 25, 4, 3, 1, 25, 9, 25, 9, 1, 36
Offset: 0
Examples
R(0) = 0 R(1) = 1 R(2) = 2 R(3) = 3 R(4) = 4 R(8) = 4 + 3 + 1 R(24) = 16 + 4 + 3 + 1
Links
- Clark Kimberling, Table of n, a(n) for n = 0..1000
Crossrefs
Programs
-
Haskell
a256913 n k = a256913_tabf !! n !! k a256913_row n = a256913_tabf !! n a256913_tabf = [0] : tail esr where esr = (map r [0..8]) ++ f 9 (map fromInteger $ drop 3 a000290_list) where f x gs@(g:hs@(h:_)) | x < h = (g : genericIndex esr (x - g)) : f (x + 1) gs | otherwise = f x hs r 0 = []; r 8 = [4, 3, 1] r x = q : r (x - q) where q = [0,1,2,3,4,4,4,4,4] !! x -- Reinhard Zumkeller, Apr 15 2015
-
Mathematica
b[n_] := n^2; bb = Insert[Table[b[n], {n, 0, 100}] , 2, 3]; s[n_] := Table[b[n], {k, 1, 2 n + 1}]; h[1] = {0, 1, 2, 3}; h[n_] := Join[h[n - 1], s[n]]; g = h[100]; Take[g, 100] r[0] = {0}; r[1] = {1}; r[2] = {2}; r[3] = {3}; r[8] = {4, 3, 1}; r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, r[n - g[[n]]]]]; t = Table[r[n], {n, 0, 120}] (* A256913, before concatenation *) Flatten[t] (* A256913 *) Table[Last[r[n]], {n, 0, 120}] (* A256914 *) Table[Length[r[n]], {n, 0, 200}] (* A256915 *)
Comments