login
A263717
Number of partitions of n into perfect odd powers (1 being excluded).
1
0, 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, 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, 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
OFFSET
1,27
LINKS
EXAMPLE
a(97) = #{8*9+25, 5*9+25+27, 2*9+25+2*27} = 3.
MATHEMATICA
Needs["Combinatorica`"]; Length@ Select[Combinatorica`Partitions@ #, AllTrue[#, And[PrimePowerQ@ #, ! PrimeQ@ #, OddQ@ #] &, 1] &] & /@ Range[52] (* Michael De Vlieger, Nov 05 2015, Version 10 *)
PROG
(Python)
from math import log
def a(n):
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)])))
lb = len(base)
if lb == 0:
return 0
sol = 0
s = [n // base[0]]
if lb == 1:
if n % base[0] == 0: return 1
return 0
while True:
k = s.pop()
while k < 0:
if s ==(lb-1)*[0]:
return sol
k = s.pop() - 1
s.append(k)
x = n - sum([s[i]*base[i] for i in range(len(s))])
ls = len(s)
if ls == lb:
continue
a = x // base[ls]
b = x % base[ls]
if b == 0:
s.append(a)
sol +=1
if len(s) == lb:
s.pop()
s.append(-1)
r = s.pop() - 2
s.append(r)
else:
s.append(a-1)
if a!=0:
if len(s) == lb: s[lb-1]=-1
CROSSREFS
Sequence in context: A216512 A078359 A107329 * A230279 A376366 A085859
KEYWORD
nonn
AUTHOR
Martin Y. Champel, Oct 24 2015
EXTENSIONS
Missing a(1) = 0 prepended by Andrei Zabolotskii, Jan 01 2026
STATUS
approved