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-10 of 14 results. Next

A002476 Primes of the form 6m + 1.

Original entry on oeis.org

7, 13, 19, 31, 37, 43, 61, 67, 73, 79, 97, 103, 109, 127, 139, 151, 157, 163, 181, 193, 199, 211, 223, 229, 241, 271, 277, 283, 307, 313, 331, 337, 349, 367, 373, 379, 397, 409, 421, 433, 439, 457, 463, 487, 499, 523, 541, 547, 571, 577, 601, 607, 613, 619
Offset: 1

Views

Author

Keywords

Comments

Equivalently, primes of the form 3m + 1.
Rational primes that decompose in the field Q(sqrt(-3)). - N. J. A. Sloane, Dec 25 2017
Primes p dividing Sum_{k=0..p} binomial(2k, k) - 3 = A006134(p) - 3. - Benoit Cloitre, Feb 08 2003
Primes p such that tau(p) == 2 (mod 3) where tau(x) is the Ramanujan tau function (cf. A000594). - Benoit Cloitre, May 04 2003
Primes of the form x^2 + xy - 2y^2 = (x+2y)(x-y). - N. J. A. Sloane, May 31 2014
Primes of the form x^2 - xy + 7y^2 with x and y nonnegative. - T. D. Noe, May 07 2005
Primes p such that p^2 divides Sum_{m=1..2(p-1)} Sum_{k=1..m} (2k)!/(k!)^2. - Alexander Adamchuk, Jul 04 2006
A006512 larger than 5 (Greater of twin primes) is a subsequence of this. - Jonathan Vos Post, Sep 03 2006
A039701(A049084(a(n))) = A134323(A049084(a(n))) = 1. - Reinhard Zumkeller, Oct 21 2007
Also primes p such that the arithmetic mean of divisors of p^2 is an integer: sigma_1(p^2)/sigma_0(p^2) = C. (A000203(p^2)/A000005(p^2) = C). - Ctibor O. Zizka, Sep 15 2008
Fermat knew that these numbers can also be expressed as x^2 + 3y^2 and are therefore not prime in Z[omega], where omega is a complex cubic root of unity. - Alonso del Arte, Dec 07 2012
Primes of the form x^2 + xy + y^2 with x < y and nonnegative. Also see A007645 which also applies when x=y, adding an initial 3. - Richard R. Forberg, Apr 11 2016
For any term p in this sequence, let k = (p^2 - 1)/6; then A016921(k) = p^2. - Sergey Pavlov, Dec 16 2016; corrected Dec 18 2016
For the decomposition p=x^2+3*y^2, x(n) = A001479(n+1) and y(n) = A001480(n+1). - R. J. Mathar, Apr 16 2024

Examples

			Since 6 * 1 + 1 = 7 and 7 is prime, 7 is in the sequence. (Also 7 = 2^2 + 3 * 1^2 = (2 + sqrt(-3))(2 - sqrt(-3)).)
Since 6 * 2 + 1 = 13 and 13 is prime, 13 is in the sequence.
17 is prime but it is of the form 6m - 1 rather than 6m + 1, and is therefore not in the sequence.
		

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 870.
  • David A. Cox, Primes of the Form x^2 + ny^2. New York: Wiley (1989): 8.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 261.

Crossrefs

For values of m see A024899. Primes of form 3n - 1 give A003627.
These are the primes arising in A024892, A024899, A034936.
A091178 gives prime index.
Subsequence of A016921 and of A050931.
Cf. A004611 (multiplicative closure).

