#Python code to generate the b-file for the sequence A176505 of OEIS. #The first part of the code creates a list which stores each element of the sequence, generated from the recurrence relation, as a string. l=["0","1","1"] i=3 a=0 b=1 c=1 d=b+a while i<=120: l+=[str(d),] a=b b=c c=d d=b+a i+=1 #The function z(n) returns the nth element from the list, as a long integer type. def z(n): return long(l[n]) #The last part of the code generates the b-file for A176505 i=0 for n in range(0,121): for m in range(0,n+1): print str(i)+" "+str(z(n)-z(m)-z(n-m)+1) i+=1