This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A372782 #92 Jun 09 2024 09:02:38 %S A372782 2,4,7,13,22,40,67,121,202,364,607,1093,1822,3280,5467,9841,16402, %T A372782 29524,49207,88573,147622,265720,442867,797161,1328602,2391484, %U A372782 3985807,7174453,11957422,21523360,35872267,64570081,107616802,193710244,322850407,581130733,968551222,1743392200 %N A372782 Least number m for which there exists some positive k < m where the sum of the integers from k + 1 to m inclusive is an n-th power > 1. %C A372782 With triangular sum T(i) = i*(i+1)/2 = Sum_{j=1..i} i, the aim is T(m) - T(k) = b^n for some b. T(m) - T(k) = (m+k+1)*(m-k)/2 so if m-k is odd then use m-k = b^x to eliminate k in the other factor (m+k+1)/2 = b^(n-x), so that m = b^(n-x) + (b^x - 1)/2. If instead m+k+1 is odd then the resulting expression is the same. This form is an integer and minimized at b=3 and x = ceiling(n/2). - _Kevin Ryde_, May 18 2024 %H A372782 Paolo Xausa, <a href="/A372782/b372782.txt">Table of n, a(n) for n = 1..1000</a> %H A372782 <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (1,3,-3). %F A372782 a(n) = A087503(n-1) + 1. %F A372782 a(n) = 3*a(n-2) + 1. %F A372782 G.f.: x*(2 + 2*x - 3*x^2)/((1 - x)*(1 - 3*x^2)). - _Stefano Spezia_, May 18 2024 %e A372782 a(2) = 4 because the sum of all integers from 3 + 1 to 4 inclusive is 4 = 2^2, a square. %e A372782 a(3) = 7 as we have 2 + 3 + 4 + 5 + 6 + 7 = 27 = 3^3, i.e., m = 7 and k = 1. - _David A. Corneth_, May 15 2024 %t A372782 LinearRecurrence[{1, 3, -3}, {2, 4, 7}, 50] (* _Paolo Xausa_, Jun 09 2024 *) %o A372782 (PARI) isok(m, n) = my(s = m*(m+1)/2); for (k=1, m-1, s -= k; if (ispower(s, n), return(k));); %o A372782 a(n) = my(m=1); while (! isok(m, n), m++); m; \\ _Michel Marcus_, May 16 2024 %o A372782 (PARI) a(n) = { %o A372782 my(res, c, l, u); %o A372782 res = 2^n; c = 8*3^n; %o A372782 l = (sqrt(c) - 1)\2; u = res; %o A372782 for(i = l, u, %o A372782 if(issquare(4*(i + 1)*i + 1 - c), %o A372782 return(i); %o A372782 ) %o A372782 ); %o A372782 return(2^n) %o A372782 } \\ _David A. Corneth_, May 16 2024 %Y A372782 Cf. A002452, A052993, A087503, A372631. %K A372782 nonn,easy %O A372782 1,1 %A A372782 _Jean-Marc Rebert_, May 14 2024 %E A372782 More terms from _David A. Corneth_, May 16 2024