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!)
A215411 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

%I #6 Aug 09 2012 21:53:37

%S 0,0,1,2,5,10,21,42,84,169,338,677,1355,2710,5420,10841,21683,43366,

%T 86733,173467,346934,693869,1387738,2775476,5550953,11101907,22203814,

%U 44407629,88815258,177630516,355261033,710522066,1421044133,2842088266,5684176533

%N 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.

%e a(0) = 0;

%e a(1) = 0 because prime(3)/prime(2) > prime(2)/prime(1) -> 5/3 > 3/2 => a(1) = 2*0 + 0= 0;

%e a(2) = 1 because prime(4)/prime(3) < prime(3)/prime(2) -> 7/5 < 5/3 => a(2) = 2*0 + 1 = 1;

%e a(3) = 2 because prime(5)/prime(4) > prime(4)/prime(3) -> 11/7 > 7/5 => a(3) = 2*1 + 0 = 2.

%p 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:

%Y Cf. A000040, A215410.

%K nonn

%O 0,4

%A _Michel Lagneau_, Aug 09 2012

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 18 13:29 EDT 2024. Contains 371780 sequences. (Running on oeis4.)