login
a(n) = sum of lengths of partitions of more than one consecutive positive integer adding up to n.
2

%I #56 Nov 20 2022 02:03:02

%S 0,0,0,2,0,2,3,2,0,5,4,2,3,2,4,10,0,2,7,2,5,11,4,2,3,7,4,11,7,2,12,2,

%T 0,11,4,14,11,2,4,11,5,2,14,2,8,25,4,2,3,9,9,11,8,2,16,17,7,11,4,2,16,

%U 2,4,27,0,17,18,2,8,11,16

%N a(n) = sum of lengths of partitions of more than one consecutive positive integer adding up to n.

%C A polite number (A138591) has at least one partition of two or more consecutive positive integers that equals n. This sequence is the sum of lengths of all partitions that make a number polite.

%C This sequence is similar to A204217 which sums lengths of all partitions adding up to n including the partition of length 1.

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Polite_number">Polite number</a>

%F a(n) = A204217(n) - 1 for n >= 1, a(0) = 0.

%e n=15 is the sum of three partitions of n with two or more consecutive positive integers: 15 = 1 + 2 + 3 + 4 + 5, 15 = 4 + 5 + 6, 15 = 7 + 8.

%e The sum of the lengths of these partitions is a(15) = 5 + 3 + 2 = 10.

%e On the other hand a(8) = 0 because there are no partitions of two or more consecutive integers adding up to 8.

%o (Python)

%o def A357618(n):

%o i=2;r=0

%o while n//i>0:r+=(n%i==1)*i;n-=i;i+=1

%o return r

%o A357618_list = [A357618(n) for n in range(70)]

%Y Cf. A069283 (politeness of a number), A138591 (polite numbers).

%Y Cf. A204217.

%K nonn,easy

%O 0,4

%A _Daniel Vik_, Oct 06 2022