login
a(n) is such that A099506(a(n)) = n.
5

%I #9 Apr 25 2016 12:05:01

%S 1,4,2,6,17,3,10,5,12,7,14,53,9,8,11,22,13,24,15,26,99,103,28,107,30,

%T 19,32,111,16,23,18,25,42,20,29,46,31,48,33,50,209,35,211,56,37,58,

%U 217,39,60,21,41,64,43,66,245,45,72,47,74,49,27,51,34,267,80,36,82,277,38,57

%N a(n) is such that A099506(a(n)) = n.

%C a(199) > 10^6 if it exists. - _Robert Israel_, Jun 17 2015

%H Robert Israel, <a href="/A099507/b099507.txt">Table of n, a(n) for n = 1..198</a>

%H Robert Israel, <a href="/A099507/a099507.txt">Table of n, a(n) for n = 1..10000</a> with 0 for entries greater than 10^6 (if they exist at all)

%e Gives the positions in the sequence A099506 at which the integers n>0 appear. That sequence begins: 1,3,6,2,8,4,... so a(1)=1, a(2)=4, a(3)=2, etc.

%o (MATLAB)

%o N = 10^6;

%o M = 10*N; % search up to A099506(N) while A099507 < M

%o % returns 0 for entries not found

%o B = zeros(1, M);

%o A = zeros(1, N);

%o A(1) = 1;

%o B(1) = 1;

%o for n = 2:N

%o t = mod(-A(n-1)-1,n)+1;

%o bm = t + [0:floor((M-t)/n)]*n;

%o bz = find(B(bm)==0,1);

%o if numel(bz)==0

%o break

%o end

%o m = t + n*(bz-1);

%o A(n) = m;

%o B(m) = n;

%o end;

%o B(1:1000) % _Robert Israel_, Jun 17 2015

%Y Cf. A099506.

%K easy,nonn

%O 1,2

%A Mark Hudson (mrmarkhudson(AT)hotmail.com), Oct 20 2004