OFFSET
1,2
COMMENTS
a(199) > 10^6 if it exists. - Robert Israel, Jun 17 2015
LINKS
Robert Israel, Table of n, a(n) for n = 1..198
Robert Israel, Table of n, a(n) for n = 1..10000 with 0 for entries greater than 10^6 (if they exist at all)
EXAMPLE
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.
PROG
(MATLAB)
N = 10^6;
% returns 0 for entries not found
B = zeros(1, M);
A = zeros(1, N);
A(1) = 1;
B(1) = 1;
for n = 2:N
t = mod(-A(n-1)-1, n)+1;
bm = t + [0:floor((M-t)/n)]*n;
bz = find(B(bm)==0, 1);
if numel(bz)==0
break
end
m = t + n*(bz-1);
A(n) = m;
B(m) = n;
end;
B(1:1000) % Robert Israel, Jun 17 2015
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Mark Hudson (mrmarkhudson(AT)hotmail.com), Oct 20 2004
STATUS
approved