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

A023143 Numbers k such that prime(k) == 1 (mod k).

Original entry on oeis.org

1, 2, 5, 6, 12, 14, 181, 6459, 6460, 6466, 100362, 251712, 251732, 637236, 10553504, 10553505, 10553547, 10553827, 10553851, 10553852, 69709709, 69709724, 69709728, 69709869, 69709961, 69709962, 179992920, 179992922, 179993170, 465769815, 465769819, 465769840, 3140421737, 3140421744, 3140421767, 3140421892, 3140421935
Offset: 1

Views

Author

Keywords

Comments

A004648(a(n)) <= 1. - Reinhard Zumkeller, Jul 30 2012

Examples

			6 is in the sequence because the 6th prime, 13, is congruent to 1 (mod 6).
		

Crossrefs

Programs

  • Haskell
    import Data.List (elemIndices)
    a023143 n = a023143_list !! (n-1)
    a023143_list = 1 : map (+ 1) (elemIndices 1 a004648_list)
    -- Reinhard Zumkeller, Jul 30 2012, Jun 08 2011
    
  • Magma
    [n: n in [1..10000] | IsIntegral((NthPrime(n)-1)/n)]; // Marius A. Burtea, Dec 30 2018
  • Mathematica
    Do[ If[ IntegerQ[ (Prime[ n ] - 1) / n ], Print[ n ] ], {n, 1, 10^8} ]
  • PARI
    n=0; print1(1); forprime(p=2,1e9, if(p%n++==1, print1(", "n))) \\ Charles R Greathouse IV, Apr 28 2015
    
  • Python
    def A023143(end):
        primes=[2,3]
        a023143_list=[1]
        num=3
        while len(primes)<=end:
            num+=1
            prime=False
            length=len(primes)
            for y in range(0,length):
                if num % primes[y]!=0:
                    prime=True
                else:
                    prime=False
                    break
            if (prime):
                primes.append(num)
        for x in range(2, len(primes)):
            if (primes[x-1]%(x))==1:
                a023143_list.append(x)
        return a023143_list
    # Conner L. Delahanty, Apr 19 2014
    
  • Python
    from sympy import primerange
    def A023143(end): return [n+1 for n, p in enumerate(primerange(2, end)) if (p-1) % (n-1) == 0] # David Radcliffe, Jun 27 2016
    

Extensions

More terms from Jud McCranie, Dec 11 1999
a(30)-a(37) from Zak Seidov, Apr 19 2014
Terms a(33)-a(37) sorted in correct order by Giovanni Resta, Feb 23 2020

A045924 Numbers n such that prime(n) == -1 (mod n).

Original entry on oeis.org

1, 2, 3, 4, 10, 70, 72, 182, 440, 1053, 6458, 6461, 6471, 40087, 40089, 251737, 251742, 637320, 637334, 637336, 1617173, 4124466, 10553445, 10553455, 10553569, 10553570, 10553574, 10553576, 10553819, 10553829, 27067100, 27067262, 69709705, 69709719, 69709734, 69709873
Offset: 1

Views

Author

Keywords

Comments

Same as n such that n divides A008864(n). - David James Sycamore, Jul 23 2018
Also numbers n such that prime(n) == n-1 (mod n). - Muniru A Asiru, Jul 24 2018

Examples

			10 is a member because the 10th prime, 29, is congruent to -1 mod 10.
		

Crossrefs

Programs

  • Mathematica
    NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; p = 1; Do[ If[Mod[p = NextPrim[p], n] == n - 1, Print[n]], {n, 1, 10^9}] (* Robert G. Wilson v, Feb 18 2004 *)
  • PARI
    isok(n) = Mod(prime(n), n) == -1; \\ Michel Marcus, Jul 24 2018

Extensions

More terms from Patrick De Geest, Nov 15 1999
Terms a(33) and beyond from Giovanni Resta, Feb 23 2020

A048891 Primes that are congruent to 1 mod n, where n is the index of the prime.

Original entry on oeis.org

2, 3, 11, 13, 37, 43, 1087, 64591, 64601, 64661, 1304707, 3523969, 3524249, 9558541, 189963073, 189963091, 189963847, 189968887, 189969319, 189969337, 1394194181, 1394194481, 1394194561, 1394197381, 1394199221, 1394199241, 3779851321, 3779851363, 3779856571, 10246935931, 10246936019, 10246936481, 75370121689, 75370121857, 75370122409, 75370125409, 75370126441
Offset: 1

Views

Author

Keywords

Comments

Based on problem by G. L. Honaker, Jr.
A subsequence of A073465. - Ivan N. Ianakiev, Aug 06 2019

Examples

			13 is the 6th prime and 13 == 1 mod 6.
		

Crossrefs

Programs

  • Mathematica
    f[p_,n_]:=Mod[p,n]==0; lst={};Do[p=Prime[n];If[f[p-1,n],AppendTo[lst,p]],{n,10!}];lst (* Vladimir Joseph Stephan Orlovsky, Dec 08 2009 *)
  • PARI
    lista(nn) = forprime(p=1, nn, if (Mod(p, primepi(p)) == 1, print1(p, ", "))); \\ Michel Marcus, Jan 08 2015; Aug 06 2019

Formula

A087611(a(n)) = 0. - Reinhard Zumkeller, Sep 11 2003
a(n) = A000040(A023143(n)). - Zak Seidov, Feb 19 2015

Extensions

More terms from Zak Seidov, Feb 19 2015
Terms a(33)-a(37) sorted into correct order by Giovanni Resta, Feb 23 2020

