code: def attractor153_graph(n, p, multiple=3, b=10):
      """Return digraph of iterations of powersum(n,3,10)."""
      G = nx.DiGraph()
      for k in range(1, n + 1):
          if k % multiple == 0 and k not in G:
              k1 = k
              knext = powersum(k1, p, b)
              while k1 != knext:
                  G.add_edge(k1, knext)
                  k1 = knext
                  knext = powersum(k1, p, b)
      return G
  
file_path: networkx/examples/algorithms/plot_iterated_dynamical_systems.py
imports: import networkx
label_desc: Use image node_id 3 for calling a global function with example usage: attractor153_graph(n, p, multiple, b) and returns: G