This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A163961 First differences of A116533. 13
 1, 2, -1, 3, -1, 5, -1, -1, -1, 7, -1, 13, -1, -1, -1, 23, -1, -1, -1, 43, -1, -1, -1, 83, -1, -1, -1, 163, -1, -1, -1, -1, -1, -1, -1, -1, -1, 317, -1, -1, -1, 631, -1, -1, -1, 1259, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 2503, -1, -1, -1, 5003, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS Ignoring the +-1 terms, we obtain the sequence of Bertrand's primes A006992. If we consider sequences A_i={a_i(n)}, i=1,2,... with the same constructions as A116533, but with initials a_1(1)=2, a_2(1)=11, a_3(1)=17,..., a_m(1)=A164368(m),..., then the union of A_1,A_2,... contains all primes. LINKS MAPLE A116533 := proc(n) option remember; if n <=2 then n; else if isprime(procname(n-1)) then 2*procname(n-1) ; else procname(n-1)-1 ; end if; end if; end proc: A163961 := proc(n) A116533(n+1)-A116533(n) ; end proc: # R. J. Mathar, Sep 03 2011 MATHEMATICA Differences@ Prepend[NestList[If[PrimeQ@ #, 2 #, # - 1] &, 2, 90], 1] (* Michael De Vlieger, Dec 06 2018 *) PROG (PARI) a116533(n) = if(n==1, 1, if(n==2, 2, if(ispseudoprime(a116533(n-1)), 2*a116533(n-1), a116533(n-1)-1))) a(n) = a116533(n+1)-a116533(n) \\ Felix FrÃ¶hlich, Dec 06 2018 (PARI) lista(nn) = {va = vector(nn); va[1] = 1; va[2] = 2; for (n=3, nn, va[n] = if (isprime(va[n-1]), 2*va[n-1], va[n-1]-1); ); vector(nn-1, n, va[n+1] - va[n]); } \\ Michel Marcus, Dec 07 2018 CROSSREFS Cf. A116533, A006992, A055496, A080359, A104272, A106108, A132199, A164368 Sequence in context: A295785 A069230 A242180 * A101387 A117365 A116212 Adjacent sequences:  A163958 A163959 A163960 * A163962 A163963 A163964 KEYWORD sign AUTHOR Vladimir Shevelev, Aug 07 2009, Aug 14 2009 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 October 23 16:46 EDT 2019. Contains 328373 sequences. (Running on oeis4.)