|
| |
|
|
A073754
|
|
Number of steps needed to reach a prime when the following map is repeatedly applied to n: if n is even then 2n + #(n) + 1, otherwise 2n - #(n) - 1, where #(n) is the number of digits of n; or -1 is no prime is ever reached.
|
|
5
| |
|
|
3, 3, 2, 12, 2, 10, 11, 3, 1, 1, 9, 1, 1, 9, 2, 1, 10, 2, 1, 10, 1, 1, 8, 1, 2, 8, 1, 2, 13, 1, 1, 13, 1, 1, 9, 1, 1, 9, 1, 1, 35, 1, 2, 35, 8, 2, 7, 8, 1, 7, 1, 1, 52, 1, 6, 52, 21, 6, 12, 21, 1, 12, 1, 1, 12, 1, 1, 12, 28, 1, 8, 28, 1, 8, 5, 1, 6, 5, 1, 6, 1, 1, 34, 1, 5, 34, 1, 5, 71, 1, 7
(list; graph; refs; listen; history; internal format)
|
|
|
|
OFFSET
| 2,1
|
|
|
EXAMPLE
| For n=9, a(9)=3 because 9 -> 16 -> 35 -> 67
|
|
|
PROG
| 10 cls 30 for I=2 to 100 32 H=I 40 if odd(H)=1 then goto 90 else goto 50 50 A=2*H+alen(H)+1:K=K+1 60 if prmdiv(A)=A then print I, K:goto 120 65 if K>1000 then print I, 0:goto 120 70 H=A:goto 40 90 A=2*H-alen(H)-1:K=K+1 100 if prmdiv(A)=A then print I, K:goto 120 105 if K>1000 then print I, 0:goto 120 110 H=A:goto 40 120 K=0 130 next
|
|
|
CROSSREFS
| Sequence in context: A202699 A058137 A164705 * A193229 A112458 A019252
Adjacent sequences: A073751 A073752 A073753 * A073755 A073756 A073757
|
|
|
KEYWORD
| easy,nonn,base
|
|
|
AUTHOR
| Felice Russo (frusso(AT)micron.com), Sep 02 2002
|
|
|
EXTENSIONS
| More terms from Jason Earls (zevi_35711(AT)yahoo.com), Sep 04 2002
|
| |
|
|