login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A373063
Greatest k >= 1 such that (p + 1 - 2^i) / 2^i is prime for i = 1..k and p is prime from A005385.
0
1, 1, 2, 3, 4, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 2
OFFSET
1,3
COMMENTS
"k-safe primes" iff (p + 1 - 2^i) / 2^i is prime for i = 0..k, p a prime number. A000040 are 0-safe primes, A005385 are 1-safe primes, A066179 are 2-safe primes.
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