cp's OEIS Frontend

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.

A293706 a(n) is the shift of the longest palindromic subsequence within the first differences of the concatenation of the first n negative and positive roots of floor(tan(k)) = 1.

This page as a plain text file.
%I A293706 #30 Feb 15 2019 10:02:48
%S A293706 0,0,0,0,0,0,0,0,0,2,2,4,4,6,6,8,8,10,10,10,10,10,10,10,10,10,10,10,
%T A293706 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
%U A293706 10,10,10,10,10,10,10,10,10,10,10,10,10,10
%N A293706 a(n) is the shift of the longest palindromic subsequence within the first differences of the concatenation of the first n negative and positive roots of floor(tan(k)) = 1.
%C A293706 Shift is the measure of the position of a palindromic subsequence within the corresponding sequence of first differences, being defined as the number of terms omitted from the left end of the sequence of first differences minus those omitted from its right end. Thus, when shift is, say, 10, the position of the palindrome is 10 steps to the right from the center of the first differences.
%C A293706 a(n) remains at value 10 from n=18 to 1183 after which it drops stepwise linearly to -1544.
%H A293706 V.J. Pohjola, <a href="/A293706/b293706.txt">Table of n, a(n) for n = 1..3001</a>
%H A293706 V.J. Pohjola, <a href="https://palindromesdotblog.files.wordpress.com/2018/02/shiftcon-1-30-a293706.pdf">Line plot for n=1..30</a>
%H A293706 V.J. Pohjola, <a href="https://palindromesdotblog.files.wordpress.com/2018/02/shiftcon-1-3000-a293706.pdf">Line plot for n=1..3000</a>
%e A293706 For n = 1, roots=-18,1; differences = 19; longest palindrome = 19; a(n) = 0.
%e A293706 For n = 2, roots=-21, -18, 1, 4; differences = 3,19,3; longest palindrome = 3,19,3  a(2) = 0.
%e A293706 For n = 9, roots=-106, -90, -87, -84, -65, -62, -43, -40, -21, -18, 1, 4, 23, 26, 45, 48, 67, 70, 89, 92; differences = 16, 3, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3; longest palindrome = 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3, 19, 3; a(9) = 2 - 0 = 2.
%t A293706 rootsA = {}; Do[
%t A293706 If[Floor[Tan[i]] == 1, AppendTo[rootsA, i]], {i, -10^4, 10^4}]
%t A293706 lenN = Length[Select[rootsA, # < 0 &]];
%t A293706 r = 1000; roots = rootsA[[lenN - r ;; lenN + r + 1]];
%t A293706 diff = Differences[roots];
%t A293706 center = Length[roots]/2;
%t A293706 pals = {}; lenpals = {}; lenpal = 1; pos = {}; shift = {};
%t A293706 Do[diffn = diff[[center - (n - 1) ;; center + (n - 1)]];
%t A293706 lendiffn = Length[diffn]; w = 3;
%t A293706 lenpal = lenpal + 2; (Label[alku]; w = w - 1;
%t A293706   pmax = lendiffn - lenpal - (w - 1);
%t A293706   t = Table[diffn[[p ;; lenpal + w + p - 1]], {p, 1, pmax}];
%t A293706   s = Select[t, # == Reverse[#] &]; If[s != {}, Goto[end], Goto[alku]];
%t A293706   Label[end]); AppendTo[pals, First[s]];
%t A293706 AppendTo[lenpals, Length[Flatten[First[s]]]];
%t A293706 AppendTo[pos, Flatten[Position[t, First[s]]]]; pp = Last[Flatten[pos]];
%t A293706 qq = lendiffn - (pp - 1 + Last[lenpals]);
%t A293706 AppendTo[shift, pp - 1 - qq], {n, 1, center}]
%t A293706 shift
%Y A293706 Cf. A293698, A293751, A293700, A293703, A293704, A293699, A293701, A293705, A293702.
%K A293706 sign
%O A293706 1,10
%A A293706 _V.J. Pohjola_, Oct 23 2017