+ 1

I want this type of series in python -- 1,5,11,19,29,41........

Any one can help me using python

17th Oct 2020, 6:39 PM
Satyam Mishra
Satyam Mishra - avatar
20 Réponses
+ 9
https://code.sololearn.com/cWJxJV6CiUk6/?ref=app This is a geometric series. Can do this without importing anything
18th Oct 2020, 12:56 PM
Peter Nickson
Peter Nickson - avatar
+ 11
num is 1 adder is 4 as long as u want print num add adder to num add 2 to adder
17th Oct 2020, 7:02 PM
Oma Falk
Oma Falk - avatar
+ 4
Learn the basic syntax of python ,and you would be able to implement it in few minutes , increment goes like this ,4,6,8,10,12
17th Oct 2020, 6:42 PM
Abhay
Abhay - avatar
+ 4
It is so simple Square of 1 +0 Square of 2 +1 Square of 3 +2 Square of 4 +3... So on...👆 Got that?
18th Oct 2020, 3:46 PM
The INDIAN
The INDIAN - avatar
+ 3
Jan Markus hehe , good solution 😂
17th Oct 2020, 7:33 PM
Shubhank Gupta
Shubhank Gupta - avatar
+ 3
Take another variable as 0...increment its value in loop by one again and again...and then ads it to squares of numbers
18th Oct 2020, 3:47 PM
The INDIAN
The INDIAN - avatar
+ 3
[ I * I + I - 1 for I in range(n+1)]
18th Oct 2020, 9:23 PM
Ashish
Ashish - avatar
+ 2
Can you explain me?
18th Oct 2020, 7:50 AM
Satyam Mishra
Satyam Mishra - avatar
+ 2
Jan Markus Motorola 68K 🙃
18th Oct 2020, 9:46 AM
QTWizard
+ 2
Num = 1 Inc = 4 While(True): Print(Num) Num += Inc Inc += 2
19th Oct 2020, 2:04 PM
suraj mehra
suraj mehra - avatar
+ 2
27th Oct 2020, 5:55 AM
roshan roy
+ 1
https://code.sololearn.com/cjv8GaRBT184/?ref=app
18th Oct 2020, 9:33 AM
QTWizard
+ 1
Your step starts with 4 and increases by 2 in every loop.In pseudocode would look like this... Increment = 4 X = 1 while <condition> print X X = X + Increment Increment = Increment + 2
18th Oct 2020, 6:12 PM
Konstantinos Theodosiou
Konstantinos Theodosiou - avatar
+ 1
It is so simple Square of 1 +0 Square of 2 +1 Square of 3 +2 Square of 4 +3... So on...👆 But how we can do Help...
19th Oct 2020, 12:41 AM
Satyam Mishra
Satyam Mishra - avatar
19th Oct 2020, 3:20 PM
Kelani Aliyu
Kelani Aliyu - avatar
+ 1
Error
19th Oct 2020, 11:35 PM
Satyam Mishra
Satyam Mishra - avatar
0
Jan Markus, dude why didn't you code it in assembly?
18th Oct 2020, 9:41 AM
QTWizard
0
sequence here (first 20 numbers) https://code.sololearn.com/cb1cAl4mz7zN/?ref=app
18th Oct 2020, 8:01 PM
Sousou
Sousou - avatar
0
Hello guys,Does any of you know a site that gives me exercises with the solution in Python?
19th Oct 2020, 12:36 PM
Malak
Malak - avatar
- 1
You can give me a code?
17th Oct 2020, 6:43 PM
Satyam Mishra
Satyam Mishra - avatar