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.

A339430 Number of compositions (ordered partitions) of n into an even number of distinct squares.

This page as a plain text file.
%I A339430 #13 Mar 09 2021 05:01:44
%S A339430 1,0,0,0,0,2,0,0,0,0,2,0,0,2,0,0,0,2,0,0,2,0,0,0,0,2,2,0,0,2,24,0,0,0,
%T A339430 2,0,0,2,0,24,2,2,0,0,0,2,24,0,0,0,26,24,2,2,24,0,0,24,2,0,0,2,24,24,
%U A339430 0,28,24,0,2,0,24,24,0,2,26,24,0,0,72,24,2
%N A339430 Number of compositions (ordered partitions) of n into an even number of distinct squares.
%H A339430 Alois P. Heinz, <a href="/A339430/b339430.txt">Table of n, a(n) for n = 0..10000</a>
%H A339430 <a href="/index/Com#comp">Index entries for sequences related to compositions</a>
%H A339430 <a href="/index/Su#ssq">Index entries for sequences related to sums of squares</a>
%e A339430 a(30) = 24 because we have [16, 9, 4, 1] (24 permutations).
%p A339430 b:= proc(n, i, p) option remember; `if`(n=0, irem(1+p, 2)*p!,
%p A339430      (s-> `if`(s>n, 0, b(n, i+1, p)+b(n-s, i+1, p+1)))(i^2))
%p A339430     end:
%p A339430 a:= n-> b(n, 1, 0):
%p A339430 seq(a(n), n=0..100);  # _Alois P. Heinz_, Dec 04 2020
%t A339430 b[n_, i_, p_] := b[n, i, p] = If[n == 0, Mod[1 + p, 2]*p!,
%t A339430      With[{s = i^2}, If[s > n, 0, b[n, i + 1, p] +
%t A339430      b[n - s, i + 1, p + 1]]]];
%t A339430 a[n_] := b[n, 1, 0];
%t A339430 a /@ Range[0, 100] (* _Jean-François Alcover_, Mar 09 2021, after _Alois P. Heinz_ *)
%Y A339430 Cf. A000290, A331844, A332305, A339366, A339418, A339431.
%K A339430 nonn,look
%O A339430 0,6
%A A339430 _Ilya Gutkovskiy_, Dec 04 2020