OFFSET
1,2
PROG
(AS3)
var a:Array=new Array();
var i:int;
var n:int=0;
var ni:int;
var b:Array = new Array();
for (i=0; i<=1000; i++){
while(a[n]!=undefined) n++;
b.push(String(2*n+1));
a[n]=1;
ni=2*n+1;
while(ni>=2*n+1&&ni>1){
ni=3*ni+1;
while(ni%2==0)ni/=2;
a[(ni-1)/2]=1;
}}
for(i=0; i<1000; i++)b[i]=(b[i+1]-b[i])/2; b.pop();
trace(b);
CROSSREFS
KEYWORD
nonn
AUTHOR
Jimin Park, Aug 07 2011
STATUS
approved