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.

Showing 1-2 of 2 results.

A087963 Exponent of highest power of 2 dividing 3*prime(n)+1.

Original entry on oeis.org

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

Views

Author

Labos Elemer, Sep 18 2003

Keywords

Examples

			For n = 10: p = prime(10) = 29, 3*p + 1 = 88 = 2^3 * 11, a(10) = 3.
		

Crossrefs

Programs

  • Magma
    [Valuation(3*NthPrime(n)+1, 2): n in [1..80]]; // Vincenzo Librandi, Sep 01 2016
    
  • Mathematica
    ffi[x_] := Flatten[FactorInteger[x]]; e2[x_] := Part[[ffi[x]], 2]; Table[e2[3*Prime[w]+1], {w, 1, 100}]
    IntegerExponent[3 * Prime[Range[100]] + 1, 2] (* Amiram Eldar, Jul 12 2024 *)
  • PARI
    a(n) = valuation(3*prime(n)+1, 2); \\ Michel Marcus, Sep 01 2016
    
  • Python
    from sympy import prime
    def A087963(n): return (~(m:=prime(n)*3+1)&m-1).bit_length() # Chai Wah Wu, Jul 10 2022

Formula

a(n) = A007814(3*prime(n)+1).

Extensions

a(1)=0 corrected by Michel Marcus, Sep 01 2016

A087964 a(n) is the least prime p such that exponent of highest power of 2 dividing 3p+1 equals n.

Original entry on oeis.org

3, 17, 13, 5, 53, 149, 1237, 1109, 853, 2389, 3413, 17749, 128341, 70997, 251221, 415061, 218453, 2708821, 27088213, 29709653, 3495253, 85284181, 13981013, 39146837, 794121557, 1498764629, 492131669, 626349397, 13779686741
Offset: 1

Views

Author

Labos Elemer, Sep 18 2003

Keywords

Examples

			p = 218453 is the first prime so that 3*p+1 = 655360 = (2^18)*5 has 18 as exponent of 2 in 3p+1, thus a(18) = 218453.
		

Crossrefs

Programs

  • Maple
    f:= proc(n)
       local m,t,p;
       t:= 2^n;
       for m from 1 + 4*(n mod 2) by 6 do
         p:= (t*m-1)/3;
         if isprime(p) then return p fi
       od
    end proc:
    map(f, [$1..100]); # Robert Israel, Nov 18 2017
  • Mathematica
    a[n_] := Module[{m, t = 2^n, p}, For[m = 1 + 4 Mod[n, 2], True, m += 6, p = (t m - 1)/3; If[PrimeQ[p], Return[p]]]];
    Array[a, 100] (* Jean-François Alcover, Aug 28 2020, after Robert Israel *)

Formula

a(n) = A000040(Min{x; A007814(1 + 3*A000040(x)) = n}).

Extensions

More terms from Ray Chandler, Sep 21 2003
Showing 1-2 of 2 results.