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

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

Original entry on oeis.org

2, 3, 5, 7, 29, 349, 359, 1091, 3079, 8423, 64579, 64609, 64709, 481043, 481067, 3524317, 3524387, 9559799, 9560009, 9560039, 25874767, 70115921, 189962009, 189962189, 189964241, 189964259, 189964331, 189964367, 189968741, 189968921
Offset: 1

Views

Author

Patrick De Geest, Nov 15 1999

Keywords

Examples

			29 is the tenth prime and 29 == -1 mod 10, so 29 is in the sequence.
31 is the eleventh prime but 31 == 9 mod 11, so 31 is not in the sequence.
		

Crossrefs

Subsequence of A162567.

Programs

  • Mathematica
    divbleQ[m_, n_] := Mod[m, n] == 0; A052013 = {}; Do[p = Prime[n]; If[divbleQ[p + 1, n], AppendTo[A052013, p]], {n, 10!}]; A052013 (* Vladimir Joseph Stephan Orlovsky, Dec 08 2009 *)
    Select[Prime[Range[5000]], Divisible[# + 1, PrimePi[#]] &] (* Alonso del Arte, May 12 2017 *)
    Select[Table[{n,Prime[n]},{n,1056*10^4}],Mod[#[[2]],#[[1]]]==#[[1]]-1&][[All,2]] (* Harvey P. Dale, Oct 29 2022 *)
  • PARI
    lista(nn) = forprime(p=2, nn, if (Mod(p,primepi(p)) + 1 == 0, print1(p, ", "))) \\ Michel Marcus, Jan 09 2015
    
  • PARI
    list(lim)=my(v=List(), n, t); forprime(p=2, lim, t=(p+1)/n++; if(denominator(t)==1, listput(v, p))); Vec(v) \\ Charles R Greathouse IV, Feb 18 2016

Formula

a(n) = prime(A045924(n)). - Michel Marcus, Jan 09 2015

A078931 Numbers k that divide prime(k)+1 or prime(k)-1.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 10, 12, 14, 70, 72, 181, 182, 440, 1053, 6458, 6459, 6460, 6461, 6466, 6471, 40087, 40089, 100362, 251712, 251732, 251737, 251742, 637236, 637320, 637334, 637336, 1617173, 4124466, 10553445, 10553455, 10553504, 10553505, 10553547, 10553569
Offset: 1

Views

Author

Benoit Cloitre, Jan 12 2003

Keywords

Examples

			181 is in the sequence because the 181st prime is 1087, and 1086 is divisible by 181 (although 1088 is not so divisible).
		

Crossrefs

Programs

  • Mathematica
    ndpQ[n_]:=Module[{p=Prime[n]},Divisible[p-1,n]||Divisible[p+1,n]]; Select[Range[100000],ndpQ]  (* Harvey P. Dale, Apr 03 2011 *)

Formula

Equals A023143 union A045924.
a(n) = A000720(A162567(n)). - Alois P. Heinz, Feb 20 2023

Extensions

Corrected and example added by Harvey P. Dale, Apr 03 2011
Extended with terms from A023143 and A045924 by Michel Marcus, Nov 30 2013

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
Showing 1-3 of 3 results.