|
|
A357618
|
|
a(n) = sum of lengths of partitions of more than one consecutive positive integer adding up to n.
|
|
2
|
|
|
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, 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, 2, 4, 27, 0, 17, 18, 2, 8, 11, 16
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
COMMENTS
|
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.
This sequence is similar to A204217 which sums lengths of all partitions adding up to n including the partition of length 1.
|
|
LINKS
|
|
|
FORMULA
|
a(n) = A204217(n) - 1 for n >= 1, a(0) = 0.
|
|
EXAMPLE
|
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.
The sum of the lengths of these partitions is a(15) = 5 + 3 + 2 = 10.
On the other hand a(8) = 0 because there are no partitions of two or more consecutive integers adding up to 8.
|
|
PROG
|
(Python)
i=2; r=0
while n//i>0:r+=(n%i==1)*i; n-=i; i+=1
return r
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|