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.

A023528 Exponent of 2 in prime factorization of prime(n)*prime(n-1) + 1.

Original entry on oeis.org

0, 0, 4, 2, 1, 4, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 3, 4, 3, 1, 6, 3, 1, 2, 1, 1, 2, 1, 4, 1, 4, 1, 2, 2, 3, 2, 2, 3, 1, 2, 3, 4, 2, 12, 1, 2, 1, 1, 1, 4, 1, 3, 8, 2, 2, 3, 2, 2, 2, 1, 2, 3, 5, 1, 6, 1, 5, 2, 2, 4, 1, 3, 1, 2, 3, 1, 2, 1, 1, 1
Offset: 1

Views

Author

Keywords

Comments

Assumes the not generally accepted convention prime(0) = 1. - Michel Marcus, Jun 06 2019

Crossrefs

Programs

  • Magma
    p:=PrimesUpTo(10000); sol:=[];sol[1]:=0; for n in [2..80] do sol[n]:=Valuation(1+p[n]*p[n-1],2);end for; sol; // Marius A. Burtea, Jun 06 2019
    
  • Mathematica
    Join[{0},FactorInteger[#][[1,2]]&/@(Times@@@Partition[Prime[Range[ 80]], 2,1]+1)] (* Harvey P. Dale, Dec 25 2011 *)
  • PARI
    p(n) = if (n==0, 1, prime(n));
    a(n) = valuation(p(n)*p(n-1) + 1, 2); \\ Michel Marcus, Jun 06 2019
    
  • Python
    from sympy import prime
    def A023528(n): return 0 if n == 1 else (~(m:=prime(n)*prime(n-1)+1)& m-1).bit_length() # Chai Wah Wu, Jul 07 2022

Formula

a(n) = A007814(A023523(n)). - Michel Marcus, Jun 06 2019

Extensions

a(1)=a(2)=0 corrected by Sean A. Irvine, Jun 05 2019