login
A362424
Number of partitions of n into 2 distinct perfect powers (A001597).
4
0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 0, 2, 1, 1, 2, 1, 0, 0, 2, 2, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 2, 1, 0, 0, 0, 2, 1, 1, 0, 1, 0, 1, 0, 2, 0, 0, 2, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 2, 0, 0, 0, 2, 1, 1
OFFSET
0,18
LINKS
Eric Weisstein's World of Mathematics, Perfect Power.
MATHEMATICA
perfectPowerQ[n_] := n == 1 || GCD @@ FactorInteger[n][[;; , 2]] > 1; a[n_] := Count[IntegerPartitions[n, {2}], _?(AllTrue[#, perfectPowerQ] && UnsameQ @@ # &)]; Array[a, 100, 0] (* Amiram Eldar, May 05 2023 *)
PROG
(Python)
import numpy
from math import isqrt
A072103 = []
for m in range(2, isqrt(10001)+1):
k = 2
while m**k < 10001:
A072103.append(m**k)
k += 1
A001597 = sorted(set(A072103)) # eliminates multiples and sorting
A362424 = numpy.zeros(10001+1, dtype="i4")
A001597 = [1] + A001597 # we need a "1" in front of A001597
a = 0
while A001597[a] < 10001 // 2:
b = a + 1
while b < len(A001597) and A001597[a] + A001597[b] < 10001:
A362424[A001597[a] + A001597[b]] += 1
b += 1
a += 1
print(list(A362424[0:92])) # Karl-Heinz Hofmann, Sep 16 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Apr 19 2023
STATUS
approved