login
A083005
a(1)=1, a(n)=2a(n-1)+1 if a(n-1) is prime, a(n)=a(n-1)+1 otherwise.
1
1, 2, 5, 11, 23, 47, 95, 96, 97, 195, 196, 197, 395, 396, 397, 795, 796, 797, 1595, 1596, 1597, 3195, 3196, 3197, 3198, 3199, 3200, 3201, 3202, 3203, 6407, 6408, 6409, 6410, 6411, 6412, 6413, 6414, 6415, 6416, 6417, 6418, 6419, 6420, 6421, 12843, 12844
OFFSET
1,2
COMMENTS
Primes in this sequence are A055496.- Robert Israel, May 23 2017
LINKS
FORMULA
Conjecture : limit n ->oo log(a(n))/sqrt(n)=c= 1.3....
MAPLE
P[0]:= 0:
for n from 2 to 20 do P[n]:= nextprime(2*P[n-1]) od:
seq($2*P[i]+1..P[i+1], i=0..19); # Robert Israel, May 23 2017
MATHEMATICA
NestList[If[PrimeQ[#], 2#+1, #+1]&, 1, 50] (* Harvey P. Dale, Jul 02 2021 *)
CROSSREFS
Cf. A055496.
Sequence in context: A293339 A348855 A175867 * A133489 A060153 A086219
KEYWORD
nonn
AUTHOR
Benoit Cloitre, May 31 2003
EXTENSIONS
Offset corrected by Robert Israel, May 23 2017
STATUS
approved