cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A057024 Largest odd factor of (n-th prime+1); k when n-th prime is written as k*2^m-1 [with k odd].

Original entry on oeis.org

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

Views

Author

Henry Bottomley, Jul 24 2000

Keywords

Comments

a(n) = 1 if and only if prime(n) is a Mersenne prime. - Ely Golden, Feb 06 2017

Examples

			a(5)=3 because 5th prime is 11 and 11=3*2^2-1.
		

Crossrefs

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
    

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).