A335402 Numbers m such that the only normal integer partition of m whose run-lengths are a palindrome is (1)^m.
0, 1, 2, 4, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269
Offset: 1
Examples
There are 4 normal integer partitions of 10 whose sequence of multiplicities is a palindrome, namely (4321), (33211), (32221), (1111111111), so 10 does not belong to the sequence. The normal integer partitions of 7 are (3211), (2221), (22111), (211111), (1111111), none of which has palindromic multiplicities except the last, so 7 belongs to the sequence.
Crossrefs
Programs
-
Mathematica
Select[Range[0,30],Length[Select[IntegerPartitions[#],And[Or[#=={},Union[#]==Range[First[#]]],Length/@Split[#]==Reverse[Length/@Split[#]]]&]]==1&]
-
Python
# from definition from sympy.utilities.iterables import partitions from sympy import integer_nthroot A335402_list = [] for m in range(0,101): for d in partitions(m,k=integer_nthroot(2*m,2)[0]): l = len(d) if l > 0 and not(l == 1 and 1 in d): k = max(d) if l == k: for i in range(k//2): if d[i+1] != d[k-i]: break else: break else: A335402_list.append(m) # Chai Wah Wu, Jun 22 2020
-
Python
# from formula from sympy import prime A335402_list = [0,1,2,4] + [prime(i) for i in range(3,100)] # Chai Wah Wu, Jun 22 2020
Formula
n is a term if and only if n = 0, 1, 2, 4 or a prime > 3. - Chai Wah Wu, Jun 22 2020
Extensions
a(22)-a(59) from Chai Wah Wu, Jun 22 2020
Comments