+ 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 !!!

15th Aug 2017, 11:25 AM
Julian Fechner
Julian Fechner - avatar
42 Respuestas
15th Aug 2017, 5:45 PM
Shamima Yasmin
Shamima Yasmin - avatar
15th Aug 2017, 11:42 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
23rd Aug 2017, 3:55 PM
David Akhihiero
David Akhihiero - avatar
+ 7
Redid the code to fit the challenge correctly. My entry in C#: https://code.sololearn.com/c4lu8t20U0Pn/#cs
17th Aug 2017, 9:40 PM
Dalton Ponder
Dalton Ponder - avatar
+ 6
https://code.sololearn.com/c6BE8LHArJbd/?ref=app
15th Aug 2017, 1:40 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
15th Aug 2017, 3:03 PM
Garikai
Garikai - avatar
+ 5
here, my try https://code.sololearn.com/W0uvAHALEqDc/?ref=app nice challenges 👍
15th Aug 2017, 3:25 PM
ysraelcon
ysraelcon - avatar
+ 5
Funny challenge. Here is my try with Python: https://code.sololearn.com/c3c2pnBYVI2Q
15th Aug 2017, 4:29 PM
Salva Pérez
Salva Pérez - avatar
+ 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.
15th Aug 2017, 2:32 PM
Kirk Schafer
Kirk Schafer - avatar
+ 4
i slightly update my Solution according to given rules. https://code.sololearn.com/ceYNS3vMyjUL/?ref=app
17th Aug 2017, 6:44 AM
wolfsan
wolfsan - avatar
+ 3
@Antoine Bergerault In some langs (e.g. Python), // is integer division (divide and truncate).
15th Aug 2017, 2:03 PM
Kirk Schafer
Kirk Schafer - avatar
15th Aug 2017, 3:53 PM
Nicolas
Nicolas - avatar
+ 3
Here's my C# implementation ✌ LINQ One-Liner〰 num.ToString().Sum(d => char.GetNumericValue(d)); https://code.sololearn.com/c00eb8Lwcc9y/?ref=app
15th Aug 2017, 5:00 PM
Zephyr Koo
Zephyr Koo - avatar
+ 3
This is my Solution for this challenge https://code.sololearn.com/cEzz03Jg0IFY/?ref=app
16th Aug 2017, 6:37 AM
wolfsan
wolfsan - avatar
+ 3
https://code.sololearn.com/WEACVUt71Mv3/?ref=app
22nd Aug 2017, 2:52 PM
Qaisar Khan
Qaisar Khan - avatar
+ 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?
15th Aug 2017, 4:36 PM
Zephyr Koo
Zephyr Koo - avatar
+ 2
@zephyr it's 10
15th Aug 2017, 4:46 PM
Αητοιπe
Αητοιπe - avatar
15th Aug 2017, 5:16 PM
P̶r̶o̴g̶r̷a̴m̴m̸i̶n̷g̶H̴o̷r̶r̵o̸r̷
P̶r̶o̴g̶r̷a̴m̴m̸i̶n̷g̶H̴o̷r̶r̵o̸r̷ - avatar
+ 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.
15th Aug 2017, 9:59 PM
janKalupana
janKalupana - avatar
+ 2
see this one..
22nd Aug 2017, 2:51 PM
Qaisar Khan
Qaisar Khan - avatar