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.

A104636 Even n such that 2n+1 is prime.

Original entry on oeis.org

2, 6, 8, 14, 18, 20, 26, 30, 36, 44, 48, 50, 54, 56, 68, 74, 78, 86, 90, 96, 98, 114, 116, 120, 128, 134, 138, 140, 146, 156, 158, 168, 174, 176, 186, 194, 198, 200, 204, 210, 216, 224, 228, 230, 254, 260, 270, 278, 284, 288, 296, 300, 306, 308, 320, 326, 330
Offset: 1

Views

Author

Zak Seidov, Mar 18 2005

Keywords

Comments

If q = 2*n + 1 is prime, and n is even, q divides (n!)^2 + 1. - Arkadiusz Wesolowski, Sep 06 2012

Crossrefs

Programs

  • Mathematica
    Select[Range[2, 300, 2], PrimeQ[2*# + 1] &]

Extensions

a(48)-a(57) from Arkadiusz Wesolowski, Sep 06 2012

A186708 Number of quadratic residues (mod p) in the interval [1,2k+1], for primes p=4k+3.

Original entry on oeis.org

1, 2, 4, 6, 7, 9, 12, 14, 19, 18, 21, 22, 25, 28, 31, 34, 40, 39, 41, 42, 47, 52, 54, 54, 57, 59, 64, 67, 73, 72, 73, 75, 81, 87, 87, 94, 99, 96, 99, 104, 118, 118, 117, 118, 119, 127, 132, 125, 136, 129, 136, 138, 141, 154, 150, 157, 162
Offset: 1

Views

Author

M. F. Hasler, Feb 25 2011

Keywords

Comments

For primes of the form p=4k+3 (A002145), count numbers in [1,2k+1] which are quadratic residues mod p.
R. K. Guy asks whether there is an elementary proof for the fact that there are always less quadratic residues in the interval [2k+2,4k+2] than in [1,2k+1].

Crossrefs

Programs

  • PARI
    forprime( p=1,499, p%4==3|next; u=3; c=[1,0]; for(i=2,p-2, bittest(u,i^2%p) & next; u+=1<<(i^2%p); c[i^2%p*2\p+1]++); print1(c[1]", "))

Formula

a(n) = A104635(n) - A186709(n) = A186709(n) + A178154(n) = (A104635(n) + A178154(n))/2 = (A002145(n) + 2*A178154(n) - 1)/4.

A186709 Number of quadratic residues (mod p) in the interval [2k+2,4k+2], for primes p=4k+3.

Original entry on oeis.org

0, 1, 1, 3, 4, 6, 9, 9, 10, 15, 14, 17, 16, 23, 22, 29, 25, 30, 34, 39, 36, 37, 41, 45, 48, 52, 49, 52, 52, 59, 62, 66, 72, 68, 78, 79, 80, 87, 90, 87
Offset: 1

Views

Author

M. F. Hasler, Feb 25 2011

Keywords

Crossrefs

Programs

  • PARI
    forprime( p=1, 399, p%4==3|next; u=3; c=[1, 0]; for(i=2, p-2, bittest(u, i^2%p) & next; u+=1<<(i^2%p); c[i^2%p*2\p+1]++); print1(c[2]", "))

Formula

a(n) = A104635(n) - A186708(n) = A186708(n) - A178154(n) = (A104635(n) - A178154(n))/2 = (A002145(n) - 2*A178154(n) -1)/4.

A211173 (2n)!^n (modulo 2n+1).

Original entry on oeis.org

0, 2, 1, 6, 0, 10, 1, 0, 1, 18, 0, 22, 0, 0, 1, 30, 0, 0, 1, 0, 1, 42, 0, 46, 0, 0, 1, 0, 0, 58, 1, 0, 0, 66, 0, 70, 1, 0, 0, 78, 0, 82, 0, 0, 1, 0, 0, 0, 1, 0, 1, 102, 0, 106, 1, 0, 1, 0, 0, 0, 0, 0, 0, 126, 0, 130, 0, 0, 1, 138, 0
Offset: 0

Views

Author

Larry Riddle (LRiddle(AT)AgnesScott.edu) and Robert G. Wilson v, Jan 31 2013

Keywords

Comments

a(n)= 0, 1 or 2n. In fact, a(n) = 0 iff n belongs to A047845, a(n) = 1 iff n belongs to A104636 and a(n) = 2n iff n belongs to A104635.

Crossrefs

Programs

  • Mathematica
    f[n_] := Mod[((2 n)!)^n, 2 n + 1]; Array[f, 70]
    Table[PowerMod[(2n)!,n,2n+1],{n,0,70}] (* Harvey P. Dale, Nov 02 2019 *)
  • PARI
    a(n)=if(isprime(2*n+1),if(n%2,2*n,1),0) \\ Charles R Greathouse IV, Feb 07 2013

Formula

a(n) = (2n)!^n (modulo 2n+1).

A336257 a(n) = Catalan(n) mod (2*n+1).

Original entry on oeis.org

0, 1, 2, 5, 5, 9, 2, 9, 2, 17, 17, 21, 12, 22, 2, 29, 18, 30, 2, 30, 2, 41, 30, 45, 9, 21, 2, 54, 53, 57, 2, 28, 38, 65, 42, 69, 2, 64, 70, 77, 5, 81, 80, 33, 2, 14, 27, 45, 2, 36, 2, 101, 87, 105, 2, 78, 2, 34, 75, 6, 101, 45, 62, 125, 39, 129, 74, 60, 2, 137, 90
Offset: 0

Views

Author

Michel Marcus, Jul 15 2020

Keywords

Crossrefs

Programs

  • Maple
    a:= n-> binomial(2*n, n)/(n+1) mod (2*n+1):
    seq(a(n), n=0..80);  # Alois P. Heinz, Jul 16 2020
  • PARI
    C(n)=binomial(2*n, n)/(n+1);
    a(n) = C(n) % (2*n+1);
    
  • Python
    A336257_list, c = [0,1], 1
    for n in range(2,10001):
        c = c*(4*n-2)//(n+1)
        A336257_list.append(c % (2*n+1)) # Chai Wah Wu, Jul 16 2020

Formula

a(n) = 2 for n in A104636.
a(n) = 2*n-1 for n in A104635.

A372113 Numbers k for which (k-1)/2 and 2*k+1 are both primes.

Original entry on oeis.org

5, 11, 15, 23, 35, 39, 63, 75, 83, 95, 119, 135, 179, 215, 219, 299, 303, 315, 359, 363, 455, 459, 483, 515, 543, 615, 663, 699, 719, 735, 779, 803, 879, 915, 923, 935, 975, 999, 1019, 1043, 1143, 1155, 1175, 1199, 1295, 1323, 1355, 1383, 1439, 1539, 1595, 1659, 1679, 1755, 1763, 1815, 1859, 1883
Offset: 1

Views

Author

Alexandre Herrera, Apr 19 2024

Keywords

Comments

Intersection of A072055 and A104635.

Examples

			5 is a term because (5-1)/2 = 2 is prime and 2*5+1 = 11 is prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[1, 2000, 2], AllTrue[{(# - 1)/2, 2 # + 1}, PrimeQ] &] (* Michael De Vlieger, Apr 19 2024 *)
  • Python
    from sympy import isprime
    def a(n): return n%2 == 1 and isprime((n-1)>>1) and isprime(2*n+1)
    print([n for n in range(2, 1900) if a(n)])

Formula

a(n) = 2*A023213(n) + 1.
a(n) = (A126330(n)-1)/2.
Showing 1-6 of 6 results.