The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A332309 Number of compositions (ordered partitions) of n into distinct parts where no part is a multiple of 3. 3
1, 1, 1, 2, 1, 3, 4, 9, 9, 6, 15, 17, 38, 29, 53, 70, 65, 91, 150, 229, 277, 236, 439, 489, 514, 897, 993, 1632, 1521, 2339, 2972, 3257, 4121, 5992, 5303, 7729, 10932, 15157, 17653, 18398, 26305, 31683, 34408, 51885, 58173, 61098, 90519, 101249, 143402, 156905 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
LINKS
EXAMPLE
a(9) = 6 because we have [8, 1], [7, 2], [5, 4], [4, 5], [2, 7] and [1, 8].
MAPLE
b:= proc(n, i, p) option remember; `if`(i*(i+1)/2<n, 0, `if`(n=0,
p!, add(b(n-i*j, i-1, p+j), j=0..min(irem(i, 3), 1, n/i))))
end:
a:= n-> b(n$2, 0):
seq(a(n), n=0..55); # Alois P. Heinz, Feb 09 2020
MATHEMATICA
b[n_, i_, p_] := b[n, i, p] = If[i(i+1)/2 < n, 0, If[n == 0, p!, Sum[b[n - i j, i - 1, p + j], {j, 0, Min[Mod[i, 3], 1, n/i]}]]];
a[n_] := b[n, n, 0];
a /@ Range[0, 55] (* Jean-François Alcover, Nov 09 2020, after Alois P. Heinz *)
CROSSREFS
Sequence in context: A134876 A019612 A007444 * A166476 A052950 A086851
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Feb 09 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 5 01:34 EDT 2024. Contains 373102 sequences. (Running on oeis4.)