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...
> 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]
@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
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...
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
@Ο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
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
> 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!
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
@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
@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();
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
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...
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)
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
@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.
@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)
@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
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...
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.
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...
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)
@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
@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?
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...
@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)
@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
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
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
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ᵢ ...
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.