OFFSET
0,3
COMMENTS
LINKS
Harvey P. Dale, Table of n, a(n) for n = 0..1000
EXAMPLE
a(2): 2+3+4 = 9, three summands, so a(2)=3.
a(3): 3+4+5+6+7 = 25, five summands, so a(3)=5.
a(12): 12+13 = 25, so a(12)=2.
MATHEMATICA
lks[n_]:=Module[{k=1}, While[!IntegerQ[Sqrt[Total[Range[n, n+k-1]]]], k++]; k]; lks/@Range[0, 80] (* Harvey P. Dale, Mar 14 2016 *)
PROG
(C)
int main() { // OK with GCC
unsigned long long i, n, sum, sr;
for (n=0; n<333; ++n) {
for (sum=0, i=n; i==n || sr*sr!=sum; ++i) sr=sqrt(sum+=i);
printf("%llu, ", i-n);
}
}
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Alex Ratushnyak, Jul 27 2012
STATUS
approved