A138508 Semiprime analog of Riesel problem: start with n; repeatedly double and add 1 until reach a semiprime. Sequence gives number of steps to reach a semiprime or 0 if no semiprime is ever reached.
3, 5, 2, 1, 4, 3, 1, 2, 2, 1, 3, 1, 2, 3, 5, 1, 1, 4, 1, 4, 2, 2, 2, 1, 1, 3, 1, 1, 2, 2, 4, 1, 4, 1, 2, 3, 3, 1, 2, 3, 3, 1, 1, 7, 1, 1, 1, 3, 4, 2, 3, 10, 2, 2, 1, 6, 1, 2, 1, 1, 1, 4, 3, 1, 3, 1, 3, 3, 3, 1, 1, 1, 2, 2, 2, 5, 1, 4, 1, 1, 2, 6, 2, 1, 3, 3, 3, 1, 6, 5, 1, 1, 1, 5, 3, 5, 2, 2, 3, 1, 1, 1, 2, 1, 9, 1, 1, 1, 1, 1, 2
Offset: 1
Programs
-
Maple
isA001358 := proc(n) RETURN( numtheory[bigomega](n) = 2) ; end: A138508 := proc(n) local a,niter ; niter := n ; a := 0 ; while not isA001358(niter) do a := a+1 ; niter := 2*niter+1 ; od: a ; end: seq(A138508(n),n=1..200) ; # R. J. Mathar, May 12 2008
-
PARI
a(n) = my(x=n, i=0); while(1, x=2*x+1; i++; if(bigomega(x)==2, return(i))); \\ Felix Fröhlich, Apr 21 2021
Extensions
More terms from R. J. Mathar, May 12 2008
All terms corrected by Felix Fröhlich, Apr 21 2021
Comments