Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A089725
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A089725 Let f(n) = (2n+1), g(n) = (n-1)/2. Then a(n) = f(f(f(...(n)))), where one gets prime at every step. If f(n) is not a prime then a(n) = g(g(g...(n)))) where one gets a prime at every step. If f(n) and g(n) both are composite then a(n) = 0. +0
1
7, 47, 7, 0, 47, 13, 3, 17, 19, 0, 47, 0, 0, 59, 31, 0, 0, 37, 0, 167, 43, 0, 47, 0, 0, 107, 13, 0, 59, 61, 0, 0, 67, 0, 71, 73, 0, 0, 79, 0, 167, 0, 0, 2879, 0, 0, 2, 97, 0, 101, 103, 0, 107, 109, 0, 227, 0, 0, 29, 0, 0, 0, 127, 0, 263, 0, 0, 137, 139, 0, 0, 0, 0, 149, 151, 0, 0, 157, 0 (list; graph; listen)
OFFSET

1,1

EXAMPLE

a(2) = 47 as f(f(f(f(2)))) = 47. a(7) = 3 aas f(7) = 15 but g(7) = 3.

a(4)= 0 as f(4) = 4*2+1 =9 is composite and (4-1)/2 is non integer.

MAPLE

f:=n->2*n+1: g:=n->(n-1)/2: for n from 1 to 100 do mf:=f(n): mg:=g(n): if isprime(mf) then while isprime(f(mf)) do mf:=f(mf) od: printf("%d, ", mf) elif n mod 2= 1 and isprime(mg) then while mg mod 2=1 and isprime(g(mg)) do mg:=g(mg) od: printf("%d, ", mg) else printf("%d, ", 0) fi od: (C. Ronaldo)

CROSSREFS

Sequence in context: A000823 A036944 A068640 this_sequence A086040 A009241 A124837

Adjacent sequences: A089722 A089723 A089724 this_sequence A089726 A089727 A089728

KEYWORD

nonn

AUTHOR

Amarnath Murthy (amarnath_murthy(AT)yahoo.com), Nov 18 2003

EXTENSIONS

More terms from C. Ronaldo (aga_new_ac(AT)hotmail.com), Dec 26 2004

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 September 6 16:04 EDT 2008. Contains 143483 sequences.


AT&T Labs Research