|
Search: id:A073754
|
|
|
| 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. |
|
+0 6
|
|
| 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; listen)
|
|
|
OFFSET
|
2,1
|
|
|
EXAMPLE
|
For n=9, a(9)=3 because 9 -> 16 -> 35 -> 67
|
|
PROGRAM
|
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: A100052 A128504 A058137 this_sequence A112458 A019252 A002073
Adjacent sequences: A073751 A073752 A073753 this_sequence A073755 A073756 A073757
|
|
KEYWORD
|
easy,nonn
|
|
AUTHOR
|
Felice Russo (felice.russo(AT)katamail.com), Sep 02 2002
|
|
EXTENSIONS
|
More terms from Jason Earls (zevi_35711(AT)yahoo.com), Sep 04 2002
|
|
|
Search completed in 0.002 seconds
|