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!)
A236019 Smallest number having at least n partitions that contain at least n primes. 2

%I #30 Mar 19 2018 13:22:10

%S 0,2,5,8,10,13,15,17,20,22,24,26,28,31,33,35,37,39,41,43,46,48,50,52,

%T 54,56,58,60,62,64,66,69,71,73,75,77,79,81,83,85,87,89,91,93,95,98,

%U 100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130

%N Smallest number having at least n partitions that contain at least n primes.

%H Alois P. Heinz, <a href="/A236019/b236019.txt">Table of n, a(n) for n = 0..10000</a>

%e a(4) = 10: [2,2,2,2,1,1], [2,2,2,2,2], [3,2,2,2,1], [3,3,2,2].

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

%p `if`(i<1, 0, b(n, i-1, t) +`if`(i>n, 0,

%p b(n-i, i, t -`if`(t>0 and isprime(i), 1, 0)))))

%p end:

%p a:= proc(n) option remember; local k;

%p for k from a(n-1) while b(k, k, n)<n do od; k

%p end: a(0):=0:

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

%t $RecursionLimit = 1000; b[n_, i_, t_] := b[n, i, t] = If[n == 0, If[t == 0, 1, 0], If[i<1, 0, b[n, i-1, t] + If[i>n, 0, b[n-i, i, t - If[t>0 && PrimeQ[i], 1, 0]]]]]; a[n_] := a[n] = Module[{k}, For[k = a[n-1], b[k, k, n] < n, k++]; k]; a[0] = 0; Table[a[n], {n, 0, 61}] (* _Jean-François Alcover_, Jan 27 2014, after _Alois P. Heinz_ *)

%Y Cf. A000041, A002095, A235945, A236444 (complement).

%K nonn

%O 0,2

%A _J. Stauduhar_, Jan 18 2014

%E More terms from _Alois P. Heinz_, Jan 18 2014

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 March 28 08:22 EDT 2024. Contains 371236 sequences. (Running on oeis4.)