OFFSET
3,1
REFERENCES
Hare, W. R.; Hedetniemi, S. T.; Laskar, R.; Pfaff, J. Complete coloring parameters of graphs. Proceedings of the sixteenth Southeastern international conference on combinatorics, graph theory and computing (Boca Raton, Fla., 1985). Congr. Numer. 48 (1985), 171--178. MR0830709 (87h:05088)
FORMULA
Let s_m = m^2/2 if m even, m(m-1)/2 if m odd. For m >= 0, the s_m sequence is 0, 0, 2, 3, 8, 10, 18, 21, 32, 36, 50, ... (A093353 with a different offset).
Suppose s_m <= n < s_{m+1}. If m is odd and n = s_m + 1 then a(n) = m-1, otherwise a(n) = m.
MAPLE
A093353 := proc(n)
if n < 1 then
0;
else
(n + modp(n, 2))*(n+1)/2 ;
end if;
end proc:
A182021 := proc(n)
for m from 0 do
sm := A093353(m-1) ;
if sm > n then
m := m-1 ;
sm := A093353(m-1) ;
if type(m, 'odd') and n = sm+1 then
return m-1 ;
else
return m;
end if;
end if;
end do:
end proc:
seq(A182021(n), n=3..80) ; # R. J. Mathar, Jul 12 2013
MATHEMATICA
A093353[n_] := If[n < 1, 0, (n+Mod[n, 2])*(n+1)/2];
a[n_] := For[m = 0, True, m++, sm = A093353[m-1]; If[sm > n, m = m-1; sm = A093353[m-1]; If[OddQ[m] && n == sm+1, Return[m-1], Return[m]]]];
Table[a[n], {n, 3, 80}] (* Jean-François Alcover, Apr 15 2023, after R. J. Mathar *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
N. J. A. Sloane, Apr 06 2012
STATUS
approved