+ 16
*DAILY CHALLENGE* : Write a code that takes as input a number n, calculates the n'th "flyn number" and prints it to the screen.
INFO: 25 // 4 = 6 12 // 8 = 1 --> INTEGER DIVISION!!! TASK: The flyn-function is defined as following: f(x) = (x^3) // (x*3) = y (for x > 0) We call the number x a "flyn number" if the cros-sum of x and the cros-sum of y are equal. EXAMPLE: x = 27 y = (27^3) // (27*3) = 243 cros-sum(27) = cros-sum(243) = 9 ---> 27 is a "flyn number". GOOD LUCK AND HAVE FUN !!!
42 ответов
+ 14
+ 8
I'm late but dis is mine
https://code.sololearn.com/cumC73M27Uz9/?ref=app
+ 7
Redid the code to fit the challenge correctly.
My entry in C#:
https://code.sololearn.com/c4lu8t20U0Pn/#cs
+ 6
https://code.sololearn.com/c6BE8LHArJbd/?ref=app
+ 5
Here's my try
https://code.sololearn.com/copE4LAcwnC6/?ref=app
+ 5
here, my try https://code.sololearn.com/W0uvAHALEqDc/?ref=app
nice challenges 👍
+ 5
Funny challenge. Here is my try with Python:
https://code.sololearn.com/c3c2pnBYVI2Q
+ 4
@Antoine "Why not >9..." (hang?)
Line 2, your control variable is x (+1)
Line 18, you modify x (back down)
Based on how my JavaScript engine is hanging (my debug doesn't print and I can't run your code twice), it may be getting stuck in that loop.
+ 4
i slightly update my Solution according to given rules.
https://code.sololearn.com/ceYNS3vMyjUL/?ref=app
+ 3
@Antoine Bergerault
In some langs (e.g. Python), // is integer division (divide and truncate).
+ 3
Here's my C# implementation ✌
LINQ One-Liner〰
num.ToString().Sum(d => char.GetNumericValue(d));
https://code.sololearn.com/c00eb8Lwcc9y/?ref=app
+ 3
This is my Solution for this challenge
https://code.sololearn.com/cEzz03Jg0IFY/?ref=app
+ 3
https://code.sololearn.com/WEACVUt71Mv3/?ref=app
+ 2
I would like to get a clarification of the definition of cross sum.
May I know what's the cross sum of 1234? Is it 10 or 1?
+ 2
@zephyr it's 10
+ 2
My first try:
https://code.sololearn.com/cub8HUlJj0nt/?ref=app
+ 2
Hopefully not so behind on this one: https://code.sololearn.com/c662i46kCiZg
If desired, this code could be easily modified to produce all flyn numbers up to and including the n-th one.
+ 2
see this one..