login
a(n) is the greatest least part of a partition of n into prime parts which does not divide n, or 0 if no such prime exists.
0

%I #20 May 29 2020 15:42:47

%S 0,0,0,2,0,2,3,2,3,3,5,3,3,2,5,5,7,5,7,5,5,5,11,7,7,7,11,7,13,7,13,7,

%T 11,11,17,11,7,11,17,11,19,13,13,13,17,13,19,13,19,13,23,17,23,17,19,

%U 17,17,17,29,19,19,17,23,19,29,19,31,19,29,19,31,19,31,23,29,23,37,19,37,23,29,23,41

%N a(n) is the greatest least part of a partition of n into prime parts which does not divide n, or 0 if no such prime exists.

%C For n = 2,3,4,6 a(n) = 0. For n > 6 there are no terms a(n) = 0, and therefore n has at least one prime partition whose least part prime does not divide n. This sequence lists the greatest such prime for each n. The indices of the records of this sequence are in A001043.

%e The only prime partition of 2 is [2], but 2|2, so a(2) = 0. Also, since [2,2,2] and [3,3] are the prime partitions of 6, with 2|6 and 3|6, a(6) = 0. The prime partitions of 5 are [2,3] and [5], but 2 does not divide 5 so a(5) = 2.

%e From _Michael De Vlieger_, Apr 01 2020: (Start)

%e Chart showing terms k in rows 5 <= n <= 24 of A333238, plotted at pi(k), with "." replacing terms k | n. In the table, we place a(n) in parenthesis:

%e n k

%e -------------------

%e 5 (2) .

%e 6 . .

%e 7 (2) .

%e 8 . (3)

%e 9 (2) .

%e 10 . (3) .

%e 11 2 (3) .

%e 12 . . (5)

%e 13 2 (3) .

%e 14 . (3) .

%e 15 (2) . .

%e 16 . 3 (5)

%e 17 2 3 (5) .

%e 18 . . 5 (7)

%e 19 2 3 (5) .

%e 20 . 3 . (7)

%e 21 2 . (5) .

%e 22 . 3 (5) .

%e 23 2 3 (5) .

%e 24 . . 5 7 (11)

%e ... (End)

%t Block[{m = 84, s, a}, a = ConstantArray[{}, m]; s = {Prime@ PrimePi@ m}; Do[If[# <= m, If[And[FreeQ[a[[#]], Last[s]], Mod[#, Last[s]] != 0], a = ReplacePart[a, # -> Union@ 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}]; Map[If[Length[#] == 0, 0, Last@ #] &, Rest@ a]] (* _Michael De Vlieger_, Apr 01 2020 *)

%Y Cf. A001043, A331634, A333238, A333365.

%K nonn

%O 2,4

%A _David James Sycamore_, Mar 30 2020