OFFSET
1,2
COMMENTS
For row 5 onward, the row contents are mirror symmetric too (palindromes), as well as the shape.
Terms in the same column are successive positive integers (with some initial exceptions before row 5).
LINKS
Neal Gersh Tolunsky, Table of n, a(n) for n = 1..10000
Thomas Scheuerle, blue: scatter plot of a(1) to a(10000); red: length of the row where a(n) is contained.
Neal Gersh Tolunsky, First differences of first 100000 terms.
Neal Gersh Tolunsky, Ordinal transform of first 100000 terms.
Neal Gersh Tolunsky, Graph of first 100000 terms.
EXAMPLE
Array (or "tree") begins, with mirror symmetry in row 5 and beyond:
columns v v v v v v v
row 1: 1,
row 2: 2, 1,
row 3: 2,
row 4: 1, 2,
row 5: 3,
row 6: 3, 3,
row 7: 1, 4, 1,
row 8: 2, 5, 2,
row 9: 3, 6, 3,
row 10: 7,
row 11: 1, 4, 4, 1,
row 12: 8,
row 13: 5, 5,
PROG
(MATLAB)
function a = A367251( max_n )
a = [1 2 1 2 1 2];
odd = zeros(1, max_n); even = odd;
odd(1) = 2; even(1)= 2; c = 5;
while length(a) < max_n
if mod(a(c), 2) == 1
odd(1:(a(c)+1)/2) = odd(1:(a(c)+1)/2)+1;
a = [a odd((a(c)+1)/2:-1:2) odd(1:(a(c)+1)/2)];
else
even(1:a(c)/2) = even(1:a(c)/2)+1;
a = [a even(a(c)/2:-1:1) even(1:a(c)/2)];
end
c = c + 1;
end
end % Thomas Scheuerle, Nov 21 2023
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Neal Gersh Tolunsky, Nov 11 2023
STATUS
approved