[go: up one dir, main page]

login
A125050
a(1) = 1. If a(n) is composite, a(n+1) = 2*a(n)+1; otherwise, a(n+1) = 2*a(n).
2
1, 2, 4, 9, 19, 38, 77, 155, 311, 622, 1245, 2491, 4983, 9967, 19934, 39869, 79738, 159477, 318955, 637911, 1275823, 2551646, 5103293, 10206587, 20413175, 40826351, 81652702, 163305405, 326610811, 653221623, 1306443247, 2612886495
OFFSET
1,2
FORMULA
a(n) = floor(c*2^n), where c = 0.6083600446... - Lorenzo Sauras Altuzarra, Jan 01 2023
MAPLE
a := proc(n)
local c, k:
c, k := 1, 1:
while c < n do
if k > 1 and not isprime(k) then k := 2*k+1: else k := 2*k: fi:
c := c+1: od:
k: end: # Lorenzo Sauras Altuzarra, Jan 02 2023
CROSSREFS
Cf. A125049.
Sequence in context: A262864 A129784 A329356 * A056186 A265387 A293322
KEYWORD
nonn
AUTHOR
STATUS
approved