Programs

  • GAP
    Filtered(List([0..110],k->6*k+1),n-> IsPrime(n)); # Muniru A Asiru, Mar 11 2019
  • Haskell
    a002476 n = a002476_list !! (n-1)
    a002476_list = filter ((== 1) . (`mod` 6)) a000040_list
    -- Reinhard Zumkeller, Jan 15 2013
    
  • J
    (#~ 1&p:) >: 6 * i.1000 NB. Stephen Makdisi, May 01 2018
    
  • Magma
    [n: n in [1..700 by 6] | IsPrime(n)]; // Vincenzo Librandi, Apr 05 2011
    
  • Maple
    a := [ ]: for n from 1 to 400 do if isprime(6*n+1) then a := [ op(a), n ]; fi; od: A002476 := n->a[n];
  • Mathematica
    Select[6*Range[100] + 1, PrimeQ[ # ] &] (* Stefan Steinerberger, Apr 06 2006 *)
  • PARI
    select(p->p%3==1,primes(100)) \\ Charles R Greathouse IV, Oct 31 2012
    

Formula

From R. J. Mathar, Apr 03 2011: (Start)
Sum_{n >= 1} 1/a(n)^2 = A175644.
Sum_{n >= 1} 1/a(n)^3 = A175645. (End)
a(n) = 6*A024899(n) + 1. - Zak Seidov, Aug 31 2016
From Vaclav Kotesovec, May 02 2020: (Start)
Product_{k>=1} (1 - 1/a(k)^2) = 1/A175646.
Product_{k>=1} (1 + 1/a(k)^2) = A334481.
Product_{k>=1} (1 - 1/a(k)^3) = A334478.
Product_{k>=1} (1 + 1/a(k)^3) = A334477. (End)
Legendre symbol (-3, a(n)) = +1 and (-3, A007528(n)) = -1, for n >= 1. For prime 3 one sets (-3, 3) = 0. - Wolfdieter Lang, Mar 03 2021

A024899 Numbers k such that 6*k + 1 is prime.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 10, 11, 12, 13, 16, 17, 18, 21, 23, 25, 26, 27, 30, 32, 33, 35, 37, 38, 40, 45, 46, 47, 51, 52, 55, 56, 58, 61, 62, 63, 66, 68, 70, 72, 73, 76, 77, 81, 83, 87, 90, 91, 95, 96, 100, 101, 102, 103, 105, 107, 110, 112, 115, 118, 121, 122, 123, 125, 126, 128, 131, 135, 137
Offset: 1

Views

Author

Keywords

Comments

For all elements of this sequence there are no (x,y) positive integers such that a(n)=6*x*y+x+y or a(n)=6*x*y-x-y. - Pedro Caceres, Apr 19 2019

Crossrefs

A002476 gives primes, A091178 gives prime index.
Complement of A046954 relative to A000027.

Programs

  • Magma
    [n: n in [0..200]| IsPrime(6*n+1)] // Vincenzo Librandi, Nov 20 2010
    
  • Maple
    a := [ ]: for n from 0 to 400 do if isprime(6*n+1) then a := [ op(a), n ]; fi; od: A002476 := n->a[n];
  • Mathematica
    Select[Range@ 140, PrimeQ[6 # + 1] &] (* Michael De Vlieger, Jan 23 2018 *)
  • PARI
    select(n->n%6==1,primes(100))\6 \\ Charles R Greathouse IV, Apr 28 2015

Formula

a(n) = A024892(n)/2 = (A034936(n)+1)/2. - Ray Chandler, Dec 26 2003
a(n) = (A002476(n)-1)/6. - Zak Seidov, Aug 31 2016

A039701 a(n) = n-th prime modulo 3.

Original entry on oeis.org

2, 0, 2, 1, 2, 1, 2, 1, 2, 2, 1, 1, 2, 1, 2, 2, 2, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 1, 1, 2, 2, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 2, 1, 2, 2, 2, 2, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 2, 1, 1, 1, 2, 2, 1, 2, 1, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 1
Offset: 1

Views

Author

Keywords

Comments

If n > 2 and prime(n) is a Mersenne prime then a(n) = 1. Proof: prime(n) = 2^p - 1 for some odd prime p, so prime(n) = 2*4^((p-1)/2) - 1 == 2 - 1 = 1 (mod 3). - Santi Spadaro, May 03 2002; corrected and simplified by Dean Hickerson, Apr 20 2003
Except for n = 2, a(n) is the smallest number k > 0 such that 3 divides prime(n)^k - 1. - T. D. Noe, Apr 17 2003
a(n) <> 0 for n <> 2; a(A049084(A003627(n))) = 2; a(A049084(A002476(n))) = 1; A134323(n) = (1 - 0^a(n)) * (-1)^(a(n)+1). - Reinhard Zumkeller, Oct 21 2007
Probability of finding 1 (or 2) in this sequence is 1/2. This follows from the Prime Number Theorem in arithmetic progressions. Examples: There are 4995 1's in terms (10^9 +1) to (10^9+10^4); there are 10^9/2-1926 1's in the first 10^9 terms. - Jerzy R Borysowicz, Mar 06 2022

Crossrefs

Cf. A091178 (indices of 1's), A091177 (indices of 2's).
Cf. A120326 (partial sums).
Cf. A010872.

Programs

Formula

Sum_k={1..n} a(k) ~ (3/2)*n. - Amiram Eldar, Dec 11 2024

A007693 Primes p such that 6*p + 1 is also prime.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 23, 37, 47, 61, 73, 83, 101, 103, 107, 131, 137, 151, 173, 181, 233, 241, 257, 263, 271, 277, 283, 293, 311, 313, 331, 347, 367, 373, 397, 443, 461, 467, 503, 557, 577, 593, 601, 607, 641, 653, 661, 683, 727, 751, 761, 773, 787, 797, 853
Offset: 1

Views

Author

Keywords

References

  • Joe Roberts, Lure of the Integers, Math. Assoc. America, 1992, p. 83.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A002476, A016921, A024899, A051644, A091178, A023256 (subset: 6*(6p+1)+1 also prime).
Prime terms of A024899.

Programs

  • Magma
    [n: n in [0..1000] | IsPrime(n) and IsPrime(6*n+1)]; // Vincenzo Librandi, Nov 18 2010
    
  • Mathematica
    Select[Prime@Range[150], PrimeQ[6# + 1] &] (* Ray Chandler, Mar 14 2007  *)
  • PARI
    isok(k) = isprime(k) && isprime(6*k+1); \\ Amiram Eldar, Feb 24 2025

Formula

a(n) = (A051644(n)-1)/6.

Extensions

Extended by Ray Chandler, Mar 14 2007

A034936 Numbers k such that 3*k + 4 is prime.

Original entry on oeis.org

1, 3, 5, 9, 11, 13, 19, 21, 23, 25, 31, 33, 35, 41, 45, 49, 51, 53, 59, 63, 65, 69, 73, 75, 79, 89, 91, 93, 101, 103, 109, 111, 115, 121, 123, 125, 131, 135, 139, 143, 145, 151, 153, 161, 165, 173, 179, 181, 189, 191, 199, 201, 203, 205, 209, 213, 219, 223, 229
Offset: 1

Views

Author

Keywords

Comments

Related to hyperperfect numbers of a certain form.

Crossrefs

Cf. A038536 and A002476.
A002476 gives primes, A091178 gives prime index.
a(n) = A024892(n) - 1 = 2*A024899(n) - 1.
a(n) = A153183(n) - 2 = A107303(n) - 3.

Programs

A024892 Numbers k such that 3*k+1 is prime.

Original entry on oeis.org

2, 4, 6, 10, 12, 14, 20, 22, 24, 26, 32, 34, 36, 42, 46, 50, 52, 54, 60, 64, 66, 70, 74, 76, 80, 90, 92, 94, 102, 104, 110, 112, 116, 122, 124, 126, 132, 136, 140, 144, 146, 152, 154, 162, 166, 174, 180, 182, 190, 192, 200, 202, 204, 206, 210, 214, 220, 224, 230, 236, 242, 244, 246
Offset: 1

Views

Author

Keywords

Comments

Every prime (with the exception of 3) can be expressed as 3*k+1 or 3*k-1. - César Aguilera, Apr 13 2013
The associated prime A002476(n) has a unique representation as x^2 + x*y - 2*y^2 = (x + 2*y)*(x-y) with positive integers, namely (x(n), y(n)) = (a(n) + 1, a(n)). See the N. J. A. Sloane, May 31 2014, comment on A002476. - Wolfdieter Lang, Feb 09 2016
For all elements of this sequence there are no (x,y) positive integers such that a(n) = 3*x*y + x + y or a(n) = 3*x*y - x - y. - Pedro Caceres, Jan 28 2021

Crossrefs

Cf. A002476 (associated primes), A091178 (gives prime index).

Programs

Formula

a(n) = (A002476(n) - 1)/3. See the name.
a(n) = 2*A024899(n) = A034936(n) + 1.
a(n) = A153183(n) - 1 = A107303(n) - 2.

A051644 Primes of the form 6*p + 1 where p is also prime.

Original entry on oeis.org

13, 19, 31, 43, 67, 79, 103, 139, 223, 283, 367, 439, 499, 607, 619, 643, 787, 823, 907, 1039, 1087, 1399, 1447, 1543, 1579, 1627, 1663, 1699, 1759, 1867, 1879, 1987, 2083, 2203, 2239, 2383, 2659, 2767, 2803, 3019, 3343, 3463, 3559, 3607, 3643, 3847, 3919
Offset: 1

Views

Author

Keywords

Comments

Analogous to A005385; can be called 6-safe primes.

Examples

			103 is in the sequence because both 17 and 6*17 + 1 = 103 are primes.
		

Crossrefs

Programs

  • Mathematica
    Select[1 + 6Prime@Range[120], PrimeQ] (* Ray Chandler, Mar 14 2007 *)
  • PARI
    isok(k) = isprime(k) && k % 6 == 1 && isprime((k-1)/6); \\ Amiram Eldar, Feb 24 2025

Formula

a(n) = 6*A007693(n) + 1.

Extensions

Edited, corrected and extended by Ray Chandler, Mar 14 2007

A134323 a(n) = Legendre(-3, prime(n)).

Original entry on oeis.org

-1, 0, -1, 1, -1, 1, -1, 1, -1, -1, 1, 1, -1, 1, -1, -1, -1, 1, 1, -1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, 1, -1, -1, 1, -1, 1, 1, 1, -1, -1, -1, 1, -1, 1, -1, 1, 1, 1, -1, 1, -1, -1, 1, -1, -1, -1, -1, 1, 1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, 1, 1, -1, -1, 1, -1, 1, -1, -1, 1, -1, 1, -1, -1, -1, 1, 1, 1, -1
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 21 2007

Keywords

Comments

Value of lowest trit of prime(n) in balanced ternary representation (A059095) (original definition).
For p = prime(n) != 3, a(n) = +1 if p is of the form 3*k + 1, and -1 if the p is of the form 3*k - 1. - Joerg Arndt, Sep 16 2014

Examples

			For n=20, prime(20) = 71, and we verify that -3 is not a quadratic residue modulo 71, hence a(20) = -1. Also, we see that the balanced ternary representation row A059095(71) = {1, 0, -1, 0, -1} which ends in -1.
For n=21, prime(21) = 73, and we see that x^2 = -3 mod 73 has solutions like x = 17, 56, hence a(21) = 1. Also, the balanced ternary representation row A059095(73) = {1, 0 -1, 0, 1} which ends in 1.
		

Crossrefs

Cf. A000040, A039701, A049084, A112632 (partial sums), A059095 (balanced ternary)
Cf. A091177 (indices of -1's), A091178 (indices of +1's), A003627, A002476.
Other moduli: A070750, A257834.
Cf. A102283.

Programs

Formula

-1 if the n-th prime is 2 or == 5 mod 6, +1 if the n-th prime is == 1 mod 6, and 0 if it is 3.
a(n) = (1 - 0^A039701(n)) * (-1)^(A039701(n)+1).
a(n) != 0 for n != 2;
a(A049084(A003627(n))) = -1; a(A049084(A002476(n))) = +1.
a(n) = A102283(prime(n)). - Ridouane Oudra, Jan 09 2025

Extensions

Wording of definition changed by N. J. A. Sloane, Jun 21 2015
Name simplified by Alonso del Arte, Aug 02 2017

A099618 a(n) = 1 if the n-th prime == 1 mod 6, otherwise a(n) = 0.

Original entry on oeis.org

0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1
Offset: 1

Views

Author

Joseph Biberstine (jrbibers(AT)indiana.edu), Nov 19 2004

Keywords

Crossrefs

Characteristic function of A091178.

Programs

  • Mathematica
    Table[Mod[Mod[Mod[Mod[Prime[k], 6], 5], 3], 2], {k, 1, 120}]
    a[n_] := Boole[Mod[Prime[n], 6] == 1]; Array[a, 120] (* Amiram Eldar, Mar 14 2025 *)
  • PARI
    a(n) = (prime(n) % 6) == 1; \\ Michel Marcus, Jun 26 2019

Formula

From Amiram Eldar, Mar 14 2025: (Start)
a(n) = 1 - A132194(m).
Sum_{k=1..n} a(k) ~ n / 2. (End)

A130075 a(n) = (5^p - 3^p - 2^p)/p, where p = prime(n).

Original entry on oeis.org

6, 30, 570, 10830, 4422630, 93776970, 44871187170, 1003806502230, 518297165370030, 6422911941109705770, 150213298561349961630, 1966475018690546370358170, 1109139879321302763891656370
Offset: 1

Views

Author

Alexander Adamchuk, May 06 2007

Keywords

Comments

p divides 5^p - 3^p - 2^p = A130072(p) for prime p.
p^(k+1) divides A130072(p^k) for prime p = {2,3,5,19} = A130076(n) and all k>0.
2 divides a(n). 3 divides a(n). 5 divides a(n) for n>1. 19 divides a(n) for n>2. 19^2 divides a(n) for n in A091178(n) or prime(n) in A002476.

Crossrefs

Programs

  • Mathematica
    Table[(5^Prime[n]-3^Prime[n]-2^Prime[n])/Prime[n],{n,1,20}]
    (5^#-3^#-2^#)/#&/@Prime[Range[20]] (* Harvey P. Dale, May 02 2012 *)

Formula

a(n) = (5^prime(n) - 3^prime(n) - 2^prime(n))/prime(n).
a(n) = A130072(prime(n))/prime(n).
Showing 1-10 of 14 results. Next