Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A073741
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A073741 Number of steps needed to reach a prime when the following map is repeatedly applied to n: if n is even then 2n+1, otherwise 2n-1; or -1 if no prime is ever reached. +0
1
1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 3, 3, 1, 1, 4, 4, 1, 1, 1, 1, 2, 2, 2, 2, 1, 1, 2, 2, 1, 1, 3, 3, 2, 2, 1, 1, 5, 5, 4, 4, 3, 3, 1, 1, 8, 8, 1, 1, 1, 1, 6, 6, 1, 1, 1, 1, 2, 2, 2, 2, 7, 7, 2, 2, 5, 5, 1, 1, 2, 2, 3, 3, 1, 1, 4, 4, 1, 1, 3, 3, 10, 10, 2, 2, 1, 1, 2, 2, 1, 1, 7, 7, 582, 582, 1, 1, 1, 1, 2, 2, 2, 2 (list; graph; listen)
OFFSET

2,3

EXAMPLE

For n=4, a(4)=2 because 4 ->9 ->17

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+1:K=K+1 60 if prmdiv(A)=A then print I, K:goto 120 65 if K>10000 then print I, "no solution":goto 120 70 H=A:goto 40 90 A=2*H-1:K=K+1 100 if prmdiv(A)=A then print I, K:goto 120 105 if K>10000 then print I, "no solution":goto 120 110 H=A:goto 40 120 K=0 130 next

CROSSREFS

Sequence in context: A157129 A101615 A140193 this_sequence A071838 A157896 A156072

Adjacent sequences: A073738 A073739 A073740 this_sequence A073742 A073743 A073744

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

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified December 11 12:57 EST 2009. Contains 170656 sequences.


AT&T Labs Research