@public
def find_simple_recurrence(v, A=Function('a'), N=Symbol('n')):
 p = find_simple_recurrence_vector(v)
 n = len(p)
 if (n <= 1):
  return Zero()
 rel = Zero()
 for k in range(n):
  rel += (A((((N + n) - 1) - k)) * p[k])
 return rel

@ public def find_simple_recurrence ( v , A = Function ( 'a' ) , N = Symbol ( 'n' ) ) : p = find_simple_recurrence_vector ( v ) n = len ( p ) if ( n <= 1 ) : return Zero ( ) rel = Zero ( ) for k in range ( n ) : rel += ( A ( ( ( ( N + n ) - 1 ) - k ) ) * p [ k ] ) return rel
detects and returns a recurrence relation from a sequence of several integer terms .