OFFSET
1,3
COMMENTS
EXAMPLE
p = 11: (11 + 1 - 2^i) / 2^i is prime for i = 1..2, thus a(3) = 2.
p = 47: (47 + 1 - 2^i) / 2^i is prime for i = 1..4, thus a(5) = 4.
PROG
(PARI) isp(k) = (denominator(k) == 1) && isprime(k);
f(p) = my(i=1); while (isp((p+1-2^i)/2^i), i++); i-1;
apply(f, select(x->isp((x-1)/2), primes(1000))) \\ Michel Marcus, May 28 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Ctibor O. Zizka, May 21 2024
STATUS
approved