login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A099507
a(n) is such that A099506(a(n)) = n.
5
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, 19, 32, 111, 16, 23, 18, 25, 42, 20, 29, 46, 31, 48, 33, 50, 209, 35, 211, 56, 37, 58, 217, 39, 60, 21, 41, 64, 43, 66, 245, 45, 72, 47, 74, 49, 27, 51, 34, 267, 80, 36, 82, 277, 38, 57
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..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;
M = 10*N; % search up to A099506(N) while A099507 < M
% 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
Cf. A099506.
Sequence in context: A053227 A083760 A073597 * A331413 A019104 A019119
KEYWORD
easy,nonn
AUTHOR
Mark Hudson (mrmarkhudson(AT)hotmail.com), Oct 20 2004
STATUS
approved