#Python code to generate the b-file for the sequence A176510 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","2","2"] i=5 a=0 b=1 c=1 d=2 e=2 f=e+d-c+a while i<=121: l+=[str(f),] a=b b=c c=d d=e e=f f=e+d-c+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 A176510 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