Skip to main content
25 events
when toggle format what by license comment
Jun 17, 2020 at 9:04 history edited CommunityBot
Commonmark migration
Apr 13, 2017 at 12:39 history edited CommunityBot
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Apr 10, 2016 at 2:43 comment added Vampire That was pretty funny, I should more often solve those :-D
Apr 10, 2016 at 2:40 comment added Vampire Or a ternary operator. :-D Yeah, I was pretty sure the original code is differently, but also didn't imagine that much. I didn't really expect an interface, an additional method or a lambda here. But the better for me, there was so much room, that I was able to fit in my code and comment out your revealed characters. :-D Though yours will not get an OutOfMemoryError, mine will if you give it a big enough n, as I continuously build up the ArrayList. :-)
Apr 10, 2016 at 2:19 history edited Daniel M. CC BY-SA 3.0
Cracked
Apr 10, 2016 at 2:13 comment added Daniel M. @BjörnKautler Was not expecting that so quickly (or so differently), given that the original had no if statement, and had a second method.
Apr 10, 2016 at 2:11 history edited Daniel M. CC BY-SA 3.0
Cracked
Apr 10, 2016 at 2:06 comment added Vampire No need, it is cracked. :-)
Apr 10, 2016 at 1:46 comment added Daniel M. @BjörnKautler I double checked, and they are. Mind if I move the discussion to chat?
Apr 10, 2016 at 1:31 comment added Vampire Ah, tabs-vs-4spaces makes sense. And the newlines are also counted as 1 just as in the example, I see. :-) Thanks for clarification. One more question. I almost have it cracked, just a(0) and a(1) are wrong for me, all others are correct. You are sure the first two are calculated correctly by your code, aren't you? :-)
Apr 10, 2016 at 1:08 comment added Daniel M. @BjörnKautler It seems that SE replaces all tab indents with space indents, upping the byte count. I added a note to clarify the byte situation. Also, I fixed the 0-indexing. Have fun :)
Apr 10, 2016 at 1:06 history edited Daniel M. CC BY-SA 3.0
Byte count
Apr 10, 2016 at 0:59 history edited Daniel M. CC BY-SA 3.0
Fix index
Apr 10, 2016 at 0:51 comment added Vampire Me neither. Just learned about OEIS some minutes ago when I recognized this challenge :-)
Apr 10, 2016 at 0:50 comment added Daniel M. @BjörnKautler I'm not all that familiar with OEIS so that's good to know. I need to test it before I change this post, but to make the code 0-indexed, "int ix = 1" should become "int ix = 0"
Apr 10, 2016 at 0:42 comment added Vampire Depends on the sequence. The one you most probably used says with a(0)=a(1)=0, a(2)=1 and also specifies the offset to be 0, which means the first value in the shown numbers is the 0-value. You can also click on the list link after the numbers and you get a list with n-to-a(n) mapping.
Apr 10, 2016 at 0:37 comment added Daniel M. @BjörnKautler OEIS is 0-indexed? I'll change it then (in about an hour). Thanks
Apr 10, 2016 at 0:33 comment added Vampire Are you sure? The only matching sequences I found on OEIS that match your samples start at 0 and for one the results would be a(9) and a(19), for the other a(8) and a(18)
Apr 10, 2016 at 0:05 history edited Daniel M. CC BY-SA 3.0
added 92 characters in body
Apr 10, 2016 at 0:02 comment added Daniel M. @BjörnKautler OK, thanks. The program doesn't crash if 0 is entered but the sequence starts at index 1, so I guess it's zero-intolerant.
Apr 9, 2016 at 23:58 comment added Vampire From the OP: "The cop's task is to write a program/function that takes a positive (or non-negative) integer and outputs/returns another integer. The cop must state it if the program is intolerant towards zero." So I guess you take the input 1 as 0 and this also explains the shift in position, according to the OEIS sequence.
Apr 9, 2016 at 23:55 comment added Daniel M. @BjörnKautler I'll post a link to the byte counter when I get home. What do you mean by 0-tolerance? The first value is a(1) = 0
Apr 9, 2016 at 23:54 comment added Vampire Aren't your examples a(9) and a(19) or a(8) and a(18), according to which version of it on OEIS you took?
Apr 9, 2016 at 23:46 comment added Vampire Hm, how do you come to a byte count of 488? I count 545 from i to }? And please specify 0-tolerance.
Apr 9, 2016 at 21:41 history answered Daniel M. CC BY-SA 3.0