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, 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
Examples
a(5)=3 because 5th prime is 11 and 11=3*2^2-1.
Links
Programs
-
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
-
Mathematica
Table[Max[Select[Divisors[Prime[n]+1],OddQ]],{n,100}] (* Daniel Jolly, Nov 15 2014 *)
-
PARI
a(n) = (prime(n)+1)/2^valuation(prime(n)+1, 2); \\ Michel Marcus, Feb 05 2017
-
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
Comments