OFFSET
2,1
COMMENTS
a(n) = n^2 for n prime.
Values equal to -1 are hypothetical (tested up to 2*10^10 by Giovanni Resta).
EXAMPLE
a(6) = 12 because 12 is the least number such that sopfr(12) - sopf(12) = 7 - 5 = 2 = 12/6.
MAPLE
with(numtheory): P:=proc(q) local a, j, k, n;
for n from 2 to q do for j from n by n to q do
a:=ifactors(j)[2]; if add(a[k][1]*a[k][2], k=1..nops(a))-add(a[k][1], k=1..nops(a))=j/n then
lprint(n, j); break; fi; od; od; end: P(10^6);
MATHEMATICA
Table[SelectFirst[Range[n^3], Function[k, Total@ # - Total@ Union@ # == k/n &@ Flatten@ Map[ConstantArray[#1, #2] & @@ # &, #] &@ FactorInteger@ k]] /. k_ /; MissingQ@ k -> -1, {n, 2, 58}] (* Version 10.2, or *)
Table[k = 1; While[And[Total@ # - Total@ Union@ # != k/n, k <= n^3] &@ Flatten@ Map[ConstantArray[#1, #2] & @@ # &, #] &@ FactorInteger@ k, k++]; If[k > n^3, -1, k], {n, 2, 58}] (* Michael De Vlieger, Dec 28 2016 *)
CROSSREFS
KEYWORD
sign
AUTHOR
Paolo P. Lava, Dec 27 2016
STATUS
approved