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.

This page as a plain text file.
%I A068504 #19 Jul 10 2022 04:03:42
%S A068504 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,
%T A068504 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,
%U A068504 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
%N A068504 Highest power of 2 dividing prime(n)+1.
%H A068504 Robert Israel, <a href="/A068504/b068504.txt">Table of n, a(n) for n = 1..10000</a>
%F A068504 a(n) = A006519(A008864(n)). - _Michel Marcus_, Nov 24 2013
%F A068504 a(n) = 2^A023512(n). - _Michel Marcus_, Nov 24 2013
%p A068504 f:= n -> 2^padic:-ordp(ithprime(n)+1,2):
%p A068504 map(f, [$1..100]); # _Robert Israel_, Jan 13 2017
%t A068504 a[n_] := 2^IntegerExponent[Prime[n] + 1, 2]; Array[a, 100] (* _Amiram Eldar_, Jun 04 2022 *)
%o A068504 (PARI) a(n) = 2^valuation(prime(n)+1, 2); \\ _Michel Marcus_, Nov 24 2013
%o A068504 (Python)
%o A068504 from sympy import prime
%o A068504 def A068504(n): return (m:=prime(n)+1)&-m # _Chai Wah Wu_, Jul 09 2022
%Y A068504 Cf. A006519, A008864, A023512.
%K A068504 easy,nonn
%O A068504 1,2
%A A068504 _Benoit Cloitre_, Mar 11 2002