%I #7 May 13 2023 17:13:23
%S 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,
%T 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,
%U 4,0,0,0,3,2,2,0,2,0,0,0,2,2,2,0,0,4,0,0,0,4,2,2
%N Number of compositions (ordered partitions) of n into 2 perfect powers (A001597).
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PerfectPower.html">Perfect Power</a>.
%t 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 *)
%Y Cf. A001597.
%K nonn
%O 0,6
%A _Ilya Gutkovskiy_, Apr 19 2023
|