kill(all)$

N:1260$

van=facebook.com/LearningCalculus$
d(n):=length(divisors(n))$
p(n):=block([D],D:d(n),if n+D = D*D then 1 else 0)$

( printf(true, "        ~5a ~5a ~8a ~%", "    n", " d(n)", "  n+d(n)"),
  for n: 1 thru N do
    if p(n)=1 then
      printf(true, "        ~5d ~5d ~8d ~%", n, d(n), n+d(n))
)$

set_plot_option([x,1,N])$

plot2d(
[
    [discrete, create_list([n,d(n)],n,1,N)],
    [discrete, [[2,2],[56,8],[132,12],[1260,36]]] 
], 
[legend, false],
[style, [points,1]],
[color, blue, red],
[xlabel, "n"],
[ylabel, "divisors(n)"])$