Activity for isaacgâ€
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Edit | Post #290977 | Initial revision | — | 10 months ago |
Answer | — |
A: Make $2 + 2 = 5$ [Pyth], 6 bytes +!-Q2s Try it online! I think there might be a way to shave a byte, but I can't find it. s Sum the input + Add -Q2 Remove the twos from the input ! Negate (more) |
— | 10 months ago |
Edit | Post #290976 | Initial revision | — | 10 months ago |
Answer | — |
A: Is it stuck in a counting loop? [Pyth], 8 bytes qu/Red. Try it online! A list is in a loop if and only if it is the first list seen twice as f is applied repeatedly. qu/Red. u Apply the following function, until a list is seen twice. . Take all prefixes of the list ... (more) |
— | 10 months ago |
Edit | Post #290975 | Initial revision | — | 10 months ago |
Answer | — |
A: Can I follow this recipe? [Pyth], 15 bytes !f.A-VtTsM.T.p Try it online! Outputs True if no valid recipe exists, False if one does. If truthy/falsy outputs are allowed, the `!` can be removed, to just output all valid permutations. Takes input as lists, not sets. !f.A-VtTsM.T.p .p All pe... (more) |
— | 10 months ago |
Edit | Post #290973 | Initial revision | — | 10 months ago |
Answer | — |
A: Print the modular multiplicative inverse / virtual fractions [Pyth], 16 bytes .^RtJ^2yTyJ%2S97 Try it online! This solution uses Euler's formula, which states that if a is coprime to m, a^(phi(m)-1) = a^-1 mod m where phi(m) is the totient function, the number of integers in the range [1, m-1] that are coprime to m. For a power of 2, thi... (more) |
— | 10 months ago |
Edit | Post #290972 |
Post edited: Found a shorter way to generate fibonacci numbers. |
— | 10 months ago |
Edit | Post #290972 | Initial revision | — | 10 months ago |
Answer | — |
A: Fibonacci without consecutive digits [Pyth], 25 23 bytes @f-1aM.:jT;2u+Gs>2GyQU2 Try it online! First, we generate the Fibonacci numbers: u+Gs>2GyQU2 U2 range(2), the list [0, 1] u Apply the following function iteratively, returning the final result. +G ... (more) |
— | 10 months ago |