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.

A263717 Number of partitions of n into perfect odd powers (1 being excluded).

This page as a plain text file.
%I A263717 #27 May 22 2025 10:21:43
%S A263717 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,2,0,0,0,0,0,0,1,0,
%T A263717 2,0,0,0,0,0,0,1,0,2,0,0,0,1,1,0,2,0,3,0,0,0,1,1,0,2,0,3,0,0,0,1,1,0,
%U A263717 2,0,3,0,1,1,2,2,0,3,0,5,0,1,1,2,2,0,3,0,5,0,1,1,2,2,0,3,1,6
%N A263717 Number of partitions of n into perfect odd powers (1 being excluded).
%H A263717 Martin Y. Champel, <a href="/A263717/a263717.txt">Table of n, a(n) for n = 1...999</a>
%e A263717 a(97) = #{8*9+25, 5*9+25+27, 2*9+25+2*27} = 3.
%t A263717 Needs["Combinatorica`"]; Length@ Select[Combinatorica`Partitions@ #, AllTrue[#, And[PrimePowerQ@ #, ! PrimeQ@ #, OddQ@ #] &, 1] &] & /@ Range[2, 52] (* _Michael De Vlieger_, Nov 05 2015, Version 10 *)
%o A263717 (Python) # Python version 2.7
%o A263717 def a(n):
%o A263717     base = sorted(list(set([a**b for b in range(2,int(log(n)/log(2))) for a in range(3,1+int(n**(1./b)),2)])))
%o A263717     lb = len(base)
%o A263717     if lb == 0:
%o A263717         return 0
%o A263717     sol = 0
%o A263717     s = [n // base[0]]
%o A263717     if lb == 1:
%o A263717         if n % base[0]  == 0: return 1
%o A263717         return 0
%o A263717     while True:
%o A263717         k = s.pop()
%o A263717         while k < 0:
%o A263717             if s ==(lb-1)*[0]:
%o A263717                 return sol
%o A263717             k = s.pop() - 1
%o A263717         s.append(k)
%o A263717         x = n - sum([s[i]*base[i] for i in range(len(s))])
%o A263717         ls = len(s)
%o A263717         if ls == lb:
%o A263717             continue
%o A263717         a = x // base[ls]
%o A263717         b = x % base[ls]
%o A263717         if b == 0:
%o A263717             s.append(a)
%o A263717             sol +=1
%o A263717             if len(s) == lb:
%o A263717                 s.pop()
%o A263717                 s.append(-1)
%o A263717             r = s.pop() - 2
%o A263717             s.append(r)
%o A263717         else:
%o A263717             s.append(a-1)
%o A263717             if a!=0:
%o A263717                 if len(s) == lb: s[lb-1]=-1
%Y A263717 Cf. A075109, A112344.
%K A263717 nonn
%O A263717 1,26
%A A263717 _Martin Y. Champel_, Oct 24 2015