OFFSET
1,2
COMMENTS
A partition is prime if all parts are primes. A partition of an odd integer is minimal if it has at most one odd part and is shorter than any other such partition. The terms of the sequence are the multinomials of these partition.
LINKS
Eric Weisstein's World of Mathematics, Prime Partition
FORMULA
If 2n + 1 is prime or n = 1 then a(n) = n. For n > 1 and not prime let a(n) be the multinomial of P where P is the partition [p, 2, ..., 2] with p the greatest prime less than 2n + 1 and 2 occurring (2*n + 1 - p)/2 times in the partition.
EXAMPLE
n 2n+1 partition a(n)
1 3 : [3] 3
2 5 : [5] 5
3 7 : [7] 7
4 9 : [7, 2] 36
5 11: [11] 11
6 13: [13] 13
7 15: [13, 2] 105
8 17: [17] 17
9 19: [19] 19
10 21: [19, 2] 210
11 23: [23] 23
12 25: [23, 2] 300
13 27: [23, 2, 2] 105300
14 29: [29] 29
PROG
(SageMath)
def a(n, op):
if n <= 2: return n
if n % 2 == 1:
if is_prime(n): return n
r = previous_prime(n)
p = [r] + [2]*((n + 1 - r)//2)
else:
r = previous_prime(n - 1)
p = [r, n - r]
return op(p)
print([a(n, multinomial) for n in range(1, 74, 2)]) # is this sequence.
# print([a(n, multinomial) for n in range(0, 74, 2)]) # is A327414.
# print([a(n, mult ) for n in range(0, 74 )]) # is A327415.
# It is remarkable how nicely the syntax here reflects the intention: 'mult' and
# 'multinomials' as exchangeable operators on partitions. Traditional mathematical
# notation obscures this simplicity.
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Sep 07 2019
STATUS
approved