[go: up one dir, main page]

login
A272727
a(0)=0; thereafter a(n+1) is the number of coincidences between the sequence so far (a(0), ..., a(n)) and its reverse (a(n), ..., a(0)).
7
0, 1, 0, 3, 0, 3, 0, 5, 0, 7, 0, 7, 0, 7, 0, 9, 0, 9, 0, 11, 0, 13, 0, 15, 0, 15, 0, 15, 0, 15, 0, 17, 0, 19, 0, 19, 0, 19, 0, 21, 0, 21, 0, 23, 0, 23, 0, 25, 0, 27, 0, 29, 0, 31, 0, 31, 0, 31, 0, 31, 0, 31, 0, 33, 0, 33, 0, 35, 0, 37, 0, 39, 0, 39, 0, 39, 0, 39, 0, 41, 0, 43
OFFSET
0,4
COMMENTS
a(2n-1) is positive and odd.
a(2n+1) - a(2n-1) is always either 0 or 2.
The number of repetitions of the value 2n-1 is A272729(n).
LINKS
FORMULA
a(2n)=0.
a(2n-1)=A272728(n)+n.
EXAMPLE
A one-element series [0] coincides with its own reverse, hence a(1)=1.
[0,1] and [1,0] differ in every term, hence a(2)=0.
[0,1,0] is its own reverse, hence a(3)=3.
[0,1,0,3] and [3,0,1,0] differ in every term, hence a(4)=0.
[0,1,0,3,0] and [0,3,0,1,0] coincide in three terms, hence a(5)=3.
MATHEMATICA
Nest[Append[#, Count[# - Reverse[#], x_ /; x == 0]] &, {0}, 81]
CROSSREFS
Sequence in context: A292130 A291971 A240923 * A333791 A323135 A356205
KEYWORD
nonn
AUTHOR
Ivan Neretin, May 05 2016
STATUS
approved