Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A074788
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A074788 Prime numbers generated by the sequence a(n+1) = a(n-1) + a(n-2) with initial values a(1)=3, a(2)=0, a(3)=2. +0
2
2, 3, 5, 7, 17, 29, 277, 367, 853, 14197, 43721, 1442968193, 792606555396977, 187278659180417234321, 66241160488780141071579864797, 22584751787583336797527561822649328254745329 (list; graph; listen)
OFFSET

1,1

LINKS

Math. Forum, Discussion

Eric Weisstein's World of Mathematics, Perrin Sequence

FORMULA

a(n+1) = a(n-1)+a(n-2) if a(n+1) is prime and a(1) = 3, a(2) = 0, a(3) = 2

EXAMPLE

a(1)=3, a(2)=0, a(3)=2 a(n+1) = a(n-1) + a(n-2). For n = 3, a(4) = a(2) + a(1) = 0 + 3 = 3; n = 4, a(5) = a(3) + a(2) = 2 + 0 = 2 etc

MATHEMATICA

a[1] = 3; a[2] = 0; a[3] = 2; a[n_] := a[n] = a[n - 2] + a[n - 3]; Do[ If[ PrimeQ[ a[n]], Print[ a[n]]], {n, 1, 357}]

PROGRAM

(PARI) \ compute primes in the sequence a(n+1) = a(n-1)+ a(n-2) \ a(1)=3; a(2)=0: a(3)=2. a(0) not allowed in PARI aprime(n) = { a=vector(n+1); a[1]=3; a[2]=0; a[3]=2; print("n a(n+1)"); for(x=3, n, a[x+1]=a[x-1]+a[x-2]; if(isprime(a[x+1]), print("a("x+1") = "a[x+1])) ) }

CROSSREFS

Sequence in context: A107439 A030480 A048418 this_sequence A070805 A103385 A103389

Adjacent sequences: A074785 A074786 A074787 this_sequence A074789 A074790 A074791

KEYWORD

nonn

AUTHOR

Cino Hilliard (hillcino368(AT)gmail.com), Sep 07 2002

EXTENSIONS

Edited by Robert G. Wilson v (rgwv(AT)rgwv.com), Sep 13 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 November 25 08:46 EST 2009. Contains 167481 sequences.


AT&T Labs Research