12:00 AM
@wizzwizz4 I never said that I need switch case inside a loop. Just a switch case and a loop.

12:13 AM
@LeakyNun ?

@ASCII-only who came up with the extended Euclidean algorithm?

weird. it's really hard to find that
@LeakyNun you should ask this on one of the SE sites if it's on-topic anywhere

probably history of maths

:O that is a thing

0

Euclidean algorithm is an algorithm that produces the greatest common divisor of two integers. It was described by Euclid as early as in 300 BC. On the other hand, the extended Euclidean algorithm extends his algorithm to express the greatest common divisor as an integer-linear combination of th...

12:54 AM
> The extended Euclidean algorithm was published by the English mathematician Nicholas Saunderson,[38] who attributed it to Roger Cotes as a method for computing continued fractions efficiently.[39]

I see

Running the hexagony brute force program on both cores makes the computer really hot...

@user202729 you just broke the fourth wall

(no idea what it is)

@user202729 when the virtual world meets the real world

1:19 AM
@LeakyNun *imaginary world. also that doesn't break the fourth wall because 1. the chat is in the real world and 2. we're in the real world

1:53 AM
Still running... it has been 2 hours.

@user202729 when are you going to post the code :P

When I'm sure that it can't be optimized more... I have another optimization in mind. Not yet.

2:29 AM
Anyone know of a site that have gdb usable?

@HyperNeutrino or, because this hasn't been flagged, someone found it offensive that you said fireworks were an invention from hell
i stand corrected
i share the sentiment however. a good thing that where i live because when in the hands of idiots fireworks can cause bushfires in summer i can call the police to have it stopped

Not that I like flags. 1 hour may be too much.

2:55 AM
@user202729 basically any IDE site? like ideone

@ASCII-only I tried many "run Bash online" site and almost none of them have gdb installed, iirc.

@user202729 cloud9
@user202729 glitch.com well actually this only has ~128MB hard drive

0

I just got 2 back-to-back 30-minute suspensions for "inappropriate content" for using the F-word. I usually don't use that word that often but for whatever reason people felt the need to bad me for it. The two messages were approximately: fireworks are legitimately an invention from hell. peo...

@HyperNeutrino Remember that the system is automatic. I flag messages, not users.
ideone doesn't have gdb installed.
And I didn't downvote the meta post.
ideone doesn't have gdb installed too.

@user202729 ...
@user202729 are you going to try ideone as well >_>

3:13 AM
ok so........ another random koth idea: one army versus another, dwarf fortress style controls
basically, your minions have their own pathfinding and everything, you can only tell them what to do with designations and stuff like in dwarf fortress

Looks like that the only choice is to install gdb locally. Or find a server yourself.

@DestructibleLemon you realise someone's going to have to implement pathfinding for armies of simulated minions right?

@Οurous i'll look up basic pathfinding...
it's not like the dwarfs have to be very smart
i think that it can get laggy, but when i say army, it might be like, 10 dwarfs per team

But if they're too dumb it might not be fun or interesting enough, and instead turn into abusing the pathfinding and decision-making logic.

@Οurous dwarfs are dumb: they might run through a really long tunnel full of traps if you're not careful, but that's a tactic in dwarf fortress as it is, and really, with a player controlling their dwarfs, is likely to see it happen
@Οurous ok so, you tell dwarfs to do something, they try and move towards it, if they can't they'll say path blocked and give up or something
it's mostly 2d surfaces or something anyway

3:20 AM
@Ourous you may be interested in collaborative diffusion

I don't think that there would be much unfun abuse... for starters, if you were trying to get them to run through traps, you would need to build the traps in the first place

@quartata ooh thanks, that's fascinating

I've never tried it with a large number of agents but it should do okay
performance-wise that is
the concept is great -- you get a lot of behavior for free and you can "weight" goals/obstacles

2 hours later…
5:28 AM
:O
i just had the worst idea ever

@ASCII-only did you think of Python
6

a userscript to sanitize a chat message from swearwords
@Downgoat 1. no 2. Cream Puff is a bad idea but not as bad as Python

