%I #25 Dec 06 2019 10:02:01
%S 0,2,1,2,4,3,2,2,1,6,5,3,3,4,5,2,8,3,6,6,3,7,2,3,4,5,1,4,7,7,5,2,6,10,
%T 6,3,12,8,4,6,8,5,6,7,5,4,2,3,2,6,9,5,11,3,9,4,7,9,5,7,3,7,3,2,7,8,14,
%U 10,3,8,10,3,8,14,5,8,7,6,2,6,1,10,17,5,12,8,8,7,11,7,5,4,6,4,10,3,3,4
%N a(n) is the sum of the differences of the distinct prime factors p of n and the next square larger than p.
%C From _Bernard Schott_, Dec 05 2019: (Start)
%C a(n) = 1 iff n > 1 is a power of 3.
%C a(n) = 2 iff n > 1 is a power of p prime with p in A028871. (End)
%H Amiram Eldar, <a href="/A078142/b078142.txt">Table of n, a(n) for n = 1..10000</a>
%e a(6)=3 because 6=2*3 and (4-2)+(4-3)=3.
%e a(20)=6 because 20=2^2*5 and (4-2)+(9-5)=6.
%t f[n_]:=Module[{difs=Transpose[FactorInteger[n]][[1]]}, Total[Ceiling[ Sqrt[difs]]^2-difs]]; Array[f,120] (* _Harvey P. Dale_, Apr 18 2011 *)
%K easy,nonn
%O 1,2
%A _Jason Earls_, Nov 20 2002