Skip to main content
31 events
when toggle format what by license comment
Jul 8 at 13:40 answer added Samuel Jahnke timeline score: 0
Jul 6 at 0:19 answer added Aiden Chow timeline score: 2
Jul 5 at 14:51 answer added Dominic van Essen timeline score: 1
Jul 5 at 11:08 answer added l4m2 timeline score: 1
Jul 5 at 10:10 comment added Bubbler @GB I edited again to include the phrase "at least". You're right that it takes 18 steps to get exactly 17 copies of a, but the formula in the question solves the case where you're allowed to generate more than that if doing so takes fewer steps.
Jul 5 at 10:08 history edited Bubbler CC BY-SA 4.0
added 58 characters in body
Jul 5 at 9:48 comment added Aiden Chow @GB If you select, copy, then paste the initial string 5 times, you will then get 6 copies of the original string. If you then select, copy, then paste that string 2 more times, you will get 18 copies of the original string. Specifically, if you denote S as select ,C as copy, and P as paste, the exact sequence would be SCPPPPPSCPP, which is 11 steps.
Jul 5 at 9:28 comment added G B I can't understand the post, how do you generate a prime number by copy-pasting anything else but 1? f(17) should be 18, not 11...
Jul 5 at 9:14 answer added Neil timeline score: 1
Jul 5 at 8:44 answer added Kevin Cruijssen timeline score: 1
Jul 5 at 8:02 answer added Shaggy timeline score: 1
Jul 5 at 4:32 comment added Bubbler Since some answers are copying the constants from the formula without checking, I went ahead and fixed it with affected test cases.
Jul 5 at 4:30 history edited Bubbler CC BY-SA 4.0
edited body
Jul 5 at 4:18 history became hot network question
Jul 5 at 4:18 answer added z.. timeline score: 2
Jul 5 at 2:23 answer added Bubbler timeline score: 1
Jul 5 at 0:52 comment added Bubbler The fixed formula agrees with an algorithmic solution for up to 1e6.
Jul 5 at 0:47 comment added xnor I can confirm that changing the first tuple from (1,1) to (0,1) in the formula matches my code's brute-force-ish results up to 2000.
Jul 4 at 23:57 answer added xnor timeline score: 9
Jul 4 at 23:49 comment added Bubbler I went through the math.se post and I think there is a typo in the formula: (1,1) should be (0,1). This change affects all test inputs which are in the form of 4^k. Added a comment about this on the math.se post too.
Jul 4 at 22:53 review Close votes
Jul 5 at 9:37
Jul 4 at 22:36 comment added xnor I don't understand why \$f(4)=6\$. Can't you quadruple in just 5 operations by doing select-all, copy, paste, paste, paste? Since the pastes append as you say, only 3 are needed here.
Jul 4 at 22:06 comment added bigyihsuan Sandbox post and a bit of chat
Jul 4 at 22:05 comment added bigyihsuan @xnor When you paste, it appends to the output.
Jul 4 at 21:38 comment added xnor Why does \$f(1)=1\$, rather than \$0\$? Surely no operations are needed to keep the original string intact?
Jul 4 at 21:06 answer added chunes timeline score: 0
Jul 4 at 20:33 answer added Arnauld timeline score: 1
Jul 4 at 20:28 comment added Joao-3 Related. Also, giving an equation kind of misses the point of the question, making the golfer only solve an equation and not come up with their own algorithm.
Jul 4 at 20:24 comment added xnor Does "containing n copies of the original string" mean at least n, or exactly n?
Jul 4 at 20:23 comment added xnor I assume it's intended that when you select all, copy, then paste, the paste doesn't overwrite the selection but appends to it?
Jul 4 at 20:18 history asked bigyihsuan CC BY-SA 4.0