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.

A225192 Number of primes p such that p is -1 mod n where p < n-th prime.

Original entry on oeis.org

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

Views

Author

Irina Gerasimova, May 01 2013

Keywords

Comments

Primes p(n) such that a(n) = a(n + 1): 2, 5, 17, 19, 23, 73, 97, 103, 173, 193, 233, 239, 263, 293, 347, 349, 353, 373, 449, 467,...
Primes p(n) such that p is not -1 mod n and mod n+1 for all prime p < p(n+1): 2, 97, 829, 1597, 2251,...
Smallest k such that a(k) = n:, 1, 3, 6, 24, 84, 90,...
Numbers n such that a(n) is equal to number of primes p such that n is -1 mod p where p < n-th prime: 1, 2, 3, 4, 7, 8, 10, 14, 15, 20, 22, 28, 31, 32, 34, 40, 44, 45, 46, 50, 52, 55, 57, 63, 65, 70, 72, 87,...

Examples

			Prime 11 == - 1 (mod 12), prime 23 == -1 (mod 12) and 11, 23 < prime(12) = 37, so a(12) = 2.
		

Crossrefs

Programs

  • Mathematica
    Table[s = Prime[Range[n - 1]]; Length[Select[s, Mod[#, n] == n - 1 &]], {n, 93}] (* T. D. Noe, May 13 2013 *)
  • PARI
    a(n)=my(s); forstep(p=n-1,prime(n)-1,n,s+=isprime(p)); s \\ Charles R Greathouse IV, Mar 18 2014

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.