+ 13

Challenge (-2)

Make a program which can find the sum of first n natural of numbers by using n² method and can find all the n number which is taken as input are odd or not....

25th Jul 2017, 3:04 PM
Ekansh
13 Answers
26th Jul 2017, 3:09 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 14
Do you mean 1+2+3+...+n or Find odd numbers in the given inputs or both?
25th Jul 2017, 3:14 PM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 14
do you mean "completing the square method"?
25th Jul 2017, 7:55 PM
Nomeh Uchenna Gabriel
Nomeh Uchenna Gabriel - avatar
+ 8
@krishna Yes ! (Sorry for late reply I was studying ^_^ )
26th Jul 2017, 12:46 AM
Ekansh
+ 8
@aziz please post your code in Playground then post the link here ^_^ @Nomeh what do you mean ? 😸
26th Jul 2017, 12:47 AM
Ekansh
+ 7
do you mean use the rule n * (n + 1)/2
25th Jul 2017, 4:11 PM
aziz
aziz - avatar
+ 7
def sum(n): return n*(n+1)/2
25th Jul 2017, 4:14 PM
aziz
aziz - avatar
26th Jul 2017, 10:04 AM
cHiRaG GhOsH
cHiRaG GhOsH - avatar
26th Jul 2017, 7:34 PM
Popat
Popat - avatar
+ 5
Can u do it
25th Jul 2017, 3:47 PM
Anurag Roy
Anurag Roy - avatar
+ 2
I don't understand the question
26th Jul 2017, 4:18 PM
Garikai
Garikai - avatar
0
@archana in term of complexity your code is the best one
26th Jul 2017, 8:00 PM
aziz
aziz - avatar