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!)
A200745 Number of partitions of n into distinct non-divisors of n. 21

%I #24 Nov 03 2023 10:28:35

%S 1,0,0,0,0,1,0,2,1,2,2,6,1,9,5,6,5,20,4,28,7,19,24,55,6,51,45,49,27,

%T 136,16,180,50,117,143,146,28,403,242,260,68,668,91,852,246,260,649,

%U 1370,90,1191,493,1110,634,2701,386,1635,462,2160,2486,5154,167

%N Number of partitions of n into distinct non-divisors of n.

%H Alois P. Heinz, <a href="/A200745/b200745.txt">Table of n, a(n) for n = 0..2000</a> (terms 0..150 from Reinhard Zumkeller)

%e a(10) = #{7+3, 6+4} = 2;

%e a(11) = #{9+2, 8+3, 7+4, 6+5, 6+3+2, 5+4+2} = 6;

%e a(12) = #{7+5} = 1;

%e a(13) = #{11+2, 10+3, 9+4, 8+5, 8+3+2, 7+6, 7+4+2, 6+5+2, 6+4+3} = 9;

%e a(14) = #{11+3, 10+4, 9+5, 8+6, 6+5+3} = 5;

%e a(15) = #{13+2, 11+5, 9+6, 9+4+2, 8+7, 8+5+2} = 6.

%p a:= proc(n) option remember; local b, l;

%p l:= sort([({$1..n} minus numtheory[divisors](n))[]]);

%p b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,

%p b(n, i-1) +`if`(l[i]>n, 0, b(n-l[i], i-1))))

%p end: forget(b):

%p b(n, nops(l))

%p end:

%p seq(a(n), n=0..80); # _Alois P. Heinz_, Jan 18 2013

%t a[0] = 1; a[n_] := a[n] = Module[{b, l}, l = Sort[Range[n] ~Complement~ Divisors[n]]; b[m_, i_] := b[m, i] = If[m == 0, 1, If[i < 1, 0, b[m, i - 1] + If[l[[i]] > m, 0, b[m - l[[i]], i - 1]]]]; b[n, Length[l]]];

%t Table[a[n], {n, 0, 80}] (* _Jean-François Alcover_, Feb 06 2017, after _Alois P. Heinz_ *)

%o (Haskell)

%o a200745 n = p [nd | nd <- [1..n], mod n nd /= 0] n where

%o p _ 0 = 1

%o p [] _ = 0

%o p (k:ks) m | m < k = 0 | otherwise = p ks (m - k) + p ks m

%Y Cf. A098743, A033630.

%K nonn

%O 0,8

%A _Reinhard Zumkeller_, Nov 22 2011

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 April 25 11:06 EDT 2024. Contains 371967 sequences. (Running on oeis4.)