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.

A274425 Consider van Eck's sequences with a(1)=n and a(2)=0. Sequence lists the index of second occurrence of n.

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