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)).
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
Keywords
Examples
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.
Links
- Ivan Neretin, Table of n, a(n) for n = 0..8191
Programs
-
Mathematica
Nest[Append[#, Count[# - Reverse[#], x_ /; x == 0]] &, {0}, 81]
Formula
a(2n)=0.
a(2n-1)=A272728(n)+n.
Comments