+ 1

What is logic fr this

15,29,56,108,,208,400..

24th Jan 2018, 11:06 AM
C Lover
3 Antworten
24th Jan 2018, 11:43 AM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 4
#This one will be like this according to oeis.org #http://oeis.org/A000078 print("Recursive") def tet(x): if x == 0 or x == 1 or x == 2: return 0 elif x == 3: return 1 else: return tet(x-1)+tet(x-2)+tet(x-3)+tet(x-4) for i in range(20): print(tet(i),end=" ") print("\nList loop") tetra = [0,0,0,1] for i in range(4,20): tetra.append(tetra[i-1]+tetra[i-2]+tetra[i-3]+tetra[i-4]) print(tetra)
24th Jan 2018, 1:23 PM
Ferhat Sevim
Ferhat Sevim - avatar
0
May I ask where did you get these series?
24th Jan 2018, 11:19 AM
BlazingMagpie
BlazingMagpie - avatar