The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A257022 Trace of n in the quarter-sum representation of n. 4

%I

%S 0,1,2,1,4,1,6,1,2,9,1,2,12,1,2,1,16,1,2,1,20,1,2,1,4,25,1,2,1,4,30,1,

%T 2,1,4,1,36,1,2,1,4,1,42,1,2,1,4,1,6,49,1,2,1,4,1,6,56,1,2,1,4,1,6,1,

%U 64,1,2,1,4,1,6,1,72,1,2,1,4,1,6,1,2,81

%N Trace of n in the quarter-sum representation of n.

%C Every positive integer is a sum of at most four distinct quarter squares, of which the least term is the trace; see A257019.

%H Clark Kimberling, <a href="/A257022/b257022.txt">Table of n, a(n) for n = 0..1000</a>

%e Quarter-square representations:

%e r(0) = 0, so a(0) = 0

%e r(1) = 1, so a(1) = 1

%e r(2) = 2, so a(2) = 2

%e r(3) = 2 + 1, so a(3) = 1

%t z = 100; b[n_] := Floor[(n + 1)^2/4]; bb = Table[b[n], {n, 0, 100}];

%t s[n_] := Table[b[n], {k, b[n + 1] - b[n]}];

%t h[1] = {1}; h[n_] := Join[h[n - 1], s[n]];

%t g = h[200]; r[0] = {0};

%t r[n_] := If[MemberQ[bb, n], {n}, Join[{g[[n]]}, r[n - g[[n]]]]];

%t Table[Last[r[n]], {n, 0, 3 z}] (* A257022 *)

%Y Cf. A002620, A257019, A257020, A257021, A257023.

%K nonn,easy

%O 0,3

%A _Clark Kimberling_, Apr 15 2015

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

Last modified June 5 01:27 EDT 2020. Contains 334828 sequences. (Running on oeis4.)