%I #34 Dec 06 2021 11:03:39
%S 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,
%T 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,
%U 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
%N a(n) is the number of partitions of n into consecutive parts, plus the total number of parts in those partitions.
%C 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.
%C a(n) = 2 iff n is a power of 2.
%C a(n) = 5 iff n is an odd prime.
%H Antti Karttunen, <a href="/A319895/b319895.txt">Table of n, a(n) for n = 1..20000</a>
%F a(n) = A001227(n) + A204217(n).
%e Illustration of a diagram of partitions into consecutive parts (first 28 rows):
%e . _
%e . _|1
%e . _|2 _
%e . _|3 |2
%e . _|4 _|1
%e . _|5 |3 _
%e . _|6 _|2|3
%e . _|7 |4 |2
%e . _|8 _|3 _|1
%e . _|9 |5 |4 _
%e . _|10 _|4 |3|4
%e . _|11 |6 _|2|3
%e . _|12 _|5 |5 |2
%e . _|13 |7 |4 _|1
%e . _|14 _|6 _|3|5 _
%e . _|15 |8 |6 |4|5
%e . _|16 _|7 |5 |3|4
%e . _|17 |9 _|4 _|2|3
%e . _|18 _|8 |7 |6 |2
%e . _|19 |10 |6 |5 _|1
%e . _|20 _|9 _|5 |4|6 _
%e . _|21 |11 |8 _|3|5|6
%e . _|22 _|10 |7 |7 |4|5
%e . _|23 |12 _|6 |6 |3|4
%e . _|24 _|11 |9 |5 _|2|3
%e . _|25 |13 |8 _|4|7 |2
%e . _|26 _|12 _|7 |8 |6 _|1
%e . _|27 |14 |10 |7 |5|7 _
%e . |28 |13 |9 |6 |4|6|7
%e ...
%e 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.
%e 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:
%e . _ _ _ _
%e . |21 |11 |8 |6
%e . |10 |7 |5
%e . |6 |4
%e . |3
%e . |2
%e . |1
%e .
%e 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.
%o (PARI)
%o A001227(n) = numdiv(n>>valuation(n,2));
%o 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
%o A319895(n) = (A001227(n)+A204217(n)); \\ _Antti Karttunen_, Dec 06 2021
%Y For tables of partitions into consecutive parts see A286000 and A286001.
%Y Cf. A000079, A001227, A065091, A204217, A237048, A237593, A285898, A285899, A285900, A285900, A285901, A285902, A288529, A288772, A288773, A288774, A299765.
%K nonn
%O 1,1
%A _Omar E. Pol_, Sep 30 2018
%E Term a(87) corrected from 6 to 16 by _Antti Karttunen_, Dec 06 2021