login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A113057 a(1) = a(2) = a(3) = 1; for n>2, a(n+1) = a(n) + a(n-1) + a(n-2) iff n is prime, otherwise a(n+1) = a(n) + 1. 1
1, 1, 1, 3, 4, 8, 9, 21, 22, 23, 24, 69, 70, 163, 164, 165, 166, 495, 496, 1157, 1158, 1159, 1160, 3477, 3478, 3479, 3480, 3481, 3482, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 31347, 31348, 31349, 31350, 94047, 94048, 94049, 94050, 94051 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
LINKS
EXAMPLE
a(4) = 3 because 4-1 = 3 is prime, so a(4) = a(3) + a(2) + a(1) = 1 + 1 + 1 = 3.
a(5) = 4 because 5-1 = 4 is not prime, so a(5) = a(4) + 1 = 3 + 1 = 4.
a(6) = 8 because 6-1 = 5 is prime, so a(6) = a(5) + a(4) + a(3) = 4 + 3 + 1 = 8.
a(7) = 9 because 7-1 = 6 is not prime, so a(7) = a(6) + 1 = 8 + 1 = 9.
a(8) = 21 because 8-1 = 7 is prime, so a(8) = a(7) + a(6) + a(5) = 9 + 8 + 4 =
21.
CROSSREFS
Sequence in context: A165362 A245282 A320355 * A253606 A258640 A345223
KEYWORD
easy,nonn
AUTHOR
Jonathan Vos Post, Oct 13 2005
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 05:39 EDT 2024. Contains 371235 sequences. (Running on oeis4.)