OFFSET
1,1
COMMENTS
A reordering of the natural numbers > 1.
The sequence is quasi self-inverse in that a(a(n-1)-1)=n.
LINKS
Hieronymus Fischer, Table of n, a(n) for n = 1..10200
FORMULA
a(n)=a(n-1)-1, if a(n-1)-1 > 1 is not in the set {a(k)| 1<=k<=n-1}, else a(n)=a(n-1)^2.
a(a(n)-1)=n+1.
If we define b(1)=2, b(2)=3, b(k)=b(k-2)^2+1, we get the sequence 2, 3, 5, 10, 26, 101, 677, 10202, 458330, 104080805, …. The b(k) are those terms a(n) of the original sequence for which a(n+1)=a(n)^2.
With these b(k) we obtain for k>1:
a(b(k)-2)=b(k-1),
a(b(k)-1)=b(k-1)^2.
a(b(k))=b(k-1)^2 - 1.
a(n)=b(m)+b(m-1)-n-2, where m is the least index such that b(m)>n+1 (valid for n>=1).
EXAMPLE
a(2)=4=a(1)^2, since 3>2=a(1) is the minimal number not yet in the sequence (because of a(1)=2);
a(15)=19=a(14)-1, since the minimal number not yet in the sequence (=10) is <=a(14)=20.
a(10^4)=b(8)+b(7)-10^4-2=877.
a(10^6)=b(10)+b(9)-10^6-2= 103539133.
CROSSREFS
KEYWORD
nonn
AUTHOR
Hieronymus Fischer, Apr 30 2012
STATUS
approved