login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A338482 Least number of centered triangular numbers that sum to n. 4
1, 2, 3, 1, 2, 3, 4, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 2, 3, 1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 5, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 2, 3, 4, 5, 3, 4, 2, 3, 1, 2, 3, 4, 2, 3, 4, 5, 3, 4, 2, 3, 4, 2, 3, 4, 5, 3, 4, 2, 3, 1, 2, 3, 4, 2, 3, 4, 2, 3, 4, 2, 3, 4, 5, 3, 4, 5 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
COMMENTS
It appears that a(n) = 3 for n == 0 (mod 3), 1 <= a(n) <= 4 for n == 1 (mod 3), and 2 <= a(n) <= 5 for n == 2 (mod 3). - Robert Israel, Nov 13 2020
LINKS
Eric Weisstein's World of Mathematics, Centered Triangular Number
MAPLE
f:= proc(n) option remember; local r, i;
r:= sqrt(24*n-15)/6+1/2;
if r::integer then return 1 fi;
1+min(seq(procname(n-(3*i*(i-1)/2+1)), i=1..floor(r)))
end proc:
map(f, [$1..200]); # Robert Israel, Nov 13 2020
MATHEMATICA
f[n_] := f[n] = Module[{r}, r = Sqrt[24n-15]/6+1/2; If[IntegerQ[r], Return[1]]; 1+Min[Table[f[n-(3i*(i-1)/2+1)], {i, 1, Floor[r]}]]];
Map[f, Range[200]] (* Jean-François Alcover, Sep 16 2022, after Robert Israel *)
CROSSREFS
Sequence in context: A096436 A053610 A264031 * A104246 A281367 A007720
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Oct 29 2020
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 14 19:01 EDT 2024. Contains 375929 sequences. (Running on oeis4.)