code: def shoup_poly(n, p, K):
      f = [K.one] * (n + 1)
      for i in range(1, n + 1):
          f[i] = (f[i - 1] ** 2 + K.one) % p
      return f
  
file_path: sympy/sympy/polys/benchmarks/bench_galoispolys.py
imports: from sympy.polys.galoistools import gf_from_dict, gf_factor_sqf
  from sympy.polys.domains import ZZ
  from sympy.core.numbers import pi
  from sympy.ntheory.generate import nextprime
label_desc: Use image node_id 2 for calling a global function with example usage: shoup_poly(n, p, K) and returns: f