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 34 results. Next

A139394 a(n) = A024899(n)-A024898(n).

Original entry on oeis.org

0, 0, 0, 1, 1, 0, 2, 2, 2, 1, 2, 2, 1, 3, 4, 3, 3, 2, 2, 3, 3, 3, 4, 0, 1, 5, 4, 4, 7, 7, 8, 7, 6, 8, 4, 4, 6, 4, 5, 5, 3, 4, 3, 6, 6, 9, 10, 9, 11, 11, 13, 8, 8, 8, 7, 8, 10, 9, 8, 10, 12, 12, 10, 11, 9, 8, 7, 8, 8, 5, 7, 6, 8, 7, 8, 9, 9, 13, 13, 11, 11, 12, 13, 11, 12, 13, 9, 11, 10, 11, 10, 6, 9
Offset: 1

Views

Author

Zak Seidov, Apr 18 2008

Keywords

Comments

From Zak Seidov, Nov 12 2008: (Start)
Conjecture: a(n) > 0, except n=1,2,3,6,24, when a(n)=0.
This fact can be apparently explained by existence of twin primes. (End)

Crossrefs

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

A002822 Numbers m such that 6m-1, 6m+1 are twin primes.

Original entry on oeis.org

1, 2, 3, 5, 7, 10, 12, 17, 18, 23, 25, 30, 32, 33, 38, 40, 45, 47, 52, 58, 70, 72, 77, 87, 95, 100, 103, 107, 110, 135, 137, 138, 143, 147, 170, 172, 175, 177, 182, 192, 205, 213, 215, 217, 220, 238, 242, 247, 248, 268, 270, 278, 283, 287, 298, 312, 313, 322, 325
Offset: 1

Views

Author

Keywords

Comments

6m-1 and 6m+1 are twin primes iff m is not of the form 6ab +- a +- b. - Jon Perry, Feb 01 2002
The above equivalence was rediscovered by Balestrieri, see link. - Charles R Greathouse IV, Jul 05 2011
Even terms correspond to twin primes of the form (4k - 1, 4k + 1), odd terms to twin primes of the form (4k + 1, 4k + 3). - Lekraj Beedassy, Apr 03 2002
From Bob Selcoe, Nov 28 2014: (Start)
Except for a(1)=1, all numbers in this sequence are congruent to (0, 2 or 3) mod 5.
It appears that when a(n)=6j, then j is also in the sequence (e.g., 138 = 6*23; 312 = 6*52). This also appears to hold for sequence A191626. If true, then it suggests that when seeking large twin primes, good candidates might be 36*a(n) +- 1, n >= 2.
Conjecture: There is at least one number in the sequence in the interval [5k, 7k] inclusive, k >= 1. If true, then the twin prime conjecture also is true.
(End)
A counterexample to "It appears that ...": Take j = 63. Then 6j = 378 and 36j = 2268. Now 379, 2267, and 2269 are prime, but 377 = 13 * 29. The sequence of counterexamples is A263282. - Jason Kimberley, Oct 13 2015
Dinculescu calls all terms in the sequence "twin ranks", and all other positive integers "non-ranks", see links. Non-ranks are given by the formula kp +- round(p/6) for positive integers k and primes p > 4, while twin ranks (this sequence) cannot be represented as kp +- round(p/6) for any k, p > 4. Here round(p/6) is the nearest integer to p/6. - Alexei Kourbatov, Jan 03 2015
Number of terms less than 10^k: 0, 5, 25, 142, 810, 5330, 37915, ... - Muniru A Asiru, Jan 24 2018
6m-1 and 6m+1 are twin primes iff 36m^2-1 is semiprime. It is algebraically provable that 36m^2-1 having any factor of the form 6k+-1 is equivalent to the statement that m is congruent to +-k (mod (6k+-1)). Other than the trivial case m=k, the fact of such a congruence means 36m^2-1 has a factor other than 6m-1 and 6m+1, and is not semiprime. Thus, {a(n)} lists the numbers m such that for all k < m, m is not congruent to +-k modulo (6k+-1). This is an alternative formulation of the results of Dinculescu referenced above. - Keith Backman, Apr 25 2021
Other than a(1)=1, it is provable that a(n) is not a square unless it is a multiple of 5, and a(n) is not a cube unless it is a multiple of 7. Examples of the former include a(11)=5^2=25, a(26)=10^2=100, and a(166)=35^2=1225; examples of the latter are rarer, including a(1531)=28^3=21952 and a(4163)=42^3=74088. - Keith Backman, Jun 26 2021

