%I #11 Jul 24 2019 12:09:22
%S 4,6,21,18,13,11,67,48,25,149,45,174,122,31,36,139,42,64,90,57,106,
%T 325,102,216,111,258,143,321,226,472,73,60,82,184,540,135,93,264,169,
%U 130,549,53,200,180,229,99,298,622,671,358,157,117,1487,476,1478,85,513
%N Consider van Eck's sequences with a(1)=n and a(2)=0. Sequence lists the index of second occurrence of n.
%H Paolo P. Lava, <a href="/A274425/b274425.txt">Table of n, a(n) for n = 1..1000</a>
%F a(n) = 1 + A171862(n). - _Jan Ritsema van Eck_, Jul 24 2019
%e Starting with a(1)=1 and a(2)=0 the second occurrence of 1 is for a(4):
%e 1, 0, 0, 1, 3, 0, 3, 2, 0, 3, 3, 1, 8, 0, 5, 0, 2, 9, 0, 3, 9, 3, 2, ...
%e Starting with a(1)=2 and a(2)=0 the second occurrence of 2 is for a(6):
%e 2, 0, 0, 1, 0, 2, 5, 0, 3, 0, 2, 5, 5, 1, 10, 0, 6, 0, 2, 8, 0, 3, 13, ...
%e Starting with a(1)=3 and a(2)=0 the second occurrence of 3 is for a(21):
%e 3, 0, 0, 1, 0, 2, 0, 2, 2, 1, 6, 0, 5, 0, 2, 6, 5, 4, 0, 5, 3, 20, 0, ...
%p P:=proc(q) local a,c,h,i,k,m,n,p,x; m:=60000; a:=Array(1..m); p:=Array(0..m, -1); c:=Array(0..1000);
%p for k from 0 to 1000 do for i from 0 to m do p[i]:=0; od; for i from 1 to m do a[i]:=0; od;
%p a[1]:=k; a[2]:=0; p[0]:=2; p[a[1]]:=1; x:=0; for n from 3 to m do h:=p[x]; a[n]:=x; p[x]:=n; x:=0;
%p if h>0 then x:=n-h; fi; if a[n]=k then c[k]:=x+1; break; fi;
%p od; od; [seq(c[n], n=0..1000)]; end: P(1);
%Y Cf. A171862, A181391, A171911-A171918.
%K nonn,easy
%O 1,1
%A _Paolo P. Lava_, Jul 13 2016