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 A178715 #86 Jan 01 2024 08:02:28 %S A178715 1,2,3,4,5,6,9,12,16,20,27,36,48,64,81,108,144,192,256,324,432,576, %T A178715 768,1024,1296,1728,2304,3072,4096,5184,6912,9216,12288,16384,20736, %U A178715 27648,36864,49152,65536,82944,110592,147456,196608,262144,331776,442368,589824,786432,1048576,1327104,1769472,2359296,3145728,4194304 %N A178715 a(n) = solution to the "Select All, Copy, Paste" problem: Given the ability to type a single letter, or to type individual "Select All", "Copy" or "Paste" command keystrokes, what is the maximal number of letters of text that can be obtained with n keystrokes? %C A178715 It is assumed that we start with a single letter in the copy buffer. %C A178715 Alternatively, a(n-1) = maximal value of Product (k_i-1) for any way of writing n = Sum k_i. %C A178715 1. The description above assumes that the text is deselected after the Copy command is invoked. %C A178715 2. This sequence is the solution to the equivalent problem formulated as {insert, "Select All+ Copy" macro (without deselection), Paste}. %C A178715 3. This sequence is a "paradigm-shift" sequence with procedure length p =1 (in the sense of A193455). %C A178715 4. The optimal number of pastes per copy, as measured by the geometric growth rate (p+z root of z), is z = 4. [noninteger maximum between 3 and 4] %C A178715 5. The function a(n) = maximum value of the product of the terms k_i, where Sum (k_i) = n+1-i_max. %C A178715 6. All solutions will be of the form a(n) = m^b * (m+1)^d. %H A178715 William Boyles, <a href="/A178715/b178715.txt">Table of n, a(n) for n = 1..8303</a> (terms 1..101 from Joerg Arndt) (all terms with at most 1000 digits) %H A178715 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. %H A178715 <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,0,0,4). %F A178715 a(n) = 4*a(n-5) for n>=16. %F A178715 a(n) = %F A178715 a(5;10) = 5; 20 [C=1, 2 below, respectively] %F A178715 a(n=1:14) = Q^(C-R)*(Q+1)^R %F A178715 where C = floor(n/5)+1, R = n+1 mod C, %F A178715 and Q = floor(n+1/C)-1 %F A178715 a(n>=15) = 3^(4-R)*4^(C-4+R) %F A178715 where C = floor (n/5)+1, R = n mod 5. %F A178715 G.f.: x*(1 +2*x +3*x^2 +4*x^3 +5*x^4 +2*x^5 +x^6 +3*x^10 +x^14) / (1 -4*x^5). - _Colin Barker_, Nov 19 2016 %e A178715 For n = 7 the a(7) = 9 solution is to type the seven keystrokes: paste, paste, paste, select-all, copy, paste paste which yields nine text characters. %e A178715 Here is a table showing the pattern for n = 1 to 35. The first column is n and the second column is the number of characters that can be obtained with n keystrokes. The remainder of the line shows how to get the maximum, as follows. S = Select and C = Copy while a dot stands for Paste. The dots at the beginning of a line are equivalent to a single letter being typed, based on the assumption that at the start there is a single letter in the paste buffer. %e A178715 01: 00001 . %e A178715 02: 00002 .. %e A178715 03: 00003 ... %e A178715 04: 00004 .... %e A178715 05: 00005 ..... %e A178715 06: 00006 ...... %e A178715 07: 00009 ...SC.. %e A178715 08: 00012 ....SC.. %e A178715 09: 00016 ....SC... %e A178715 10: 00020 .....SC... %e A178715 11: 00027 ...SC..SC.. %e A178715 12: 00036 ....SC..SC.. %e A178715 13: 00048 ....SC...SC.. %e A178715 14: 00064 ....SC...SC... %e A178715 15: 00081 ...SC..SC..SC.. %e A178715 16: 00108 ....SC..SC..SC.. %e A178715 17: 00144 ....SC...SC..SC.. %e A178715 18: 00192 ....SC...SC...SC.. %e A178715 19: 00256 ....SC...SC...SC... %e A178715 20: 00324 ....SC..SC..SC..SC.. %e A178715 21: 00432 ....SC...SC..SC..SC.. %e A178715 22: 00576 ....SC...SC...SC..SC.. %e A178715 23: 00768 ....SC...SC...SC...SC.. %e A178715 24: 01024 ....SC...SC...SC...SC... %e A178715 25: 01296 ....SC...SC..SC..SC..SC.. %e A178715 26: 01728 ....SC...SC...SC..SC..SC.. %e A178715 27: 02304 ....SC...SC...SC...SC..SC.. %e A178715 28: 03072 ....SC...SC...SC...SC...SC.. %e A178715 29: 04096 ....SC...SC...SC...SC...SC... %e A178715 30: 05184 ....SC...SC...SC..SC..SC..SC.. %e A178715 31: 06912 ....SC...SC...SC...SC..SC..SC.. %e A178715 32: 09216 ....SC...SC...SC...SC...SC..SC.. %e A178715 33: 12288 ....SC...SC...SC...SC...SC...SC.. %e A178715 34: 16384 ....SC...SC...SC...SC...SC...SC... %e A178715 35: 20736 ....SC...SC...SC...SC..SC..SC..SC.. %e A178715 It appears that A000792 is the result if only one keystroke instead of two is required for the "Select All, Copy" operation. Here is the table. Here "C" means that all the previously typed characters are copied to the paste buffer. %e A178715 01: 00001 . %e A178715 02: 00002 .. %e A178715 03: 00003 ... %e A178715 04: 00004 .... %e A178715 05: 00006 ...C. %e A178715 06: 00009 ...C.. %e A178715 07: 00012 ....C.. %e A178715 08: 00018 ...C..C. %e A178715 09: 00027 ...C..C.. %e A178715 10: 00036 ....C..C.. %e A178715 11: 00054 ...C..C..C. %e A178715 12: 00081 ...C..C..C.. %e A178715 13: 00108 ....C..C..C.. %e A178715 14: 00162 ...C..C..C..C. %e A178715 15: 00243 ...C..C..C..C.. %e A178715 16: 00324 ....C..C..C..C.. %e A178715 17: 00486 ...C..C..C..C..C. %e A178715 18: 00729 ...C..C..C..C..C.. %e A178715 19: 00972 ....C..C..C..C..C.. %e A178715 20: 01458 ...C..C..C..C..C..C. %e A178715 21: 02187 ...C..C..C..C..C..C.. %e A178715 22: 02916 ....C..C..C..C..C..C.. %e A178715 23: 04374 ...C..C..C..C..C..C..C. %e A178715 24: 06561 ...C..C..C..C..C..C..C.. %e A178715 25: 08748 ....C..C..C..C..C..C..C.. %e A178715 26: 13122 ...C..C..C..C..C..C..C..C. %e A178715 27: 19683 ...C..C..C..C..C..C..C..C.. %e A178715 28: 26244 ....C..C..C..C..C..C..C..C.. %e A178715 29: 39366 ...C..C..C..C..C..C..C..C..C. %e A178715 30: 59049 ...C..C..C..C..C..C..C..C..C.. %e A178715 31: 78732 ....C..C..C..C..C..C..C..C..C.. %t A178715 LinearRecurrence[{0,0,0,0,4},{1,2,3,4,5,6,9,12,16,20,27,36,48,64,81},60] (* _Harvey P. Dale_, Apr 11 2017 *) %o A178715 (PARI) Vec(x*(1 +2*x +3*x^2 +4*x^3 +5*x^4 +2*x^5 +x^6 +3*x^10 +x^14) / (1 -4*x^5) + O(x^100)) \\ _Colin Barker_, Nov 19 2016 %o A178715 (Python) %o A178715 def a(n): %o A178715 c=(n//5) + 1 %o A178715 if n<15: %o A178715 if n==5: return 5 %o A178715 if n==10: return 20 %o A178715 r=(n + 1)%c %o A178715 q=((n + 1)//c) - 1 %o A178715 return q**(c - r)*(q + 1)**r %o A178715 else: %o A178715 r=n%5 %o A178715 return 3**(4 - r)*4**(c - 4 + r) %o A178715 print([a(n) for n in range(1, 102)]) # _Indranil Ghosh_, Jun 27 2017 %Y A178715 See A193286 for another version. Cf. A000792. %Y A178715 A000792, A178715, A193286, A193455, A193456, and A193457 are paradigm shift sequences with procedure lengths p=0,1,...,5, respectively. %Y A178715 Cf. A367116 (squares summing to n). %K A178715 nonn,nice,easy %O A178715 1,2 %A A178715 _Bill Blewett_, Jan 11 2011 %E A178715 Edited by _N. J. A. Sloane_, Jul 21 2011 %E A178715 Additional comment and formula from _David Applegate_, Jul 21 2011 %E A178715 Additional comments, formulas, and CrossRefs by _Jonathan T. Rowell_, Jul 30 2011 %E A178715 More terms from _Joerg Arndt_, Nov 15 2014