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.

A169741 a(n) = smallest k such that A109671(k)=n, or -1 if n does not appear in A109671.

This page as a plain text file.
%I A169741 #4 Mar 30 2012 16:51:44
%S A169741 1,3,7,39,17,15,169,33,31,135,313,231,337,1257,113,1341,65,63,1043,
%T A169741 1077,937,4137,625,225,673,129,127,519,2057,903,2099,2157,1849,2493,
%U A169741 2167,999,1081,2685,1873,8277,1249,7401,1343,8289,497,8349,1079,5373,4139,16827
%N A169741 a(n) = smallest k such that A109671(k)=n, or -1 if n does not appear in A109671.
%H A169741 Zak Seidov, <a href="/A169741/b169741.txt">Table of n, a(n) for n = 1..2443</a>
%p A169741 # Define A109671:
%p A169741 f:=proc(n) option remember; local t1;
%p A169741 if n = 1 then RETURN(1);
%p A169741 elif n mod 2 = 0 then RETURN(f(n/2));
%p A169741 else t1:= f(n-2)-f((n-1)/2);
%p A169741 if t1 > 0 then RETURN(t1) else RETURN(f(n-2)+f((n-1)/2)); fi; fi; end;
%p A169741 # Compute A169741:
%p A169741 M:=50000: M2:=100;
%p A169741 b1:=[seq(f(n),n=1..M)]: b2:=array(1..M);
%p A169741 for n from 1 to M do b2[n]:=-1; od:
%p A169741 for n from 1 to M do i:=b1[n]; if b2[i]<0 then b2[i]:=n; fi; od:
%p A169741 [seq(b2[i],i=1..M2)];
%K A169741 nonn
%O A169741 1,2
%A A169741 _N. J. A. Sloane_, May 02 2010