%I #21 Aug 29 2021 01:56:23
%S 0,0,1,2,1,5,3,9,3,3,7,19,7,35,11,7,7,71,15,135,15,15,23,263,31,15,47,
%T 15,31,527,63,1039,47,31,95,31,111,2079,143,63,95,4127,191,8255,63,63,
%U 351,16447,223,63,191,127,319,32895,383,127,191,255,639,65663
%N a(n) = Sum_{p in L(n)} 2^(pi(p) - 1) where L(n) is the set of all least primes in partitions of n into prime parts.
%C In other words, convert the indices of primes p_i in row n of A333238 to 1s in the (i - 1)-th place to create a binary number m; convert m to decimal.
%C The number of prime partitions of n is shown by A000607(n), which in terms of this sequence equates to the number of 1s in a(n), written in binary.
%C For prime p, row p of A333238 includes p itself as the largest term, since p is the sum of (p); here we find a(p) >= 2^(p - 1). More specifically, a(2) = 1, a(p) > 2^(p - 1) for p odd.
%C For n = A330507(m), a(n) = 2^m - 1, the smallest n with this value in this sequence.
%H Alois P. Heinz, <a href="/A333259/b333259.txt">Table of n, a(n) for n = 0..10000</a>
%e The least primes among the prime partitions of 5 are 2 and 5, cf. the 2 prime partitions of 5: (5) and (3, 2), thus row 5 of A333238 lists {2, 5}. Convert these to their indices gives us {1, 3}, take the sum of 2^(1 - 1) and 2^(3 - 1) = 2^0 + 2^2 = 1 + 4 = 5, thus a(5) = 5.
%e The least primes among the prime partitions of 6 are 2 and 3, cf. the two prime partitions of 6, (3, 3), and (2, 2, 2), thus row 6 of A333238 lists {2, 3}. Convert these to their indices: {1, 2}, take the sum of 2^(1 - 1) and 2^(2 - 1) = 2^0 + 2^1 = 1 + 2 = 3, thus a(6) = 3.
%e Row 7 of A333238 contains {2, 7} because there are 3 prime partitions of 7: (7), (5, 2), (3, 2, 2). Note that 2 is the smallest part of the latter two partitions, thus only 2 and 7 are distinct. Convert to indices: {1, 4}, sum 2^(1 - 1) and 2^(4 - 1) = 2^0 + 2^3 = 1 + 8 = 9, therefore a(7) = 9.
%e Table plotting prime p in row n of A333238 at pi(p) place, intervening primes missing from row n are shown by "." as a place holder. We convert the indices of these primes into a binary number to obtain the terms of this sequence:
%e n Row n of A333238 binary a(n)
%e ---------------------------------------
%e 2: 2 => 1 => 1
%e 3: . 3 => 10 => 2
%e 4: 2 => 1 => 1
%e 5: 2 . 5 => 101 => 5
%e 6: 2 3 => 11 => 3
%e 7: 2 . . 7 => 1001 => 9
%e 8: 2 3 => 11 => 3
%e 9: 2 3 => 11 => 3
%e 10: 2 3 5 => 111 => 7
%e 11: 2 3 . . 11 => 10011 => 19
%e 12: 2 3 5 => 111 => 7
%e ...
%p b:= proc(n, p, t) option remember; `if`(n=0, 1, `if`(p>n, 0, (q->
%p add(b(n-p*j, q, 1), j=1..n/p)*t^p+b(n, q, t))(nextprime(p))))
%p end:
%p a:= proc(n) option remember; (p-> add(`if`(isprime(i) and coeff(p, x,
%p i)>0, 2^(numtheory[pi](i)-1), 0), i=2..degree(p)))(b(n, 2, x))
%p end:
%p seq(a(n), n=0..63); # _Alois P. Heinz_, Mar 16 2020
%t Block[{a, m = 59, s}, a = ConstantArray[{}, m]; s = {Prime@ PrimePi@ m}; Do[If[# <= m, If[FreeQ[a[[#]], Last@ s], a = ReplacePart[a, # -> Append[a[[#]], Last@ s]], Nothing]; AppendTo[s, Last@ s], If[Last@ s == 2, s = DeleteCases[s, 2]; If[Length@ s == 0, Break[], s = MapAt[Prime[PrimePi[#] - 1] &, s, -1]], s = MapAt[Prime[PrimePi[#] - 1] &, s, -1]]] &@ Total[s], {i, Infinity}]; {0, 0}~Join~Map[Total[2^(-1 + PrimePi@ #)] &, Rest[Union /@ a]]]
%Y Cf. A000607, A000720, A330507, A333129, A333238.
%K nonn,look
%O 0,4
%A _Michael De Vlieger_, Mar 16 2020