login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A081879 Number of steps for convergence (to 1 or 3) for the process in A081878. 2

%I #13 Jul 15 2017 11:26:18

%S 0,1,0,2,4,1,6,3,6,5,8,2,5,7,5,4,7,7,10,6,10,9,7,3,7,6,9,8,6,6,9,5,9,

%T 8,9,8,8,11,8,7,11,11,9,10,9,8,9,4,9,8,8,7,10,10,10,9,8,7,11,7,7,10,7,

%U 6,11,10,11,9,11,10,10,9,13,9,13,12,10,9,13,8,13,12,11,12,11,10,12,11,10

%N Number of steps for convergence (to 1 or 3) for the process in A081878.

%e For n = 33 we have 34,17,20,10,5,8,4,2,1 = 9 steps.

%o (PARI) countprp3(n) = { for(x=1,n, c=0; p1 = x; while(p1>1, if(p1%2==0,p1/=2, if(isprime(p1),p1+=3,p1 = p1+1;)); if(p1==3,break); c++; ); print1(c" ") )

%o (MIT Scheme) (define (A081879 n) (cond ((or (= 1 n) (= 3 n)) 0) ((even? n) (1+ (A081879 (/ n 2)))) ((isprime? n) (1+ (A081879 (+ n 3)))) (else (1+ (A081879 (1+ n))))))

%Y Cf. A081878, A006577.

%K easy,nonn

%O 1,4

%A _Cino Hilliard_, Apr 12 2003

%E Edited by _Antti Karttunen_ and _Jud McCranie_, Jun 03 2003

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)