A362426 Number of compositions (ordered partitions) of n into 2 perfect powers (A001597).
0, 0, 1, 0, 0, 2, 0, 0, 1, 2, 2, 0, 2, 2, 0, 0, 1, 4, 1, 0, 2, 0, 0, 0, 2, 2, 2, 0, 2, 2, 0, 2, 1, 4, 2, 2, 4, 2, 0, 0, 4, 4, 0, 2, 2, 2, 0, 0, 2, 0, 3, 0, 4, 2, 1, 0, 0, 4, 2, 2, 0, 2, 0, 2, 1, 4, 0, 0, 4, 0, 0, 0, 3, 2, 2, 0, 2, 0, 0, 0, 2, 2, 2, 0, 0, 4, 0, 0, 0, 4, 2, 2
Offset: 0
Keywords
Links
- Eric Weisstein's World of Mathematics, Perfect Power.
Crossrefs
Cf. A001597.
Programs
-
Mathematica
perfectPowerQ[n_] := n == 1 || GCD @@ FactorInteger[n][[;; , 2]] > 1; a[n_] := Total[Multinomial @@ Tally[#][[;; , 2]] & /@ Select[IntegerPartitions[n, {2}], AllTrue[#, perfectPowerQ] &]]; Array[a, 100, 0] (* Amiram Eldar, May 05 2023 *)