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.

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

A225318 Numbers n such that either prime(n-1) == -1 (mod n) or prime(n+1) == -1 (mod n) but not both.

Original entry on oeis.org

2, 4, 7, 8, 14, 16, 26, 27, 32, 33, 35, 76, 78, 169, 170, 172, 175, 177, 183, 184, 185, 434, 446, 1054, 1056, 2638, 2702, 6468, 15930, 40069, 40070, 40080, 40112, 40115, 40157, 251721, 251758, 251767, 251770, 251788, 637286, 4124464, 4124704
Offset: 1

Views

Author

Irina Gerasimova, May 05 2013

Keywords

Examples

			2nd prime is 3 and 2 is a member because 1st prime, 2, is congruent to 0 mod 2 and 3rd prime, 5, is congruent to -1 mod 2;
6th prime is 11 and 6 is not a member because 5th prime, 11, is congruent to -1 mod 6 and 7th prime, 17, is congruent to -1 mod 6;
7th prime is 17 and 7 is a member because 6th prime, 13, is congruent to -1 mod 7 and 8th prime, 19, is congruent to 1 mod 6;
14th prime is 43 and 14 is a member because 13th prime, 41, is congruent to -1 mod 14 and 15th prime, 47, is congruent to 5 mod 14.
		

Crossrefs

Programs

  • Maple
    for n from 2 to 100000 do
        if modp(ithprime(n-1),n) = modp(-1,n) then
            pn := true ;
        else
            pn := false ;
        end if;
        if modp(ithprime(n+1),n) = modp(-1,n) then
            pm := true ;
        else
            pm := false ;
        end if;
        if pn <> pm then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, May 09 2013
  • PARI
    is(n)=my(p=prime(n-1),q=nextprime(nextprime(p+1)+1),v=[p+1,q+1]%n); !vecmin(v) && vecmax(v) \\ Charles R Greathouse IV, Mar 18 2014

Extensions

Corrected by R. J. Mathar, May 09 2013
a(36)-a(43) from Alois P. Heinz, May 18 2013
Showing 1-2 of 2 results.