A304935 a(n) is the largest possible integer value for sqrt(0 1 2 ... n), where one is allowed to place any mixture of +'s and *'s in the n blank spaces.
1, 0, 0, 5, 11, 6, 71, 19, 123, 33, 174, 426, 174, 233, 625, 816, 5695, 3656, 15936, 246960, 24234, 24234, 35151, 140604, 177399, 250982, 1304130, 1304130, 1304130, 1304130, 5532955, 5532955, 58136459, 8525544, 8525544, 58136459, 941988492, 58136459, 941988492
Offset: 1
Keywords
Examples
a(2) = a(3) = 0, since no positive squares are achievable. Some examples: a(7) = 71 = sqrt(0+1+2*3*4*5*6*7). a(8) = 19 = sqrt(0+1*2+3+4*5+6*7*8). a(20) = 246960 = sqrt(0+1*2*3*4*5*6*7*8*9*10*11+12*13*14*15*16*17*18*19*20)
Links
- Rémy Sigrist, PARI program for A304935
Crossrefs
Upper-bounded by sqrt(A038507).
Programs
-
Mathematica
sqStrTest[n_] := Module[{bVal, bStr, i, j, iB, mVal, mStr}, bVal = -1; For[i = 0, i < 2^n, i++, iB = IntegerDigits[i, 2]; While[Length[iB] < n, PrependTo[iB, 0]]; mStr = "0"; For[j = 1, j <= n, j++, mStr = StringJoin[mStr, If[iB[[j]] == 0, "+", "*"], ToString[j]]]; mVal = ToExpression[mStr]; If[Sqrt[mVal] == Floor[Sqrt[mVal]], If[mVal > bVal, {bVal, bStr} = {mVal, mStr}] ] ]; Print[{Sqrt[bVal], bVal, bStr}]]
-
PARI
See Links section.
Extensions
More terms from Rémy Sigrist, May 22 2018
Comments