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.

A284466 Number of compositions (ordered partitions) of n into odd divisors of n.

This page as a plain text file.
%I A284466 #20 Apr 21 2021 11:25:22
%S A284466 1,1,1,2,1,2,6,2,1,20,8,2,60,2,10,450,1,2,726,2,140,3321,14,2,5896,
%T A284466 572,16,26426,264,2,394406,2,1,226020,20,51886,961584,2,22,2044895,
%U A284466 38740,2,20959503,2,676,478164163,26,2,56849086,31201,652968,184947044,980,2,1273706934,6620376,153366,1803937344
%N A284466 Number of compositions (ordered partitions) of n into odd divisors of n.
%H A284466 Alois P. Heinz, <a href="/A284466/b284466.txt">Table of n, a(n) for n = 0..2000</a>
%H A284466 <a href="/index/Com#comp">Index entries for sequences related to compositions</a>
%F A284466 a(n) = [x^n] 1/(1 - Sum_{d|n, d positive odd} x^d).
%F A284466 a(n) = 1 if n is a power of 2.
%F A284466 a(n) = 2 if n is an odd prime.
%e A284466 a(10) = 8 because 10 has 4 divisors {1, 2, 5, 10} among which 2 are odd {1, 5} therefore we have [5, 5], [5, 1, 1, 1, 1, 1], [1, 5, 1, 1, 1, 1], [1, 1, 5, 1, 1, 1], [1, 1, 1, 5, 1, 1], [1, 1, 1, 1, 5, 1], [1, 1, 1, 1, 1, 5] and [1, 1, 1, 1, 1, 1, 1, 1, 1, 1].
%p A284466 with(numtheory):
%p A284466 a:= proc(n) option remember; local b, l;
%p A284466       l, b:= select(x-> is(x:: odd), divisors(n)),
%p A284466       proc(m) option remember; `if`(m=0, 1,
%p A284466          add(`if`(j>m, 0, b(m-j)), j=l))
%p A284466       end; b(n)
%p A284466     end:
%p A284466 seq(a(n), n=0..60);  # _Alois P. Heinz_, Mar 30 2017
%t A284466 Table[d = Divisors[n]; Coefficient[Series[1/(1 - Sum[Boole[Mod[d[[k]], 2] == 1] x^d[[k]], {k, Length[d]}]), {x, 0, n}], x, n], {n, 0, 57}]
%o A284466 (Python)
%o A284466 from sympy import divisors
%o A284466 from sympy.core.cache import cacheit
%o A284466 @cacheit
%o A284466 def a(n):
%o A284466     l=[x for x in divisors(n) if x%2]
%o A284466     @cacheit
%o A284466     def b(m): return 1 if m==0 else sum(b(m - j) for j in l if j <= m)
%o A284466     return b(n)
%o A284466 print([a(n) for n in range(61)]) # _Indranil Ghosh_, Aug 01 2017, after Maple code
%Y A284466 Cf. A000045, A005408, A032021, A100346, A171565.
%K A284466 nonn
%O A284466 0,4
%A A284466 _Ilya Gutkovskiy_, Mar 27 2017