A162567 Primes p such that pi(p) divides p-1 and/or p+1, where pi(p) is the number of primes <= p.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 29, 37, 43, 349, 359, 1087, 1091, 3079, 8423, 64579, 64591, 64601, 64609, 64661, 64709, 481043, 481067, 1304707, 3523969, 3524249, 3524317, 3524387, 9558541, 9559799, 9560009, 9560039, 25874767, 70115921, 189962009
Offset: 1

Views

Author

Leroy Quet, Jul 06 2009

Keywords

Examples

			The 10th prime is 29. Since 10 divides 29+1 = 30, 29 is in the sequence.
The 12th prime is 37. Since 12 divides 37-1 = 36, 37 is in the sequence.
		

Crossrefs

Union of A048891 and A052013. - Michel Marcus, Mar 04 2019

Programs

  • Maple
    isA162567 := proc(p) RETURN ( (p-1) mod numtheory[pi](p) = 0 or (p+1) mod numtheory[pi](p) = 0 ) ; end: for n from 1 to 50000 do p := ithprime(n) ; if isA162567(p) then printf("%d,",p) ; fi; od: # R. J. Mathar, Jul 30 2009
    with(numtheory): a := proc (n) if `mod`(ithprime(n)-1, pi(ithprime(n))) = 0 or `mod`(ithprime(n)+1, pi(ithprime(n))) = 0 then ithprime(n) else end if end proc: seq(a(n), n = 1 .. 250000); # Emeric Deutsch, Jul 31 2009
  • Mathematica
    Select[Prime[Range[11000000]],Or@@Divisible[{#-1,#+1},PrimePi[#]]&] (* Harvey P. Dale, Sep 08 2012 *)

Formula

a(n) = A000040(A078931(n)). - Alois P. Heinz, Feb 20 2023

Extensions

a(10)-a(35) from Donovan Johnson, Jul 29 2009

A360789 Least prime p such that p mod primepi(p) = n.

Original entry on oeis.org

2, 3, 5, 7, 379, 23, 401, 61, 59, 29, 67, 71, 467, 79, 83, 179, 431, 89, 176557, 191, 24419, 491, 97, 101, 499, 1213, 3169, 3191, 523, 229, 3187, 223, 3203, 8609, 3163, 251, 176509, 257, 24509, 263, 3253, 269, 547, 3347, 1304867, 293
Offset: 0

Views

Author

Robert G. Wilson v, Feb 20 2023

Keywords

Comments

Inspired by A048891.

Examples

			For n=0, prime p=2 has p mod primepi(p) = 2 mod 1 = 0 so that a(0) = 2.
For n=4, no prime has p mod primepi(p) = 4 until reaching p=379 which is 379 mod 75 = 4, so that a(4) = 379.
		

Crossrefs

Programs

  • Maple
    V:= Array(0..100): count:= 0:
    p:= 1:
    for k from 1 while count < 101 do
      p:= nextprime(p);
      v:= p mod k;
      if v <= 100 and V[v] = 0 then V[v]:= p; count:= count+1 fi;
    od:
    convert(V,list); # Robert Israel, Feb 28 2023
  • Mathematica
    t[_] := 0; p = 2; pi = 1; While[p < 1400000, m = Mod[p, pi]; If[m < 100 && t[m] == 0, t[m] = p]; p = NextPrime@p; pi++]; t /@ Range[0, 99]
  • PARI
    a(n)={my(k=n); forprime(p=prime(n+1), oo, k++; if(p%k ==n, return(p)))} \\ Andrew Howroyd, Feb 21 2023
    
  • Python
    from sympy import prime, nextprime
    def A360789(n):
        p, m = prime(n+1), n+1
        while p%m != n:
            p = nextprime(p)
            m += 1
        return p # Chai Wah Wu, Mar 18 2023

Formula

a(n) = prime(A073325(n+1)). - Kevin Ryde, Feb 21 2023

A269022 Primes p such that sigma(p)/pi(p) is prime.

Original entry on oeis.org

2, 3, 5, 7, 29, 349, 359, 3079, 70115921, 514274899, 514277977, 11091501632311
Offset: 1

Views

Author

Soumadeep Ghosh, Feb 17 2016

Keywords

Comments

Corresponding quotient primes are 3, 2, 2, 2, 3, 5, 5, 7, 17, 19, 19, 29.
a(13) > 8.1*10^13 if it exists. Assuming the Riemann Hypothesis, a(13) > 3.27*10^16 (if it exists). - Chai Wah Wu, May 25 2018

Examples

			7 is in the sequence because sigma(7) = 8, pi(7) = 4 and 8/4 = 2 is a prime.
		

Crossrefs

Subsequence of A052013.

Programs

  • Mathematica
    Select[Prime[Range[10^6]], ProvablePrimeQ[DivisorSigma[1, #]/PrimePi[#]] &]
    Select[ (* the terms of A052013 *), PrimeQ[(# + 1)/PrimePi@ #] &] (* Robert G. Wilson v, Mar 16 2016 *)
  • PARI
    is(n)=my(t=(n+1)/primepi(n)); denominator(t)==1 && isprime(t) && isprime(n) \\ Charles R Greathouse IV, Feb 18 2016
    
  • PARI
    list(lim)=my(v=List(),n,t); forprime(p=2,lim, t=(p+1)/n++; if(denominator(t)==1 && isprime(t), listput(v, p))); Vec(v) \\ Charles R Greathouse IV, Feb 18 2016

Extensions

a(9)-a(11) from Charles R Greathouse IV, Feb 18 2016
a(12) from Chai Wah Wu, May 25 2018
Showing 1-6 of 6 results.