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 A193286 #74 Feb 16 2025 02:29:02 %S A193286 1,2,3,4,5,6,7,9,12,16,20,25,30,36,48,64,80,100,125,150,192,256,320, %T A193286 400,500,625,768,1024,1280,1600,2000,2500,3125,4096,5120,6400,8000, %U A193286 10000,12500,16384,20480,25600,32000,40000,50000,65536,81920,102400,128000,160000,200000,262144,327680 %N A193286 a(n) is the maximal number of a's that can be produced in a blank document with n "keystrokes". %C A193286 A "keystroke" means one of the following: %C A193286 a (i.e., hit the letter "a" on the keyboard) %C A193286 Ctrl-a ("select all") %C A193286 Ctrl-c (copy selected text to clipboard) %C A193286 Ctrl-v (paste from clipboard to cursor location) %C A193286 Alternatively, a(n-2) = maximal value of Product (k_i-2) for any way of writing n = Sum k_i %C A193286 1. Note that the copy command does not deselect the text. %C A193286 2. This sequence is a "paradigm-shift" sequence with procedure length p =2 (in the sense of A193455). %C A193286 3. The optimal number of pastes per copy, as measured by the geometric growth rate (p+z root of z), is z = 4. [Non-integer maximum between 4 and 5.] %C A193286 4. The function a(n) = maximum value of the product of the terms k_i, where Sum (k_i) = n + 2 - 2*i_max. %C A193286 5. All solutions will be of the form a(n) = m^b * (m+1)^d. %H A193286 Vincenzo Librandi, <a href="/A193286/b193286.txt">Table of n, a(n) for n = 1..1000</a> %H A193286 John Derbyshire, <a href="http://www.johnderbyshire.com/Opinions/Diaries/Puzzles/2011-06.html">Solutions to puzzles in my National Review Online Diary: June 2011</a> %H A193286 John Derbyshire, <a href="/A193286/a193286.pdf">Solutions to puzzles in my National Review Online Diary: June 2011</a> [Cached copy, pdf version only, with permission] %H A193286 Jonathan T. Rowell, <a href="https://cs.uwaterloo.ca/journals/JIS/VOL18/Rowell/rowell3.html">Solution Sequences for the Keyboard Problem and its Generalizations</a>, Journal of Integer Sequences, Vol. 18 (2015), Article 15.10.7. %F A193286 a(n) = 4*a(n-6) for n >= 34. [corrected by _Georg Fischer_, Jun 09 2022] %F A193286 a(n) = a(8;9;15;21;27) = 9; 12; 48; 192; 768 - corresponding to [C=2;2;3;4;5 below]. %F A193286 a(n=9..27) = Q^(C-R) * (Q+1)^R where C = floor((n+3)/6) [minimum value 1], R = (n+2) mod C, and Q = floor((n+2)/C)-2. %F A193286 a(n>=28) = 4^(C-R) * 5^R, where C = floor((n+2)/6), R = (n+2) mod 6. %e A193286 For n=25, C = floor(28/6) = 4, R = (27 mod 4) = 3, and Q = floor(27/4)-2 = 4; therefore, a(25) = 4^(4-3)*5^(3) = 4*5^3 = 500. %e A193286 For n=9, we use the general solution, but with C=2 (rather than C=1). R=(11 mod 2)=1, Q=3, and a(9)=3^(2-1)*4^1 = 12. %t A193286 a[n_ /; 1 <= n <= 7] := n; a[8] = 9; a[n_ /; 9 <= n <= 27] := (c = Max[1, Floor[(n+3)/6]]; r = Mod[n+2, c]; q = Floor[(n+2)/c]-2;q^(c-r)*(q+1)^r);a[n_ /; n >= 28] := ({q, r} = QuotientRemainder[n+2, 6]; 4^(q-r)*5^r);Table[a[n], {n, 1, 60}] (* _Jean-François Alcover_, May 28 2015 *) %o A193286 (Haskell) %o A193286 -- See Theorem 5 in John Derbyshire link. %o A193286 a193286 n = p n [] where %o A193286 p 0 ks = product ks %o A193286 p n [] = p (n-1) [1] %o A193286 p n (k:ks) %o A193286 | n < 0 = 0 %o A193286 | otherwise = max (p (n-1) ((k+1):ks)) (p (n-3) (1:k:ks)) %o A193286 -- _Reinhard Zumkeller_, Jul 22 2011, Jul 21 2011 %o A193286 (Python) %o A193286 def a(n): %o A193286 if n<8: return n %o A193286 elif n==8: return 9 %o A193286 elif n>8 and n<=27: %o A193286 c=max(1, ((n + 3)//6)) %o A193286 r=(n + 2)%c %o A193286 q=((n + 2)//c) - 2 %o A193286 return q**(c - r)*(q + 1)**r %o A193286 else: %o A193286 q=((n + 2)//6) %o A193286 r=(n + 2)%6 %o A193286 return 4**(q - r)*5**r %o A193286 print([a(n) for n in range(1, 101)]) # _Indranil Ghosh_, Jun 27 2017, after Mathematica code %Y A193286 See A178715 for another version. Cf. A000792. %Y A193286 A000792, A178715, A193286, A193455, A193456, and A193457 are paradigm shift sequences of procedure lengths p=0,1,...,5, respectively. %K A193286 nonn,nice %O A193286 1,2 %A A193286 _N. J. A. Sloane_, Jul 20 2011 %E A193286 Additional comment and formula from _David Applegate_, Jul 21 2011 %E A193286 More terms from _Reinhard Zumkeller_, Jul 22 2011, Jul 21 2011 %E A193286 Additional comments, formulas, examples and CrossRefs from _Jonathan T. Rowell_, Jul 30 2011