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-5 of 5 results.

A073797 a(n) = 2^n mod pi(n).

Original entry on oeis.org

0, 0, 0, 2, 1, 0, 0, 0, 0, 3, 1, 2, 4, 2, 4, 4, 1, 0, 0, 0, 0, 5, 1, 2, 4, 8, 7, 2, 4, 2, 4, 8, 5, 10, 9, 8, 4, 8, 4, 6, 12, 2, 4, 8, 2, 8, 1, 2, 4, 8, 1, 0, 0, 0, 0, 0, 0, 8, 16, 2, 4, 8, 16, 14, 10, 3, 6, 12, 5, 8, 16, 2, 4, 8, 16, 11, 1, 6, 12, 2, 4, 18, 13, 3, 6, 12, 1, 8, 16, 8, 16, 8, 16, 8, 16
Offset: 2

Views

Author

Labos Elemer, Aug 12 2002

Keywords

Examples

			From _Michael De Vlieger_, Dec 09 2018: (Start)
a(2) = 0 since 2^2 mod PrimePi(2) = 4 mod 1 = 0.
a(5) = 2 since 2^5 mod PrimePi(5) = 32 mod 3 = 2. (End)
		

Crossrefs

Programs

  • Magma
    [2^n mod #PrimesUpTo(n): n in [2..100]]; // G. C. Greubel, Dec 10 2018
    
  • Mathematica
    Array[Mod[2^#, PrimePi@ #] &, 95, 2] (* Michael De Vlieger, Dec 09 2018 *)
    Table[PowerMod[2,n,PrimePi[n]],{n,2,100}] (* Harvey P. Dale, Aug 30 2021 *)
  • PARI
    for(n=2, 100, print1(lift(Mod(2^n, primepi(n))), ", ")) \\ G. C. Greubel, Dec 10 2018
    
  • Sage
    [mod(2^n, prime_pi(n)) for n in (2..100)] # G. C. Greubel, Dec 10 2018

Formula

a(n) = A000079(n) mod A000720(n).

A073799 Numbers that begin a run of consecutive integers k such that PrimePi(k) divides 2^k.

Original entry on oeis.org

2, 7, 19, 53, 131, 311, 719, 1619, 3671, 8161, 17863, 38873, 84017, 180503, 386093, 821641, 1742537, 3681131, 7754077, 16290047, 34136029, 71378569, 148948139, 310248241, 645155197, 1339484197, 2777105129, 5750079047, 11891268401, 24563311309, 50685770167, 104484802057, 215187847711
Offset: 1

Views

Author

Labos Elemer, Aug 12 2002

Keywords

Comments

It seems that each term is a bit larger than twice the previous one.
Runs have lengths 3, 4, 4, 6, 6, 2, 8, 2, 2, 6, 18, 18, 30, 8, 24, 6, 2, 18, ..., respectively.
From Chai Wah Wu, Jan 27 2020: (Start)
Theorem: a(1) = 2 and a(n) = A033844(n) for n > 1. For n > 1, the length of the n-th run is prime(2^n+1)-prime(2^n) = A051439(n)-A033844(n) = A074325(n).
Proof: Let r > 1. If p = prime(2^r), then primepi(p) = 2^r.
primepi(p-1) = 2^r - 1. Since r > 1, 2^r - 1 > 2 and odd and thus does not divide any power of 2.
In addition 2^r < p and thus divides 2^p. This means that p is a term. Let q be such that p < q < prime(2^r+1). Then primepi(q) = 2^r and divides 2^q. Since primepi(q-1) = 2^r and divides 2^(q-1), this means that q does not start a run and thus is not a term.
Let w be such that prime(2^r+1) <= w < prime(2^(r+1)). Then 2^r + 1 <= primepi(w) < 2^(r+1) and does not divide any power of 2. This means that w is not a term.
(End)

Crossrefs

Programs

  • Mathematica
    aQ[k_] := Divisible[2^k, PrimePi[k]]; s = {}; len = {}; n = 2; While[Length[s] < 10, While[! aQ[n], n++]; n1 = n; While[aQ[n], n++]; If[n > n1, AppendTo[s, n1]; AppendTo[len, n - n1]]; n++]; s (* Amiram Eldar, Dec 11 2018 *)
  • PARI
    a(n) = if(n==1, 2, prime(2^n)); \\ Jinyuan Wang, Mar 01 2020
  • Python
    from sympy import prime
    def A073799(n):
        return 2 if n == 1 else prime(2**n) # Chai Wah Wu, Jan 27 2020
    

Formula

Solutions to 2^(x-1) mod PrimePi(x-1) > 0 but 2^x mod PrimePi(x) = 0.
a(n) = A033844(n) for n > 1. - Chai Wah Wu, Jan 27 2020

Extensions

Edited by Jon E. Schoenfield, Dec 10 2018
a(15)-a(18) from Amiram Eldar, Dec 11 2018
a(19)-a(33) from Chai Wah Wu, Jan 27 2020

A073800 Remainder of division 2^n/c(n), where c(n)=A002808(n), the n-th composite.

Original entry on oeis.org

2, 4, 0, 7, 2, 4, 2, 1, 0, 16, 8, 1, 8, 16, 18, 16, 14, 8, 8, 0, 2, 30, 18, 28, 14, 4, 8, 16, 28, 19, 6, 16, 29, 34, 8, 40, 2, 14, 8, 16, 14, 4, 8, 4, 0, 49, 62, 52, 32, 4, 8, 46, 17, 20, 65, 22, 32, 16, 62, 64, 32, 64, 41, 16, 32, 64, 48, 70, 48, 24, 32, 22, 74, 84, 8, 16, 32, 52
Offset: 1

Views

Author

Labos Elemer, Aug 12 2002

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Mod[2^j, FixedPoint[j+PrimePi[ # ]+1&, j]], {j, 1, 128}]
    Module[{c=Select[Range[200],CompositeQ],len},len=Length[c];Table[ PowerMod[ 2,n,c[[n]]],{n,len}]] (* Harvey P. Dale, Mar 03 2018 *)

A297966 a(n) = 3^n mod prime(n).

Original entry on oeis.org

1, 0, 2, 4, 1, 1, 11, 6, 18, 5, 13, 10, 38, 36, 42, 15, 19, 34, 5, 32, 46, 51, 49, 39, 94, 30, 73, 53, 9, 91, 114, 100, 79, 121, 38, 127, 122, 113, 126, 138, 82, 114, 118, 112, 119, 10, 108, 30, 188, 20, 188, 30, 174, 169, 5, 52, 15, 241, 202, 222, 50, 267
Offset: 1

Views

Author

Vincenzo Librandi, Jan 11 2018

Keywords

Crossrefs

Programs

  • GAP
    P:=Filtered([1..1500],IsPrime);;List([1..65],n->PowerModInt(3,n,P[n])); # Muniru A Asiru, Mar 12 2018
  • Magma
    [Modexp(3, n, NthPrime(n)): n in [1..80]];
    
  • Maple
    seq(3 &^ n mod ithprime(n), n=1..65); # Muniru A Asiru, Mar 12 2018
  • Mathematica
    Array[PowerMod[3, #, Prime@#]&, 80]
  • PARI
    a(n) = lift(Mod(3, prime(n))^n); \\ Michel Marcus, Jan 11 2018
    

Formula

a(n) = A000244(n) mod A000040(n).

A297967 a(n) = 5^n mod prime(n).

Original entry on oeis.org

1, 1, 0, 2, 1, 12, 10, 4, 11, 20, 25, 10, 39, 36, 41, 13, 36, 58, 52, 1, 17, 26, 19, 64, 13, 5, 94, 14, 25, 36, 40, 74, 117, 81, 6, 123, 24, 155, 134, 117, 20, 42, 69, 36, 185, 111, 121, 16, 206, 159, 42, 220, 47, 123, 130, 61, 57, 83, 6, 79, 270, 14, 91
Offset: 1

Views

Author

Vincenzo Librandi, Jan 15 2018

Keywords

Crossrefs

Programs

  • Magma
    [Modexp(5, n, NthPrime(n)): n in [1..80]];
  • Mathematica
    Array[PowerMod[5, #, Prime@#]&, 80]

Formula

a(n) = A000351(n) mod A000040(n).
Showing 1-5 of 5 results.