This site is supported by donations to The OEIS Foundation. Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A113058 a(1) = a(2) = a(3) = 1; for n>2, a(n+1) = a(n) + a(n-1) + a(n-2) iff a(n) is prime, else a(n+1) = a(n) + 1. 1
 1, 1, 1, 2, 4, 5, 11, 20, 21, 22, 23, 66, 67, 156, 157, 380, 381, 382, 383, 1146, 1147, 1148, 1149, 1150, 1151, 3450, 3451, 3452, 3453, 3454, 3455, 3456, 3457, 10368, 10369, 24194, 24195, 24196, 24197, 72588, 72589, 72590, 72591, 72592, 72593, 72594, 72595 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,4 COMMENTS A sequence which is locally tribonacci at prime values. a(n) is prime for a(4) = 2, a(6) = 5, a(7) = 11, a(11) = 23, a(13) = 67, a(15) = 157, a(19) = 383, a(25) = 1151, a(33) = 3457, a(35) = 10369, a(53) = 31121, ... a(n) is a Fibonacci number for n = 1, 2, 3, 4, 6, 9, ... LINKS EXAMPLE a(4) = 2 because a(4-1) = 1 is not prime, so a(4) = a(3) + 1 = 2. a(5) = 4 because a(5-1) = 2 is prime, so a(5) = a(4) + a(3) + a(2) = 2 + 1 + 1 = 4. a(6) = 5 because a(6-1) = 4 is not prime, so a(6) = a(5) + 1 = 4 + 1 = 5. a(7) = 11 because a(7-1) = 5 is prime, so a(7) = a(6) + a(5) + a(4) = 5 + 4 + 2 = 11. a(8) = 20 because a(8-1) = 11 is prime, so a(8) = a(7) + a(6) + a(5) = 11 + 5 + 4 = 20. 21. MATHEMATICA nxt[{a_, b_, c_}]:=If[PrimeQ[c], {b, c, a+b+c}, {b, c, c+1}]; Transpose[NestList[ nxt, {1, 1, 1}, 50]][] (* Harvey P. Dale, Mar 25 2012 *) CROSSREFS Cf. A000040, A000073, A000213, A001590, A113050, A113051, A113057. Sequence in context: A095023 A049913 A223220 * A066145 A095022 A279050 Adjacent sequences:  A113055 A113056 A113057 * A113059 A113060 A113061 KEYWORD easy,nonn AUTHOR Jonathan Vos Post, Oct 13 2005 EXTENSIONS Corrected and extended by Harvey P. Dale, Mar 25 2012 STATUS approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified July 20 01:17 EDT 2019. Contains 325168 sequences. (Running on oeis4.)