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

%I #23 Sep 08 2022 08:44:47

%S 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,

%T 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,

%U 2,4,1,3,1,2,3,1,2,1,1,1

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

%C Assumes the not generally accepted convention prime(0) = 1. - _Michel Marcus_, Jun 06 2019

%H Marius A. Burtea, <a href="/A023528/b023528.txt">Table of n, a(n) for n = 1..6001</a>

%F a(n) = A007814(A023523(n)). - _Michel Marcus_, Jun 06 2019

%t Join[{0},FactorInteger[#][[1,2]]&/@(Times@@@Partition[Prime[Range[ 80]], 2,1]+1)] (* _Harvey P. Dale_, Dec 25 2011 *)

%o (PARI) p(n) = if (n==0, 1, prime(n));

%o a(n) = valuation(p(n)*p(n-1) + 1, 2); \\ _Michel Marcus_, Jun 06 2019

%o (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

%o (Python)

%o from sympy import prime

%o 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

%Y Cf. A007814, A023523.

%K nonn

%O 1,3

%A _Clark Kimberling_

%E a(1)=a(2)=0 corrected by _Sean A. Irvine_, Jun 05 2019