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!)
A215410 a(0) = 0; a(n+1) = 2*a(n) + k where k = 0 if prime(n+2)/prime(n+1) < prime(n+1)/prime(n), otherwise k = 1. 1
0, 1, 2, 5, 10, 21, 42, 85, 171, 342, 685, 1370, 2740, 5481, 10963, 21926, 43852, 87705, 175410, 350820, 701641, 1403282, 2806565, 5613131, 11226262, 22452524, 44905049, 89810098, 179620197, 359240395, 718480790, 1436961581, 2873923162, 5747846325, 11495692650 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,3
LINKS
EXAMPLE
a(0) = 0;
a(1) = 1 because prime(3)/prime(2) > prime(2)/prime(1) -> 5/3 > 3/2 => a(1) = 2*0 + 1= 1;
a(2) = 2 because prime(4)/prime(3) < prime(3)/prime(2) -> 7/5 < 5/3 => a(2) = 2*1 + 0 = 2;
a(3) = 5 because prime(5)/prime(4) > prime(4)/prime(3) -> 11/7 > 7/5 => a(3) = 2*2 + 1 = 5.
MAPLE
z0:=0: printf("%a, ", z0):for n from 1 to 40 do:p1:=ithprime(n):p2:=ithprime(n+1):p3:=ithprime(n+2):x:=evalf(p2/p1):y:=evalf(p3/p2):if y<x then k:=0:else k:=1:fi:z0:=2*z0 +k:printf("%a, ", z0):od:
CROSSREFS
Sequence in context: A279751 A000975 A280148 * A279668 A352875 A245747
KEYWORD
nonn
AUTHOR
Michel Lagneau, Aug 09 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 | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 20:33 EDT 2024. Contains 371916 sequences. (Running on oeis4.)