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.

A023579 Exponent of 2 in prime factorization of prime(n)+3.

Original entry on oeis.org

0, 1, 3, 1, 1, 4, 2, 1, 1, 5, 1, 3, 2, 1, 1, 3, 1, 6, 1, 1, 2, 1, 1, 2, 2, 3, 1, 1, 4, 2, 1, 1, 2, 1, 3, 1, 5, 1, 1, 4, 1, 3, 1, 2, 3, 1, 1, 1, 1, 3, 2, 1, 2, 1, 2, 1, 4, 1, 3, 2, 1, 3, 1, 1, 2, 6, 1, 2, 1, 5, 2, 1, 1, 3, 1, 1, 3, 4, 2, 2, 1, 3, 1, 2, 1, 1, 2, 2, 4, 1, 1, 1, 1, 1, 1, 1, 9, 2, 1
Offset: 1

Views

Author

Keywords

Examples

			For n=1, prime(1)+3=5, and 5 is odd, so a(1)=0.
		

Programs

  • Magma
    [Valuation(3+NthPrime(n), 2): n in [1..100]]; // G. C. Greubel, May 21 2019
    
  • Mathematica
    Table[IntegerExponent[3 + Prime[n], 2], {n, 100}] (* G. C. Greubel, May 21 2019 *)
  • PARI
    a(n) = valuation(prime(n)+3, 2); \\ Michel Marcus, Sep 30 2013
    
  • Python
    from sympy import prime
    def A023579(n): return (~(m:=prime(n)+3)& m-1).bit_length() # Chai Wah Wu, Jul 07 2022
  • Sage
    [(nth_prime(n)+3).valuation(2) for n in (1..100)] # G. C. Greubel, May 21 2019
    

Formula

a(n) = A007814(A113935(n)). - Michel Marcus, Sep 30 2013

Extensions

a(1) corrected by Michel Marcus, Sep 30 2013
Name corrected by Charles R Greathouse IV, Mar 31 2014