This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A293704 #32 Feb 24 2018 03:06:03 %S A293704 0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,0,-1,-2,-3,-4,-5,-6,-7,-8,-9, %T A293704 -10,-11,-12,-13,-14,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,-1,-2,-3,-4, %U A293704 -5,-6,-7,-8,-9,-10,-11,-12,-13,-14,-15,-16,-17,-18,18,17,16 %N A293704 a(n) is the shift of the longest palindromic subsequence in the first n terms of A293700. %C A293704 Shift is the measure of the position of the palindromic subsequence within the corresponding sequence of first differences, defined as the number of terms being dropped from the left end of the sequence of first differences minus those dropped from its right end. Thus, when shift is negative, the palindrome has moved leftward from its symmetric position. %H A293704 V.J. Pohjola, <a href="/A293704/b293704.txt">Table of n, a(n) for n = 1..10000</a> %H A293704 V. J. Pohjola, <a href="https://palindromesdotblog.files.wordpress.com/2018/01/shiftp-1-150.pdf">Line plot drawn for n=1...150</a> %H A293704 V. J. Pohjola, <a href="https://palindromesdotblog.files.wordpress.com/2017/12/shiftp-1-2500.pdf">Line plot drawn for n=1...2500</a> %H A293704 V. J. Pohjola, <a href="https://palindromesdotblog.files.wordpress.com/2017/12/shiftp-1-10000.pdf">Line plot drawn for n=1...10000</a> %e A293704 For n = 1, first differences = 3; longest palindrome = 3; a(1) = 0 - 0 = 0. %e A293704 For n = 2, differences = 3, 19; longest palindrome = 3; a(2) = 0 - 1 = -1. %e A293704 For n = 22, differences = 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 3, 16, 3, 3, 16; longest palindrome = 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3; a(22) = 0 - 5 = -5. %t A293704 rootsp = Flatten[Position[Table[Floor[Tan[i]], {i, 1, 10^4}], 1]]; %t A293704 lrootsp = Length[rootsp]; %t A293704 difp = Differences[rootsp]; %t A293704 ldp = Length[difp]; %t A293704 kmax = 500; palsp = {}; lenpalsp = {0}; shiftp = {}; posp = {}; %t A293704 Do[diffip = difp[[1 ;; k]]; lendiffip = Length[diffip]; %t A293704 pmax = k - Last[lenpalsp]; %t A293704 t = Table[difp[[p ;; k]], {p, 1, pmax}]; %t A293704 sp = Flatten[Select[t, # == Reverse[#] &]]; %t A293704 If[sp == {}, %t A293704 AppendTo[palsp, Last[palsp]] && AppendTo[lenpalsp, Last[lenpalsp]], %t A293704 AppendTo[palsp, sp] && AppendTo[lenpalsp, Length[Flatten[sp]]]]; %t A293704 AppendTo[posp, Position[t, Last[palsp]]]; pp = Last[Flatten[posp]] - 1; %t A293704 qq = lendiffip - (pp + Last[lenpalsp]); %t A293704 AppendTo[shiftp, pp - qq], {k, 1, kmax}]; %t A293704 lenpalsp; %t A293704 shiftp (*a(n)=shiftp[[n]]*) %Y A293704 Cf. A293698, A293751, A293700, A293701, A293705, A293699, A293702, A293706, A293703. %K A293704 sign %O A293704 1,19 %A A293704 _V.J. Pohjola_, Oct 21 2017