A225106 Prime powers (A025475) that can be represented as a sum of two distinct prime powers.
9, 25, 81, 125, 512, 5041
Offset: 1
Examples
9 = 8 + 1. 25 = 16 + 9. 81 = 32 + 49. 125 = 121 + 4. 512 = 169 + 343. 5041 = 128 + 4913.
Links
- Alex Ratushnyak, C program
Programs
-
C
/* See Ratushnyak link. */
-
Mathematica
nn = 10000; p = Sort[Flatten[Table[Prime[n]^i, {n, PrimePi[Sqrt[nn]]}, {i, 2, Log[Prime[n], nn]}]]]; p = Join[{1}, p]; t = Union[Select[Flatten[Table[p[[i]] + p[[j]], {i, Length[p] - 1}, {j, i + 1, Length[p]}]], # <= nn &]]; Intersection[p, t] (* T. D. Noe, Apr 29 2013 *)
Comments