[go: up one dir, main page]

login
A057024
Largest odd factor of (n-th prime+1); k when n-th prime is written as k*2^m-1 [with k odd].
3
3, 1, 3, 1, 3, 7, 9, 5, 3, 15, 1, 19, 21, 11, 3, 27, 15, 31, 17, 9, 37, 5, 21, 45, 49, 51, 13, 27, 55, 57, 1, 33, 69, 35, 75, 19, 79, 41, 21, 87, 45, 91, 3, 97, 99, 25, 53, 7, 57, 115, 117, 15, 121, 63, 129, 33, 135, 17, 139, 141, 71, 147, 77, 39, 157, 159, 83, 169, 87
OFFSET
1,1
COMMENTS
a(n) = 1 if and only if prime(n) is a Mersenne prime. - Ely Golden, Feb 06 2017
FORMULA
a(n) = A000265(A000040(n) + 1) = A000265(A028815(n)).
a(n) = (A000040(n) + 1)/A007814(A000040(n) + 1).
a(n) = A028815(n)/A023512(n).
EXAMPLE
a(5)=3 because 5th prime is 11 and 11=3*2^2-1.
MATHEMATICA
Table[Max[Select[Divisors[Prime[n]+1], OddQ]], {n, 100}] (* Daniel Jolly, Nov 15 2014 *)
PROG
(Sage) def a(n):
x=nth_prime(n)+1
return x/2**((int(x)&int(-x)).bit_length()-1)
index=1
while(index<=10000):
print(str(index)+" "+str(a(index)))
index+=1
# Ely Golden, Feb 06 2017
(PARI) a(n) = (prime(n)+1)/2^valuation(prime(n)+1, 2); \\ Michel Marcus, Feb 05 2017
(Magma)
A057024:= func< n | (NthPrime(n)+1)/2^Valuation(NthPrime(n)+1, 2) >;
[A057024(n): n in [1..100]]; // G. C. Greubel, Aug 06 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Henry Bottomley, Jul 24 2000
STATUS
approved