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 A171898 #37 Feb 07 2025 05:48:44 %S A171898 1,2,6,2,2,5,1,6,42,5,2,4,5,9,14,3,9,3,15,2,4,6,17,3,6,32,56,5,3,131, %T A171898 5,11,5,3,20,6,2,8,15,31,170,3,31,18,3,3,33,5,1,11,46,56,4,37,152,307, %U A171898 3,7,92,4,7,62,52,3,42,3,6,2,19,6,8,3,9,3,650,2,23,8,223,7,206,3,21,25,5,8 %N A171898 Forward van Eck transform of A181391. %C A171898 Given a sequence a, the forward van Eck transform b is defined as follows: If a(n) also appears again in a later position, let a(m) be the next occurrence, and set b(n)=m-n; otherwise b(n)=0. %C A171898 This is a permutation of the positive terms in A181391, where each term m > 0 from that sequence is shifted backwards m+1 positions. - _Jan Ritsema van Eck_, Aug 16 2019 %C A171898 The backwards van Eck transform searches backwards for a repeated value: if a(n) also has appeared in earlier positions, a(m)=a(n) with m<n, then b(n) is the minimum n-m. - _R. J. Mathar_, Jun 24 2021 %H A171898 Alois P. Heinz, <a href="/A171898/b171898.txt">Table of n, a(n) for n = 1..10000</a> %F A171898 From _Jan Ritsema van Eck_, Aug 16 2019: (Start) %F A171898 A181391(i+a(i)+1) = a(i) for any i, a(i)>0. %F A171898 Conversely, a(j-A181391(j)-1) = A181391(j) for any j, A181391(j)>0. (End) %p A171898 ECKf:=proc(a) local b,i,m,n; %p A171898 if whattype(a) <> list then RETURN([]); fi: %p A171898 b:=[]; %p A171898 for n from 1 to nops(a)-1 do %p A171898 # does a(n) appear again? %p A171898 m:=0; %p A171898 for i from n+1 to nops(a) do %p A171898 if (a[i]=a[n]) then m:=i-n; break; fi %p A171898 od: %p A171898 b:=[op(b),m]; %p A171898 od: %p A171898 b:=[op(b),0]; %p A171898 RETURN(b); %p A171898 end: %t A171898 terms = 100; %t A171898 m = 14 terms; (* Increase m until no zero appears in the output *) %t A171898 ClearAll[b, last]; b[_] = 0; last[_] = -1; last[0] = 2; nxt = 1; %t A171898 Do[hist = last[nxt]; b[n] = nxt; last[nxt] = n; nxt = 0; If[hist > 0, nxt = n - hist], {n, 3, m}]; %t A171898 A181391 = Array[b, m]; %t A171898 ECKf[a_List] := Module[{b = {}, i, m, n}, For[n = 1, n <= Length[a]-1, n++, m = 0; For[i = n+1, i <= Length[a], i++, If[a[[i]] == a[[n]], m = i-n; Break[]]]; b = Append[b, m]]; b = Append[b, 0]; Return[b]]; %t A171898 ECKf[A181391][[;; terms]] (* _Jean-François Alcover_, Oct 30 2020, after Maple *) %Y A171898 Cf. A181391 (van Eck's sequence), A171899, A171942. %K A171898 nonn %O A171898 1,2 %A A171898 _N. J. A. Sloane_, Oct 22 2010