OFFSET
1,5
LINKS
FORMULA
a(n) = n - A240542(n).
EXAMPLE
Illustration of initial terms in two ways:
.
n a(n)
1 0
2 0 _ _
3 1 |_| _|_|
4 1 _|_| _|_|
5 2 |_ _| _|_ _|
6 1 _|_| _|_|
7 2 |_ _| _|_ _|
8 2 _|_ _| _|_ _|
9 2 |_ _| _ _|_ _|
10 3 _|_ _| |_| _|_ _|_|
11 4 |_ _ _| |_| _|_ _ _|_|
12 3 _|_ _| |_| _|_ _|_|
13 4 |_ _ _| _|_| _|_ _ _|_|
14 5 _|_ _ _| |_ _| _|_ _ _|_ _|
15 4 |_ _ _| |_| _|_ _ _|_|
16 4 |_ _ _| |_| |_ _ _|_|
...
Figure 1. Figure 2.
.
Figure 1 shows the illustration of initial terms taken from the isosceles triangle of A237593 (see link). For n = 16 there are (3 + 1) = 4 cells in the 16th row of the diagram, so a(16) = 4.
PROG
(PARI) row235791(n) = vector((sqrtint(8*n+1)-1)\2, i, 1+(n-(i*(i+1)/2))\i);
row237591(n) = {my(orow = concat(row235791(n), 0)); vector(#orow -1, i, orow[i] - orow[i+1]); }
a003056(n) = floor((sqrt(1+8*n)-1)/2);
a(n) = my(row=row237591(n)); sum(k=1, a003056(n), if (!(k%2), row[k])); \\ Michel Marcus, Dec 22 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Omar E. Pol, Dec 21 2020
STATUS
approved