This was generated with the equation $p\left(a,z\right):=1-\prod_{n=0}^{z-1}\frac{a-n}{a}$ Where $a$ is $26^3$ (Number of options ^ number of characters)
local sqrt = math.sqrt
local pairs = pairs
function primeFactorise(n, i)
for i=i or 2, sqrt(n) do
if n % i == 0 then
return i, primeFactorise(n // i, i)
end
end
return n
end
A common punishment for school children is to write out a line a given number of times. Create a program that takes in the sentence to be written out, and the number of times it needs to be repeated, and produce the desired output.Use for loops
@JonathanAllan That should be added as a requirement for programming languages here. A language must be able to add numbers, perform a prime test and recognise goats.
These Days Work for Me
Background
You're an attractive JS code golfer and quite a few people are asking you out.
You don't have time to think about which days exactly you're available, so you decide to create a JS function the accepts a date and returns the days of that week.
You then take th...
@2EZ4RTZ 2 things, 1) no offence but you are some random person on the internet I don't know. I wouldn't be devastated if you didn't talk to me because I came out to you. 2) no, usually I get some kind of reaction when I come out to someone, and it isn't just a stonewall of silence (normally)
I've been stuck on this problem I found on a challenge site for awhile now. Little help? Basically I need to compare 2 numbers, if they have the same sign (positive or negative), print "same sign" if they have a different sign, print "different sign"
the catch is, I need to do it:
without the ...
There is a formula given in my module:
$$ \sqrt[n]{a^n} = a \text{ if $n$ is odd } $$
$$ \sqrt[n]{a^n} = |a| \text{ if $n$ is even } $$
I don't really understand the differences between them, kindly explain with an example.
I plugged into google calculator (because that is what I had on hand) $\mathrm{abs}(i)$ and it was said that equaled $i$. Is that true? And if so can I have a proof that it is true?
Note:
As a HS student taking AP Calculus my math proofs are not very advanced but I do understand the non textboo...
@leaky I know you're going off to uni to study meths, but I'm still in high school. I understand a lot of high level maths, but it's 3am and my brain doesn't work right now.
I need to be able to cut the first line (yes cut) out of a file specified (or hardcoded doesn't matter) and replace board_file.txt with that cut text and a newline. Then it must run the codez and take the value outputted and save it with a newline to num.txt (EX 255\n)
@Downgoat I know it is a lot but I have 32k test cases to run and this would make me happy
For each line in file A: Cut a line from file A, Replace the line in board_file.txt with that cut line, Run the program, Save the output of the program on the end of num.txt