6:03 AM
@ASCII-only I don't think you can make an AI that smart...

@user202729 ... why do you need AI
just replacing common swearwords is enough in basically all cases

@ASCII-only or have everyone use XKCD substitutions and replace swear words with other stuff like "Happy Kittens" or "Pugs"
ie. Holy Happy Kittens, Jesus has Pugs!

@Memor-X why xkcd substitutions specifically >_>

6:19 AM
@ASCII-only just remembering the related comics
> Cartman's final attack in South Park Movie - with XKCD Substitutions:
In the name of the holy spirit i condemn thee to the pits of the nether and suffer the wrath of Barbra Streisand!

7:13 AM
@Memor-X But I don't want to code in brainfluff...

1 hour later…
8:37 AM
@ASCII-only To prevent false positive (<-- am I using the correct word?) of course...

CMC: Output the first n terms in the continued fraction of log2(3).

hi
@LeakyNun that's a fun question!

@LeakyNun 05AB1E, 10 bytes: 3.²sFDï=αz

8:57 AM
@LeakyNun fraction?

In mathematics, a continued fraction is an expression obtained through an iterative process of representing a number as the sum of its integer part and the reciprocal of another number, then writing this other number as the sum of its integer part and another reciprocal, and so on. In a finite continued fraction (or terminated continued fraction), the iteration/recursion is terminated after finitely many steps by using an integer in lieu of another continued fraction. In contrast, an infinite continued fraction is an infinite expression. In either case, all integers in the sequence, other than...
@Emigna Outputs [1;1,1,2,2,3,1,5,2,23,2,2,1,1,55,1,4,1] where the last term should be 3, and then deviates onward

@LeakyNun Yeah, my program doesn't handle floating point inaccuracies

i n v a l i d

Haha, face Leaky’s despise for floats :)

:(

9:11 AM
Mathematica, 28 bytes.
The hexagony brute forcer is really electricity consuming...
Is there no way to simplify this to something simpler...
So assume the current value is (log(p/q)/log(r/s)).
It's <1 iff p/q<r/s <-> ps<qr (assume they're all positive)
And log(p/q)/log(r/s)-f=(log(p/q)-f*log(r/s))/log(r/s)=log((p/q)/((r/s)^f))/log(r/s)‌​.

9:46 AM
@LeakyNun 74 bytes. On mobile, so probably poorly golfed

10:02 AM
@H.PWiz how does it work?

Start with a_0,a_1=3,2. Then find the largest integer r such that a_n^r < a_n-1. Then a_n+1=a_n-1/a_n^r. The continued fraction is the list of rs
Found the algorithm on Google
If a^(n+1/x) = b, calculate n, then find x in the same way, as (b/a^n)^x = a

10:41 AM
@Mr.Xcoder No...

Shush, you’re not the OP :P
Then the pari answer is invalid and the mathematica one works

(too bad that Jelly doesn't have fraction support, you have to implement from scratch)
(not that hard actually)

@user202729 why would Jelly have fraction support >_>

So that it takes less bytes in such challenges....
(thought: if Jelly have graph isomorphism support it would take less bytes in some other challenges too)

@user202729 yeah Jelly isn't intended to have builtins for everything...
To make it golfier in those specific challenges it would need to be less golfy in all other challenges

10:57 AM
"all"?

@user202729 when would there be false positives

There are still a lot of 2-byte atoms unassigned.
Those things are not something that can be implemented in a few bytes.

@user202729 sure. but past a certain point and you're better off using Mthmca

And that's why we encourage intra- and not inter-language competition
6

@Mr.Xcoder hypothetical star

11:03 AM
Hmm, I haven't posted anything in a long time.

@user202729 hypothetical?

in SO Close Vote Reviewers on Stack Overflow Chat, May 15 at 12:13, by Nick A
@rene I would star that but I don't want it being put in the list for all to see for ages gives hypothetical star
Double onebox is bad.
Now it's actually starred (not my star). Anyway.
Did anyone here upvote but forget to read the black magic proof? :)