References

  • W. J. LeVeque, Topics in Number Theory. Addison-Wesley, Reading, MA, 2 vols., 1956, Vol. 1, p. 69.
  • W. Sierpiński, A Selection of Problems in the Theory of Numbers. Macmillan, NY, 1964, p. 120.
  • 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).

Crossrefs

Complement of A067611.
Intersection of A024898 and A024899.
A191626 is a subsequence.

Programs

  • Haskell
    a002822 n = a002822_list !! (n-1)
    a002822_list = f a000040_list where
       f (q:ps'@(p:ps)) | p > q + 2 || r > 0 = f ps'
                        | otherwise = y : f ps where (y,r) = divMod (q + 1) 6
    -- Reinhard Zumkeller, Jul 13 2014
  • Magma
    [n: n in [1..200] | IsPrime(6*n+1) and IsPrime(6*n-1)] // Vincenzo Librandi, Nov 21 2010
    
  • Maple
    select(n -> isprime(6*n-1) and isprime(6*n+1), [$1..1000]); # Robert Israel, Jan 11 2015
  • Mathematica
    Select[ Range[350], PrimeQ[6# - 1] && PrimeQ[6# + 1] & ]
    Select[Range[400],AllTrue[6#+{1,-1},PrimeQ]&] (* Harvey P. Dale, Jul 27 2022 *)
    #/6&/@Select[Range[6,2500,6],AllTrue[#+{1,-1},PrimeQ]&] (* Harvey P. Dale, Mar 31 2023 *)
  • PARI
    select(primes(100),n->isprime(n-2)&&n>5)\6 \\ Charles R Greathouse IV, Jul 05 2011
    
  • PARI
    p=5; forprime(q=5, 1e4, if(q-p==2, print1((p+1)/6", ")); p=q); \\ Altug Alkan, Oct 13 2015
    
  • PARI
    list(lim)=my(v=List(),p=5); forprime(q=7,6*lim+1, if(q-p==2, listput(v,q\6)); p=q); Vec(v) \\ Charles R Greathouse IV, Dec 03 2016
    

Formula

a(n) = A014574(n+1)/6. - Ivan N. Ianakiev, Aug 19 2013

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Mar 27 2001

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

A091178 Numbers k such that k-th prime is of the form 6*m+1.

Original entry on oeis.org

4, 6, 8, 11, 12, 14, 18, 19, 21, 22, 25, 27, 29, 31, 34, 36, 37, 38, 42, 44, 46, 47, 48, 50, 53, 58, 59, 61, 63, 65, 67, 68, 70, 73, 74, 75, 78, 80, 82, 84, 85, 88, 90, 93, 95, 99, 100, 101, 105, 106, 110, 111, 112, 114, 115, 117, 121, 122, 125, 127, 129, 130
Offset: 1

Views

Author

Ray Chandler, Dec 26 2003

Keywords

Comments

A002476 indexed by A000040.
Also k for which prime(k) == 1 (mod 3). - Bruno Berselli, Mar 04 2016
Sequence A091177 (indices of primes of the form 3*k-1) is this sequence's complement in the positive integers without {2}. - M. F. Hasler, Sep 02 2016
The asymptotic density of this sequence is 1/2 (by Dirichlet's theorem). - Amiram Eldar, Feb 28 2021

Crossrefs

Cf. A000040, A002476 (primes of the form 6*m+1), A091177 (indices of primes of the form 3*k-1), A024892, A024899.

Programs

  • Mathematica
    Select[Range[200],IntegerQ[(Prime[#]-1)/6]&] (* Harvey P. Dale, Aug 25 2013 *)
  • PARI
    isok(n) = !((prime(n)-1) % 6); \\ Michel Marcus, Mar 04 2016

Formula

a(n) = k such that A000040(k) = A002476(n).

Extensions

Definition edited by Zak Seidov, Oct 09 2014

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.

A056956 Numbers n such that 6n+1 and 6n+5 are both primes.

Original entry on oeis.org

1, 2, 3, 6, 7, 11, 13, 16, 17, 18, 21, 27, 32, 37, 38, 46, 51, 52, 58, 63, 66, 73, 76, 77, 81, 83, 102, 107, 112, 123, 126, 128, 137, 142, 143, 146, 147, 151, 156, 161, 168, 181, 182, 202, 213, 216, 217, 237, 238, 241, 247, 248, 258, 261, 263, 266, 268, 277, 282
Offset: 1

Views

Author

Henry Bottomley, Jul 18 2000

Keywords

Comments

Note that if prime p>3 then p mod 6 = 1 or 5.

Examples

			a(2)=2 since 6*2+1=13 and 6*2+5=17 are both prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[300], And @@ PrimeQ /@ ({1, 5} + 6#) &] (* Ray Chandler, Jun 29 2008 *)
  • PARI
    is(n)=isprime(n*6+1)&&isprime(n*6+5) \\ M. F. Hasler, Apr 05 2017

Formula

a(n) = (A023200(n+1)-1)/6 = (A046132(n+1)-5)/6 = A047847(n+1)/3
a(n) = floor(A087679(n+1)/6). - M. F. Hasler, Apr 05 2017

Extensions

Edited by N. J. A. Sloane, Nov 07 2006

A046954 Numbers k such that 6*k + 1 is nonprime.

Original entry on oeis.org

0, 4, 8, 9, 14, 15, 19, 20, 22, 24, 28, 29, 31, 34, 36, 39, 41, 42, 43, 44, 48, 49, 50, 53, 54, 57, 59, 60, 64, 65, 67, 69, 71, 74, 75, 78, 79, 80, 82, 84, 85, 86, 88, 89, 92, 93, 94, 97, 98, 99, 104, 106, 108, 109, 111, 113, 114, 116, 117, 119, 120, 124, 127, 129, 130, 132, 133, 134, 136, 139, 140
Offset: 1

Views

Author

Keywords

Comments

Equals A171696 U A121763; A121765 U A171696 = A046953; A121763 U A121765 = A067611 where A067611 U A002822 U A171696 = A001477. - Juri-Stepan Gerasimov, Feb 13 2010, Feb 15 2010
These numbers (except 0) can be written as 6xy +-(x+y) for x > 0, y > 0. - Ron R Spencer, Aug 01 2016

Examples

			a(2)=8 because 6*8 + 1 = 49, which is composite.
		

Crossrefs

Cf. A047845 (2n+1), A045751 (4n+1), A127260 (8n+1).
Cf. A046953, A008588, A016921, subsequence of A067611, complement of A024899.

Programs

  • GAP
    Filtered([0..250], k-> not IsPrime(6*k+1)) # G. C. Greubel, Feb 21 2019
  • Haskell
    a046954 n = a046954_list !! (n-1)
    a046954_list = map (`div` 6) $ filter ((== 0) . a010051' . (+ 1)) [0,6..]
    -- Reinhard Zumkeller, Jul 13 2014
    
  • Magma
    [n: n in [0..250] | not IsPrime(6*n+1)]; // G. C. Greubel, Feb 21 2019
    
  • Maple
    remove(k-> isprime(6*k+1), [$0..140])[]; # Muniru A Asiru, Feb 22 2019
  • Mathematica
    a = Flatten[Table[If[PrimeQ[6*n + 1] == False, n, {}], {n, 0, 50}]] (* Roger L. Bagula, May 17 2007 *)
    Select[Range[0, 200], !PrimeQ[6 # + 1] &] (* Vincenzo Librandi, Sep 27 2013 *)
  • PARI
    is(n)=!isprime(6*n+1) \\ Charles R Greathouse IV, Aug 01 2016
    
  • Sage
    [n for n in (0..250) if not is_prime(6*n+1)] # G. C. Greubel, Feb 21 2019
    

Extensions

Edited by N. J. A. Sloane, Aug 08 2008 at the suggestion of R. J. Mathar
Corrected by Juri-Stepan Gerasimov, Feb 13 2010, Feb 15 2010
Corrected by Vincenzo Librandi, Sep 27 2013

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
Showing 1-10 of 34 results. Next