login
A081879
Number of steps for convergence (to 1 or 3) for the process in A081878.
2
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, 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, 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
OFFSET
1,4
EXAMPLE
For n = 33 we have 34,17,20,10,5,8,4,2,1 = 9 steps.
PROG
(PARI) countprp3(nmax) = { for(x=1, nmax, c=0; p1 = x; while(p1!=1 && p1!=3, if(p1%2==0, p1/=2, if(isprime(p1), p1+=3, p1=p1+1; )); c++; ); print1(c, ", ") )}; \\ Corrected by Andrey Zabolotskiy, May 30 2024
(MIT/GNU 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))))))
CROSSREFS
Sequence in context: A249146 A225679 A375494 * A066248 A065164 A138124
KEYWORD
easy,nonn
AUTHOR
Cino Hilliard, Apr 12 2003
EXTENSIONS
Edited by Antti Karttunen and Jud McCranie, Jun 03 2003
STATUS
approved