login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A100254
Let j be the smallest integer for which 1 + (1+1*n) + (1+2*n) + ... + (1+j*n) = k^2 = s. Then a(n)=j; if no such j exists, then a(n)=0.
7
7, 1, 80, 24, 5, 8, 1, 0, 6, 3, 2, 8, 21, 1, 48, 3, 7, 0, 16, 8, 80, 4, 1, 24, 45, 2, 9, 120, 5, 8, 17, 3, 30, 1, 10, 168, 6, 5, 1680, 48, 7, 3, 4960, 11, 224, 7, 1, 15, 31, 0, 48, 24, 16, 12, 288, 8, 48, 6, 26, 80, 117, 1, 136160, 195, 13, 3, 9, 840, 1520, 24, 49, 8, 70, 2, 1680
OFFSET
1,1
COMMENTS
Basis for sequence is shortest arithmetic series with initial term 1 and difference n that sums to a perfect square.
FORMULA
1 + (1+1*n) + (1+2*n) + ... + (1+a(n)*n) = 1 + (1+1*n) + (1+2*n) + ... + A100253(n) = A100251(n)^2 = A100252(n).
EXAMPLE
a(3)=80 since 1 + 4 + 7 +...+ (1+80*3) = 99^2 = 9801 and no other arithmetic series with initial term 1, difference 3 and fewer terms sums to a perfect square.
MATHEMATICA
a[n_] := Block[{k = 1}, While[ !IntegerQ[ Sqrt[(k + 1)(1 + k*n/2)]], k++ ]; k]; a[18] = a[50] = 0; Table[ a[n], {n, 75}] (* Robert G. Wilson v, Nov 27 2004 *)
CROSSREFS
Sequence in context: A321187 A221367 A110788 * A119935 A027447 A027517
KEYWORD
nonn
AUTHOR
Charlie Marion, Nov 21 2004
EXTENSIONS
More terms from Robert G. Wilson v, Nov 27 2004
STATUS
approved