login
First differences of A080735.
13

%I #14 Dec 06 2018 16:34:38

%S 1,2,1,5,1,11,1,23,1,47,1,1,1,97,1,1,1,197,1,1,1,397,1,1,1,797,1,1,1,

%T 1597,1,1,1,1,1,1,1,1,1,3203,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,6421,1,1,1,

%U 1,1,1,1,1,1,1,1,12853,1,1,1,1,1,1,1,1,1,1,1,25717,1,1,1,51437,1,1,1

%N First differences of A080735.

%C Ignoring the 1 terms we obtain A055496. If we consider sequences A_i={a_i(n)}, i=1,2,... with the same constructions as A080735, but with initials a_1(1)=2, a_2(1)=3, a_3(1)=13,..., a_m(1)=A080359(m),..., then the union of A_1,A_2,... contains all primes.

%H G. C. Greubel, <a href="/A163963/b163963.txt">Table of n, a(n) for n = 1..5000</a>

%p A080735 := proc(n) option remember; local p ; if n = 1 then 1; else p := procname(n-1) ; if isprime(p) then 2*p; else p+1 ; end if; end if; end proc: A163963 := proc(n) A080735(n+1)-A080735(n) ; end: seq(A163963(n),n=1..100) ; # _R. J. Mathar_, Nov 05 2009

%t Differences@ NestList[If[PrimeQ@ #, 2 #, # + 1] &, 1, 87] (* _Michael De Vlieger_, Dec 06 2018, after _Harvey P. Dale_ at A080735 *)

%o (PARI) lista(nn) = {my(va = vector(nn)); va[1] = 1; for (n=2, 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 06 2018

%Y Cf. A116533, A163961, A080735, A006992, A055496, A080359, A104272, A106108, A132199.

%K nonn

%O 1,2

%A _Vladimir Shevelev_, Aug 07 2009

%E More terms from _R. J. Mathar_, Nov 05 2009