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.

A068504 Highest power of 2 dividing prime(n)+1.

Original entry on oeis.org

1, 4, 2, 8, 4, 2, 2, 4, 8, 2, 32, 2, 2, 4, 16, 2, 4, 2, 4, 8, 2, 16, 4, 2, 2, 2, 8, 4, 2, 2, 128, 4, 2, 4, 2, 8, 2, 4, 8, 2, 4, 2, 64, 2, 2, 8, 4, 32, 4, 2, 2, 16, 2, 4, 2, 8, 2, 16, 2, 2, 4, 2, 4, 8, 2, 2, 4, 2, 4, 2, 2, 8, 16, 2, 4, 128, 2, 2, 2, 2, 4, 2, 16, 2, 8, 4, 2, 2, 2, 16, 4, 32, 8, 4, 4, 8, 2
Offset: 1

Views

Author

Benoit Cloitre, Mar 11 2002

Keywords

Crossrefs

Programs

  • Maple
    f:= n -> 2^padic:-ordp(ithprime(n)+1,2):
    map(f, [$1..100]); # Robert Israel, Jan 13 2017
  • Mathematica
    a[n_] := 2^IntegerExponent[Prime[n] + 1, 2]; Array[a, 100] (* Amiram Eldar, Jun 04 2022 *)
  • PARI
    a(n) = 2^valuation(prime(n)+1, 2); \\ Michel Marcus, Nov 24 2013
    
  • Python
    from sympy import prime
    def A068504(n): return (m:=prime(n)+1)&-m # Chai Wah Wu, Jul 09 2022

Formula

a(n) = A006519(A008864(n)). - Michel Marcus, Nov 24 2013
a(n) = 2^A023512(n). - Michel Marcus, Nov 24 2013