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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A214728 Least k such that n + (n+1) + ... + (n+k-1) is a square. 1
1, 1, 3, 5, 1, 9, 11, 13, 15, 1, 19, 3, 2, 25, 27, 29, 1, 33, 5, 37, 39, 8, 43, 45, 2, 1, 3, 53, 55, 57, 59, 61, 9, 65, 67, 6, 1, 8, 75, 11, 2, 81, 83, 5, 87, 9, 13, 3, 95, 1, 99, 101, 18, 15, 107, 109, 111, 8, 10, 117, 2, 121, 24, 125, 1, 129, 131, 19, 135, 25, 139, 6 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,3

COMMENTS

a(n) is the number of consecutive integers starting from n needed to sum up to a perfect square.

Indices of 1's: A000290.

Indices of 2's: A046092(k), k!=A001108(m).

If a(n) is bigger than previous terms then a(n)=n*2-1, for example a(5)=9 is bigger than previous maximum, and a(5)=5*2-1.

Terms of A108269 never appear in a(n).

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

Cf. A000290, A108269.

Sequence in context: A214062 A054586 A214229 * A112752 A101035 A204029

Adjacent sequences:  A214725 A214726 A214727 * A214729 A214730 A214731

KEYWORD

nonn,easy

AUTHOR

Alex Ratushnyak, Jul 27 2012

STATUS

approved

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.

License Agreements, Terms of Use, Privacy Policy. .

Last modified February 27 12:45 EST 2020. Contains 332306 sequences. (Running on oeis4.)