@user202729 i don't think hypothetical is the right word here

It's not "real star". "imaginary"?

pseudo-star :P

11:28 AM
@user202729 I've read it all and it's fascinating :)
And one of my favourite parts is Okay, I actually don’t know how to prove these facts, either; I’m not a very skilled ring theorist. But I read them on Wikipedia so they must be true. :P
What about meta-star :p

11:51 AM
Invisible star

12:23 PM
@ASCII-only Sure, we talk a lot about meanings of words or other features of natural languages.

4 hours later…
3:53 PM
is there any way using java.util.Timer to schedule something to run a specific number of times?
I could just run a for loop in a new Thread but that sounds like a bad idea :P

@HyperNeutrino You cannot. To do that you should implement a Runnable task, and then you can call that task with a java.util.concurrent.ScheduledExecutorService var = java.util.concurrent.Executors.newSingleThreadScheduledExecutor();

4:12 PM
Interesting problem
given an n by m grid

What's the problem?

the total number of non-intersecting pairs of paths you can make where both paths start from the bottom left and end in the top right, and a path can only ever go up and right
sorry was still typing

(closed form or efficient programming?)

don't know
rather than non-intersecting I should say non-touching with the exception of the start and endpoints

@orlp Isn't it your problem... it's interesting either way.

4:15 PM
@user202729 no, I came across it
I don't know if a closed form exists
In mathematics, the Lindström–Gessel–Viennot lemma provides a way to count the number of tuples of non-intersecting lattice paths. == Statement == Let G be a locally finite directed acyclic graph. This means that each vertex has finite degree, and that G contains no directed cycles. Consider base vertices A = { a 1 , … , a n } {\displaystyle A=\{a_{1},\ldots ,a_{n}\}} and destination...

@J.Sallé Oh okay, thanks!

if I understand that lemma correctly

(I was just using Thread(() -> {}).start() to do that but it was causing java.util.ConcurrentModificationException everywhere :P spigot plugin)
oh. I'm still getting those :/

no wait, that would give 0 as answer...

@HyperNeutrino yeah that's a recipe for disaster

4:24 PM
wait, bukkit has its own event scheduler facepalm of course it does

lol yeah, event scheduling is easy enough to do in Java and it's easily modifiable as well

the question is how I make bukkitscheduler cancel the task after a specified number of executions :/
eh, I'll just schedule a non-repeating task to cancel the repeating task :P what could possibly go wrong
pfft I wanted 50MS delay but bukkit obviously uses server ticks for delay

orrrrr you could just have the task reschedule itself
That's all any repeating task is going to be doing anyways

that's a good point actually

CMC: Given an input integer n and a list of integers A, output two lists: the first all the indices of A where A(i) = n, and the second where A(i) != n. Example: 5, [1,5,3,4,5] should output [1,4], [0,2,3] (0-indexed)

