Byte flipper
This program should flip n bytes from stdin, and write the result to stdout.
Example:
Before:
Hello World
After (n = 2, 2 bytes flipped):
Hello wOrld
@Riker most of them are capital english letters in case you couldn't tell :| one of them is lowercase a and most of the others are greek. in fact, the first paragraph tells you what each type of symbol means
well, I was going to guess something more benign e.g. his real age was discovered to be too low or he'd requested the suspension because he'd become addicted to SO
The problem is that what globalization or export problem is not the right way of resolve problems... Yes possible I wrong on this (and I drunk something) but is my politics position
Lay out the Carpet
code-golfascii-artstring
Inspired by this SO question.
Challenge:
Input:
A string \$s\$
A character \$c\$
Output:
Create a diamond-square ASCII art of the string in all four directions, with the first character of the string in the center and going outwards. Which is i...
Multiplicative Persistence
Multiply all the digits in a number
Repeat until you have a single digit left
As explained by Numberphile:
Numberphile "What's special about 277777788888899?"
Numberphile "Multiplicative Persistence (extra footage)"
Example
277777788888899 → 2x7x7x7x7x7x7x8x8x...
It is possible better not to eat cheese... Not eat cheese if don't know personal the sheep 🐑 produce it... Because dioxin can be in what sheep eat and concentrate in milk (nei grassi)
I dreamed of my grandmother telling me not to eat meat and even cheese , some time ago...
I don't know if this can be right out of Italy my nation ... Possible in us or australia cheese is ok
@Rick iirc, a powerful integer n is one such that, if a prime p divides n, then p² also divides n. Perfect powers, on the other hand, are numbers whose prime factors are all the same. So, 8 is both powerful and a perfect power, since 8=2³ (perfect power); also 2 is the only prime divisor of 8 and 2² also divides 8, so 8 is a powerful number.
@Rick @Rick from wikipedia: "A powerful number is the product of a square and a cube", so perfect powers (k^p, p>1) are powerful but, for instance, 72 = 2^3 * 3^2 is powerful but not a perfect power
There's a visual method for multiplication that is taught to Japanese schoolchildren [citation needed] that uses lines and crossings to get the answer.
Image Source
Your task is to implement this in ASCII art. You will be given two numbers to multiply. The output should be the corresponding A...
@J.Sallé would you say for a positive integer n to be powerful but not a perfect power, would it be safe to say the decomposition of a that number whose gcd is = 1 for example 36 [2,2,3,3] and it's gcd is = to 1
@Rick I'm not sure you can generalize it like that, but I'm not the best reference for maths. There's a bunch of people here who could answer you for certain though
@MilkyWay90 they are called Achilles number and Wikipedia says this is the equation min(a1, a2, …, ak) ≥ 2. If in addition gcd(a1, a2, …, ak) = 1 to determine if such a number is valid
An Achilles number is a number that is powerful but not a perfect power. A positive integer n is a powerful number if, for every prime factor p of n, p2 is also a divisor. In other words, every prime factor appears at least squared in the factorization. All Achilles numbers are powerful. However, not all powerful numbers are Achilles numbers: only those that cannot be represented as mk, where m and k are positive integers greater than 1.
Achilles numbers were named by Henry Bottomley after Achilles, a hero of the Trojan war, who was also powerful but imperfect. Strong Achilles numbers are Achilles...
@MilkyWay90 wikipedia says this is the solution min(a1, a2, …, ak) ≥ 2. If in addition gcd(a1, a2, …, ak) = 1, but i implemented it and still not getting the correct answer