login
A319895
a(n) is the number of partitions of n into consecutive parts, plus the total number of parts in those partitions.
1
2, 2, 5, 2, 5, 6, 5, 2, 9, 7, 5, 6, 5, 7, 15, 2, 5, 11, 5, 8, 16, 7, 5, 6, 11, 7, 16, 10, 5, 17, 5, 2, 16, 7, 19, 15, 5, 7, 16, 8, 5, 19, 5, 11, 32, 7, 5, 6, 13, 13, 16, 11, 5, 21, 22, 10, 16, 7, 5, 21, 5, 7, 34, 2, 22, 23, 5, 11, 16, 21, 5, 16, 5, 7, 33, 11, 25, 24, 5, 8, 26, 7, 5, 23, 22, 7, 16, 14, 5
OFFSET
1,1
COMMENTS
a(n) is also the total length of all pairs of orthogonal line segments whose horizontal and upper parts are in the n-th row of the diagram associated to partitions into consecutive parts as shown in the Example section.
a(n) = 2 iff n is a power of 2.
a(n) = 5 iff n is an odd prime.
LINKS
FORMULA
a(n) = A001227(n) + A204217(n).
EXAMPLE
Illustration of a diagram of partitions into consecutive parts (first 28 rows):
. _
. _|1
. _|2 _
. _|3 |2
. _|4 _|1
. _|5 |3 _
. _|6 _|2|3
. _|7 |4 |2
. _|8 _|3 _|1
. _|9 |5 |4 _
. _|10 _|4 |3|4
. _|11 |6 _|2|3
. _|12 _|5 |5 |2
. _|13 |7 |4 _|1
. _|14 _|6 _|3|5 _
. _|15 |8 |6 |4|5
. _|16 _|7 |5 |3|4
. _|17 |9 _|4 _|2|3
. _|18 _|8 |7 |6 |2
. _|19 |10 |6 |5 _|1
. _|20 _|9 _|5 |4|6 _
. _|21 |11 |8 _|3|5|6
. _|22 _|10 |7 |7 |4|5
. _|23 |12 _|6 |6 |3|4
. _|24 _|11 |9 |5 _|2|3
. _|25 |13 |8 _|4|7 |2
. _|26 _|12 _|7 |8 |6 _|1
. _|27 |14 |10 |7 |5|7 _
. |28 |13 |9 |6 |4|6|7
...
For n = 21 we have that there are four partitions of 21 into consecutive parts, they are [21], [11, 10], [8, 7, 6], [6, 5, 4, 3, 2, 1]. The total number of parts is 1 + 2 + 3 + 6 = 12. Therefore the number of partitions plus the total number of parts is 4 + 12 = 16, so a(21) = 16.
On the other hand, in the above diagram there are four pairs of orthogonal line segments whose horizontal upper part are located on the 21st row, as shown below:
. _ _ _ _
. |21 |11 |8 |6
. |10 |7 |5
. |6 |4
. |3
. |2
. |1
.
The four horizontal line segments have length 1, and the vertical line segments have lengths 1, 2, 3, 6 respectively. Therefore the total length of the line segments is 1 + 1 + 1 + 1 + 1 + 2 + 3 + 6 = 16, so a(21) = 16.
PROG
(PARI)
A001227(n) = numdiv(n>>valuation(n, 2));
A204217(n) = { my(i=2, t=1); n--; while(n>0, t += (i*(n%i==0)); n-=i; i++); t }; \\ From A204217 by David A. Corneth, Apr 28 2017
A319895(n) = (A001227(n)+A204217(n)); \\ Antti Karttunen, Dec 06 2021
CROSSREFS
For tables of partitions into consecutive parts see A286000 and A286001.
Sequence in context: A162784 A093660 A093663 * A323504 A011143 A240081
KEYWORD
nonn
AUTHOR
Omar E. Pol, Sep 30 2018
EXTENSIONS
Term a(87) corrected from 6 to 16 by Antti Karttunen, Dec 06 2021
STATUS
approved