4:51 PM
Jelly, =T,J{ḟ@\
(didn't test, hopefully correct)

@AdmBorkBork Jelly, 5 bytes: nẹⱮØ.

@Dennis awesome solution! How did you go about Finding nẹⱮØ.?
19

@Dehodson First learn Jelly...
(or invent Jelly.)

@user202729 (twas a joke, as in the movie "Finding Nemo")

(in fact I can't remember any of the atoms used there. Most of them are new.

4:56 PM
@user202729 This returns [[2,5], 1], so not quite right.

@Dehodson hehe

@AdmBorkBork Obviously I'm not good at joke detection...

Linux when an application lags out and crashes: everything else: "oh too bad"
Windows when an application lags out and crashes: everything else: "oh time to die as well"
I mean I'd get it if everything else gave up its heap space/processing power/whatever it's called to make the other application start working again, but everything just dies without the original application even getting any better :P

In this case, because I know Jelly and I read it as "not-equal indices-in map-right nilad bits)

@HyperNeutrino Not in my experience. Visual studio crashed just this morning, and it ended up being like a 10-second delay to just force quite and restart it.
*quit, not quite

4:59 PM
@HyperNeutrino Page size?

Huh. Could also have to do with me trying to run a minecraft server with java allocating 32G of RAM on a 12G ram system
@user202729 ?

@HyperNeutrino when a program I'm making on linux is eating all the ram, linux hangs up for me (though I'm guessing as it's linux I could probably switch some obscure setting to make it work)

it was working fine and then I left my computer, came back, and everything started dying

@AdmBorkBork Stax, 11 bytes: ó╢óR╧╦○┐(■-

(virtual ram)
I assune that'a because you runout of ram.

5:00 PM
@dzaima could also be that when something in Linux "lags out and crashes" for me, it's not running out of RAM but rather just getting locked on itself for other reasons
Definitely not an accurate comparison :P partially just a joke

Also: Don't open too many browser tabs at once.

does 16 count as too many

@HyperNeutrino Probably they just can't handle the situation properly. (malloc return null, then npe?)
@HyperNeutrino Yes. Absolutely.

oh :/

@user202729 I solved it
0

We can compute this with an application of Lindström-Gessel-Viennot's lemma. Let $a_1, a_2$ be two sources and $b_1, b_2$ be two sinks. Note that each path has a distinct source and a distinct sink, roughly illustrated here: This is because the top path must always start with an UP and end wi...

5:04 PM
@orlp Linear number of arithmetic ops. +1. May be useful for competitive programming or something... once I learnt that.

@user202729 I edited the formula slightly
which is more symmetric

@AdmBorkBork was the cmc also intended to have this specific jelly answer?

@orlp Actually... reading the questio (first revision, no Latex)I somrwhat suspect cheating. That ahould not matter, i think.
Can't find the source, so only suspect.

@AdmBorkBork APL, 12 bytes: {(⍸⍵)(⍸~⍵)}= have no idea how to train this

@Cowsquack No, but that would've been awesome if I intended that. :D
I mean, yes, totally intentional.

5:16 PM
@user202729 I don't really care to be honest
I found the question interesting
and I think it's useful
however
I think there's something wrong in my answer
for m = 2, n = x it gives negative results

argh 9 bytes but the arrays are concatenated together

ah I found the issue

@dzaima this is shorter

@user202729 the issue is that it incorrectly assumes the number of paths of a1 to b2 is p(m-2, n)

@EriktheOutgolfer right, {⍺⍵} exists and with all of its ungolfiness still is golfy here

5:19 PM
when b2 is BELOW a1 (which happens with m = 2), there are 0 such paths

{⍺⍵} is really an idiom, not just a dfn

luckily when n or m <= 2 the number of paths is always 0 or 1, so they're trivial cases

(unluckily)

actually
changing the coefficient formula around makes it work

5:57 PM
CMC: An integer n is called correct if the sum of the squares of its positive divisors is equal to (n-3)^2. Given n, check if it is correct. Ex: 287 => True; 25 => False. Bonus (this isn’t main so...): You can halve your score (byte count) if you come up with a valid proof that no prime power can be correct.

2

I am a robot. I bought this keyboard because of its easy rectangular layout: ~ !1 @2 #3 $4 %5 ^6 &7 *8 (9 )0 _- += tab Qq Ww Ee Rr Tt Yy Uu Ii Oo Pp {[ }] \| Aa Ss Dd Ff Gg Hh Jj Kk Ll :; "' [-enter-] Zz Xx... @Mr.Xcoder I don't get 287 as true There is a typo in my CMC. (n+3)^2 was intended Kudos for coming up with a proof for the bonus simpler than the one I am about to finish. 6:15 PM That was crap @Mr.Xcoder Japt, 15 bytes â x_p} ¥(U+3 p2 I feel like I can make this better? Just spent several hours configuring firewalls... Praise to my lord and saviour netcat, without which I wouldn't be done for another week, most likely. @Mr.Xcoder Let$n=p^k$. If$n$is correct, then$\sum_i^k p^{2i}=p^{2k}+6p^k+9$. Now$\sum_i^{k-1} p^{2i}=6p^k+9$. Taking mod$p$gives us$1 ≡ 9 (\mod p)$. This simplifies into$8 ≡ 0 (\mod p)$, a contradiction. QED (I hope I didn't make any mistakes) 6:34 PM I'm not sure how you got$p^{2i}=p^{2k}+6p^k+9$oh rip, it's only if$i|k$that$p^i$is a divisor (if that's what you mean) wait nvm It should be a simple sum of a geometric progression. yeah,$p^0+p^{1*2}+p^{2*2}+p^{3*2}+...+p^{k*2}$in case it was not clear, it would actually be$\sum_{i=0}^k$@Mr.Xcoder Okay, I am really bad at tacit programming. I'm trying to solve this in Jelly. I have +3² and I have ÆD²§. How do I combine them with = to get a solution to this problem? :P @Dehodson You could put them on different lines and use quicks (easiest, not necessarily shortest) 6:41 PM @Dehodson I believe +3²=ÆD²§Ɗ works, haven’t tested yet. does that make sense @H.PWiz? also here's a measly 24 byte APL solution, couldn't convert it to a train, {(×⍨3+⍵)=+/×⍨⍸0=⍵∘.|⍨⍳⍵} @DJMcMayhem Okay, that got me there! Now I have to figure out how to make it short like @Mr.Xcoder :P What does Ɗ do, I couldn't find it on the list of Atoms? @Cowsquack wait$8≡0(\mod p)$only says that$p|8$,$p$could be 2 (I misinterpreted it as$8|p$) @Dehodson Look at the list of quicks and I recommend reading the whole tutorial page 0 Meta note: This is similar to my Rotonyms 1 challenge applying a different transformation to the words (circular rotation instead of ROT13) Rotonyms 2 A "Rotonym" is a word that ROT13s into another word (in the same language). For this challenge, we'll use an alternate definition: a "Rotony... 6:53 PM @DJMcMayhem or just use drei :P Ɗ @Mr.Xcoder Gotcha - thanks for the help! You’re welcome! Feel free to ping me for help at any time. @Mr.Xcoder § can simply be S :P I haven’t really read the code I just saw 3 atoms and have suggested drei 7:12 PM @Cowsquack Sorry, I had to run. Makes sense. The sum is (1-p^(2n+2))/(1-p^2) which is always 1 more than a multiple of p^2 (if that helps) 7:30 PM @H.PWiz ah I see what you meant. I do not know how you directly get that it is 1 more than a multiple of p^2, but the sum can also be written as 1+(1+p^2+p^4+...)×p^2 which is as you described. But I am not sure how to go about it any differently (maybe take mod p^2 instead, but basically does the same as mod p) mod p^2 isn't the same as mod p... @Cowsquack ^ (mod p) is simpler... The sum of divisors of p^n = 1 (mod p) Whereas (p^n+3)^2 = p^(2n) + 6p + 9 = 9 (mod p). This works for all primes other than 2 @EriktheOutgolfer *has the same effect, as in, it gives 1≡9 (mod p^2) if n≥2, in which case it gives p^2|8, which can only be true if p=2, so we still have to prove that I'm a little too tired/confused for this right now 7:48 PM So you were both basically trying to prove that$6p^m+9\ne \sum_{k=0}^{m-1}p^{2k}$using modular arithmetic. Yeah, are you not counting n as a divisor of n? If you are, the sum should be to m I am counting n. I think. Although it doesn't matter mod p I am pretty sure I am counting n. Here is a very incomplete draft. What do you think? Actually wait, it's not uploaded yet. Oh, i see, I didn't realise how you cancelled the p^(2m) 7:55 PM Yup, that's what I did. Until GH finally pushes the updates, you can view it here. It looks the same. Form where you are, you can take both sides mod p and get 9 = 1 (mod p). This only works for 2. which isn't too hard to prove on it's own. A nicer proof may exist though I'm still searching for a solution which does not require splitting in cases, but that sure works. Perhaps you could solve it in base p 8:10 PM @H.PWiz interesting I tried using the geometric progression sum formula, and it comes down to finding a contradiction in$3(2p^m+3)(1-p)(1+p)=(1-p^m)(1+p^m)$So I think mod p is better :p (hopefully I didn't make any mistake...) How did you proove for 2? for 2 I get a quadratic, and the determinant is not a square number I haven't, yet. It's getting kinda late and I don't feel like completing it now. oeis gives (4^n - 1)/3 as the formula for the first n terms of 1+2^2+2^4+2^6+... 8:15 PM @Cowsquack discriminant? >_< that's the one Yeah, I hope you're not doing linear alg now :P heh This problem's been given at a math contest in my hometown a while ago. @Cowsquack Alternatively, it is easy to show that the left is greater than the right 8:18 PM I ⍵as thinking about that too, but some apl'ing shows  {(×⍨3+⍵)-+/×⍨⍸0=⍵∘.|⍨⍳⍵}¨2*⍳10 20 28 36 20 ¯140 ¯972 ¯4684 ¯20300 ¯84300 ¯343372 the left is greater for the first four ones (the dfn computes left-right) ugh this proof's gotten too messy imo. before signing off for the night, here's a puzzle I think you might enjoy a 2^n by 2^n square, n>0, is tiled with 2 or more rectangles which each have dimensions that are powers of two, prove that you will always find two rectangles with the same dimensions @Cowsquack whoops it computes right-left @H.PWiz so yeah this could work, but you still have to prove the case where n≤4 in 2^n The second part (well, third, in fact) of this problem was proving that all correct numbers have at most 6 positive divisors. (4^n- 1)/3 < 6p^n +9, no? Whoops I meant 4^2n I think 8:28 PM I don't think n is right, not 2n I'm out for the day... I just got 3(1-p)(1+p)≠(p^m+1)(6p^2-p^m-5) which is way too much for my brain to grasp right now. o/ 9:23 PM 0 Sum of replicated matrices Tags: code-golf, math, matrix Given a list of numbers [ a1 a2 ... an ], compute the sum of all the matrices Aᵢ where Aᵢ is defined as follows (m is the maximum of all aᵢ): 1 2 ⋯ aᵢ₋₁ aᵢ aᵢ₊₁ ⋯ n +-------------------------- 1 | 0 0 ⋯ 0 aᵢ aᵢ ... Will MathJax eventually happen? ^ writing that challenge above was quite annoying and it would really benefit from MathJax :( v v %\g01::< 0 v _:*20g+v 2 >$v   p02<
0   >1-v
p
>&::10p>:     |
@.!-*:+3g01g02<

10:09 PM
@Dehodson :| this doesn't look golfy

10:21 PM
@ASCII-only Golfed it down to 71, probably could shave a few more if I rewrote the whole thing
v  v%\g01::<
2v _:*20 v
0>$vp02+g< p >1- v >&:::10p>: | .!-g02*:+3$<@

10:43 PM
:| minimal-2d is annoying
ughhhhhhhhhh
I can't port KSab's HW to Minimal-2D

v  v%\g01:<
2v _:*20 v:
0>$vp02+g< p >1- v >&:::10p>:| !-g02*:+3$<@.
^ 70 for of whatever @Dehodson's code is for

@Zacharý nice!

What's this for, anyways?
v  v%\g01:<
2v$_:*20v : 0 vp02+g< p>>1- v >&:::10p>:| !-g02*:+3$<@.
69

11:01 PM
I don't think there are many other places I've seen someone voluntarily "improve" someone else's code without being asked, or knowing what it even does.

@Οurous CR

@Zacharý Check my first befunge post from a while ago, in response to Mr.Xcoder, I don't know how to link two posts in one

SO
Mathematica.SE
so many places :P

@ASCII-only CR / SO pretty much demand more information than this case though.

Oh, didn't see it was a response

11:18 PM
v v%\g01::<
9v_:*91 v
1$vp19+g<@ p>>1- v >&:::10p>:| +:*91g-!.^>$3`
68

@Zacharý O_o

Just some light rearranging, I'm no James H.
(That guy who posts in Befunge alot)