cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A362424 Number of partitions of n into 2 distinct perfect powers (A001597).

This page as a plain text file.
%I A362424 #17 Feb 16 2025 08:34:05
%S A362424 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,
%T A362424 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,
%U A362424 2,0,0,0,1,1,1,0,1,0,0,0,1,1,1,0,0,2,0,0,0,2,1,1
%N A362424 Number of partitions of n into 2 distinct perfect powers (A001597).
%H A362424 Karl-Heinz Hofmann, <a href="/A362424/b362424.txt">Table of n, a(n) for n = 0..10000</a>
%H A362424 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PerfectPower.html">Perfect Power</a>.
%t A362424 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 *)
%o A362424 (Python)
%o A362424 import numpy
%o A362424 from math import isqrt
%o A362424 A072103 = []
%o A362424 for m in range(2,isqrt(10001)+1):
%o A362424     k = 2
%o A362424     while m**k < 10001:
%o A362424         A072103.append(m**k)
%o A362424         k += 1
%o A362424 A001597 = sorted(set(A072103)) # eliminates multiples and sorting
%o A362424 A362424 = numpy.zeros(10001+1, dtype="i4")
%o A362424 A001597 = [1] + A001597 # we need a "1" in front of A001597
%o A362424 a = 0
%o A362424 while A001597[a] < 10001 // 2:
%o A362424     b = a + 1
%o A362424     while b < len(A001597) and A001597[a] + A001597[b] < 10001:
%o A362424         A362424[A001597[a] + A001597[b]] += 1
%o A362424         b += 1
%o A362424     a += 1
%o A362424 print(list(A362424[0:92])) # _Karl-Heinz Hofmann_, Sep 16 2023
%Y A362424 Cf. A001597, A072103, A362425.
%K A362424 nonn
%O A362424 0,18
%A A362424 _Ilya Gutkovskiy_, Apr 19 2023