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-8 of 8 results.

A002496 Primes of the form k^2 + 1.

Original entry on oeis.org

2, 5, 17, 37, 101, 197, 257, 401, 577, 677, 1297, 1601, 2917, 3137, 4357, 5477, 7057, 8101, 8837, 12101, 13457, 14401, 15377, 15877, 16901, 17957, 21317, 22501, 24337, 25601, 28901, 30977, 32401, 33857, 41617, 42437, 44101, 50177
Offset: 1

Views

Author

Keywords

Comments

It is conjectured that this sequence is infinite, but this has never been proved.
An equivalent description: primes of form P = (p1*p2*...*pm)^k + 1 where p1..pm are primes and k > 1, since then k must be even for P to be prime.
Also prime = p(n) if A054269(n) = 1, i.e., quotient-cycle-length = 1 in continued fraction expansion of sqrt(p). - Labos Elemer, Feb 21 2001
Also primes p such that phi(p) is a square.
Also primes of form x*y + z, where x, y and z are three successive numbers. - Giovanni Teofilatto, Jun 05 2004
It is a result that goes back to Mirsky that the set of primes p for which p-1 is squarefree has density A, where A = A005596 denotes the Artin constant. More precisely, Sum_{p <= x} mu(p-1)^2 = A*x/log x + o(x/log x) as x tends to infinity. Conjecture: Sum_{p <= x, mu(p-1)=1} 1 = (A/2)*x/log x + o(x/log x) and Sum_{p <= x, mu(p-1)=-1} 1 = (A/2)*x/log x + o(x/log x). - Pieter Moree (moree(AT)mpim-bonn.mpg.de), Nov 03 2003
Also primes of the form x^y + 1, where x > 0, y > 1. Primes of the form x^y - 1 (x > 0, y > 1) are the Mersenne primes listed in A000668(n) = {3, 7, 31, 127, 8191, 131071, 524287, 2147483647, ...}. - Alexander Adamchuk, Mar 04 2007
With the exception of the first two terms {2,5}, the continued fraction (1 + sqrt(p))/2 has period 3. - Artur Jasinski, Feb 03 2010
With the exception of the first term {2}, congruent to 1 (mod 4). - Artur Jasinski, Mar 22 2011
With the exception of the first two terms, congruent to 1 or 17 (mod 20). - Robert Israel, Oct 14 2014
From Bernard Schott, Mar 22 2019: (Start)
These primes are the primitive terms which generate the sequence of integers with only one prime factor and whose Euler's totient is a square: A054755. So this sequence is a subsequence of A054755 and of A039770. Additionally, the terms of this sequence also have a square cototient, so this sequence is a subsequence of A063752 and A054754.
If p prime = n^2 + 1, phi(p) = n^2 and cototient(p) = 1^2.
Except for 3, the four Fermat primes in A019434 {5, 17, 257, 65537}, belong to this sequence; with F_k = 2^(2^k) + 1, phi(F_k) = (2^(2^(k-1)))^2.
See the file "Subfamilies and subsequences" (& I) in A039770 for more details, proofs with data, comments, formulas and examples. (End)
In this sequence, primes ending with 7 seem to appear twice as often as primes ending with 1. This is because those with 7 come from integers ending with 4 or 6, while those with 1 come only from integers ending with 0 (see De Koninck & Mercier reference). - Bernard Schott, Nov 29 2020
The set of odd primes p for which every elliptic curve of the form y^2 = x^3 + d*x has order p-1 over GF(p) for those d with (d,p)=1 and d a fourth power modulo p. - Gary Walsh, Sep 01 2021 [edited, Gary Walsh, Apr 26 2025]

References

  • Jean-Marie De Koninck & Armel Mercier, 1001 Problèmes en Théorie Classique des Nombres, Problème 211 pp. 34 and 169, Ellipses, Paris, 2004.
  • Leonhard Euler, De numeris primis valde magnis (E283), reprinted in: Opera Omnia. Teubner, Leipzig, 1911, Series (1), Vol. 3, p. 22.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, th. 17.
  • Hugh L. Montgomery, Ten Lectures on the Interface Between Analytic Number Theory and Harmonic Analysis, Amer. Math. Soc., 1996, p. 208.
  • C. Stanley Ogilvy, Tomorrow's Math. 2nd ed., Oxford Univ. Press, 1972, p. 116.
  • 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 118.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers (Rev. ed. 1997), p. 134.

Crossrefs

Cf. A083844 (number of these primes < 10^n), A199401 (growth constant).
Cf. A000668 (Mersenne primes), A019434 (Fermat primes).
Subsequence of A039770.
Cf. A010051, subsequence of A002522.
Cf. A237040 (an analog for n^3 + 1).
Cf. A010051, A000290; subsequence of A028916.
Subsequence of A039770, A054754, A054755, A063752.
Primes of form n^2+b^4, b fixed: A243451 (b=2), A256775 (b=3), A256776 (b=4), A256777 (b=5), A256834 (b=6), A256835 (b=7), A256836 (b=8), A256837 (b=9), A256838 (b=10), A256839 (b=11), A256840 (b=12), A256841 (b=13).
Cf. A030430 (primes ending with 1), A030432 (primes ending with 7).

Programs

  • Haskell
    a002496 n = a002496_list !! (n-1)
    a002496_list = filter ((== 1) . a010051') a002522_list
    -- Reinhard Zumkeller, May 06 2013
    
  • Magma
    [p: p in PrimesUpTo(100000)| IsSquare(p-1)]; // Vincenzo Librandi, Apr 09 2011
    
  • Maple
    select(isprime, [2, seq(4*i^2+1, i= 1..1000)]); # Robert Israel, Oct 14 2014
  • Mathematica
    Select[Range[100]^2+1, PrimeQ]
    Join[{2},Select[Range[2,300,2]^2+1,PrimeQ]] (* Harvey P. Dale, Dec 18 2018 *)
  • PARI
    isA002496(n) = isprime(n) && issquare(n-1) \\ Michael B. Porter, Mar 21 2010
    
  • PARI
    is_A002496(n)=issquare(n-1)&&isprime(n) \\ For "random" numbers in the range 10^10 and beyond, at least 5 times faster than the above. - M. F. Hasler, Oct 14 2014
    
  • Python
    # Python 3.2 or higher required
    from itertools import accumulate
    from sympy import isprime
    A002496_list = [n+1 for n in accumulate(range(10**5),lambda x,y:x+2*y-1) if isprime(n+1)] # Chai Wah Wu, Sep 23 2014
    
  • Python
    # Python 2.4 or higher required
    from sympy import isprime
    A002496_list = list(filter(isprime, (n*n+1 for n in range(10**5)))) # David Radcliffe, Jun 26 2016

Formula

There are O(sqrt(n)/log(n)) terms of this sequence up to n. But this is just an upper bound. See the Bateman-Horn or Wolf papers, for example, for the conjectured for what is believed to be the correct density.
a(n) = 1 + A005574(n)^2. - R. J. Mathar, Jul 31 2015
Sum_{n>=1} 1/a(n) = A172168. - Amiram Eldar, Nov 14 2020
a(n+1) = 4*A001912(n)^2 + 1. - Hal M. Switkay, Apr 03 2022

Extensions

Formula, reference, and comment from Charles R Greathouse IV, Aug 24 2009
Edited by M. F. Hasler, Oct 14 2014

A078330 Primes p such that mu(p-1) = -1, where mu is the Moebius function; that is, p-1 is squarefree and has an odd number of prime factors.

Original entry on oeis.org

3, 31, 43, 67, 71, 79, 103, 131, 139, 191, 223, 239, 283, 311, 367, 419, 431, 439, 443, 499, 599, 607, 619, 643, 647, 659, 683, 743, 787, 823, 827, 907, 947, 971, 1031, 1039, 1087, 1091, 1103, 1163, 1223, 1259, 1399, 1427, 1447, 1499, 1511, 1543, 1559, 1571
Offset: 1

Views

Author

Shyam Sunder Gupta, Nov 21 2002

Keywords

Examples

			31 is in the sequence because 31 is a prime and mu(30) = -1.
37 is not in the sequence because, although 37 is prime, mu(36) = 0.
		

Crossrefs

Cf. A008683, A049092 (primes p with mu(p-1) = 0), A088179 (primes p with mu(p-1) = 1), A089451 (mu(p-1) for prime p).

Programs

  • Mathematica
    Select[Prime[Range[400]], MoebiusMu[# - 1] == -1 &] (* from T. D. Noe *)
  • PARI
    j=[]; forprime(n=1,2000,if(moebius(n)==moebius(n-1),j=concat(j,n))); j

A089451 a(n) = mu(prime(n)-1), where mu is the Moebius function (A008683).

Original entry on oeis.org

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

Views

Author

T. D. Noe, Nov 03 2003

Keywords

Comments

Note that A049092 lists prime(n) such that a(n) = 0. Similarly, A078330 lists prime(n) such that a(n) = -1. See A088179 for prime(n) such that a(n) = 1. Also note that a(n) == A088144(n) (mod prime(n)).

References

  • J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 236.

Crossrefs

Cf. A089495 (mu(p+1) for prime p), A089496 (mu(p+1)+mu(p-1) for prime p), A089497 (mu(p+1)-mu(p-1) for prime p).

Programs

  • Magma
    [MoebiusMu(NthPrime(n)-1): n in [1..100]]; // Vincenzo Librandi, Dec 23 2018
  • Mathematica
    Table[MoebiusMu[Prime[n]-1], {n, 150}]
  • PARI
    a(n)=moebius(prime(n)-1)
    

Formula

a(n) = A067460(n) - 1. - Benoit Cloitre, Nov 04 2003
If p = prime(n), then a(n) is congruent modulo p to the sum of all primitive roots modulo p. [Uspensky and Heaslet]. - Michael Somos, Feb 16 2020

A049092 Primes p such that p-1 is not squarefree.

Original entry on oeis.org

5, 13, 17, 19, 29, 37, 41, 53, 61, 73, 89, 97, 101, 109, 113, 127, 137, 149, 151, 157, 163, 173, 181, 193, 197, 199, 229, 233, 241, 251, 257, 269, 271, 277, 281, 293, 307, 313, 317, 337, 349, 353, 373, 379, 389, 397, 401, 409, 421, 433, 449, 457, 461, 487
Offset: 1

Views

Author

Keywords

Comments

Primes p with mu(p-1)=0, where mu is the Möbius function. - T. D. Noe, Nov 03 2003
Primes p such that the sum of the primitive roots of p (see A088144) is 0 mod p. - Jon Wharf, Mar 12 2015
The relative density of this sequence within the primes is 1 - A005596 = 0.626044... - Amiram Eldar, Feb 10 2021

Examples

			p = 257 is here because p-1 = 256 = 2^8.
p = 997 is here because p-1 = 996 = 3*(2^2)*83.
		

Crossrefs

Cf. A005596, A039787, A078330 (primes p with mu(p-1)=-1), A088179 (primes p such that mu(p-1)=1), A089451 (mu(p-1) for prime p), A145199.

Programs

  • Magma
    [ p: p in PrimesUpTo(500) | not IsSquarefree(p-1) ]; // Vincenzo Librandi, Mar 12 2015
    
  • Mathematica
    Select[Prime[Range[400]], MoebiusMu[ #-1]==0&]
  • PARI
    forprime(p=2,500,if(!issquarefree(p-1),print(p))) \\ Michael B. Porter, Mar 16 2015

Formula

a(n) = A145199(n) + 1. - Amiram Eldar, Feb 10 2021

A244466 Nonprimes n such that mu(phi(n)) = 1.

Original entry on oeis.org

1, 9, 14, 18, 22, 46, 94, 118, 166, 214, 334, 358, 422, 454, 526, 662, 694, 718, 766, 926, 934, 958, 961, 1006, 1094, 1126, 1142, 1174, 1382, 1438, 1678, 1718, 1726, 1774, 1822, 1849, 1922, 1934, 1966, 2038, 2246, 2374, 2462, 2566, 2582, 2606, 2614, 2638, 2654, 2734, 2878, 2966, 2974, 3046
Offset: 1

Views

Author

Torlach Rush, Jun 28 2014

Keywords

Comments

Odd terms > 1 are the square of some prime: a(2) = 9 = 3^2, a(23) = 961 = 31^2, a(36) = 1849 = 43^2, ... .
Odd terms > 1 are A078330^2. Even terms are 2*A088179 and 2*A078330^2. - Robert Israel, Aug 01 2014

Examples

			9 is not prime, phi(9) = 6 and mu(6) = 1, mu(phi(9)) = 1, so 9 is here.
		

Crossrefs

Programs

  • C
    a(n) {return mu(phi(n))==1 ? n : ;}
    
  • Maple
    filter:= n -> not isprime(n) and numtheory:-mobius(numtheory:-phi(n))=1:
    select(filter, [$1..10000]); # Robert Israel, Aug 01 2014
  • Mathematica
    Select[Range[3200],
    And[MoebiusMu[EulerPhi[#]] == 1,
       Not[PrimeQ[#]]] &] (* Michael De Vlieger, Aug 06 2014 *)
  • PARI
    for(n=1,10^4,if(moebius(eulerphi(n))==1,print1(n,", "))) \\ Derek Orr, Aug 01 2014
    
  • Python
    from sympy import totient,factorint,primefactors,isprime
    [n for n in range(1,10**5) if n == 1 or (not isprime(n) and max(factorint(totient(n)).values()) < 2 and (-1)**len(primefactors(totient(n))) == 1)] # Chai Wah Wu, Aug 06 2014

A244723 Nonprimes n such that, mu(n) = mu(phi(n)).

Original entry on oeis.org

1, 8, 12, 14, 16, 20, 22, 24, 25, 27, 28, 32, 36, 40, 44, 45, 46, 48, 50, 52, 54, 56, 60, 63, 64, 68, 72, 75, 76, 80, 81, 84, 88, 90, 92, 94, 96, 99, 100, 104, 108, 112, 116, 117, 118, 120, 124, 125, 126, 128, 132, 135, 136, 140, 144, 147, 148, 150, 152, 153, 156, 160, 162, 164, 166
Offset: 1

Views

Author

Torlach Rush, Jul 04 2014

Keywords

Comments

Odd terms, with the exception of 1, are not squarefree. - Torlach Rush, Jul 22 2014.
2*p, where p is an odd prime, is in the sequence iff p is in A088179. - Robert Israel, Jul 31 2014

Crossrefs

Programs

  • Maple
    filter:= proc(n) uses numtheory;  not(isprime(n)) and mobius(n) = mobius(phi(n)) end proc;
    select(filter, [$1..1000]); # Robert Israel, Jul 31 2014
  • Mathematica
    searchMax = 200; Complement[Select[Range[searchMax], MoebiusMu[#] == MoebiusMu[EulerPhi[#]] &], Prime[Range[PrimePi[searchMax]]]] (* Alonso del Arte, Jul 05 2014 *)
    Select[Range[searchMax], !PrimeQ[#] && MoebiusMu[#] == MoebiusMu[EulerPhi[#]]& ] (* Zak Seidov, Jul 31 2014 *)
  • PARI
    for(n=1,10^3,if(!isprime(n)&&moebius(eulerphi(n))==moebius(n),print1(n,", "))) \\ Derek Orr, Jul 30 2014

A267067 Primes p such that mu(p-2) = 1; that is, p-2 is squarefree and has an even number of prime factors, where mu is the Moebius function (A008683).

Original entry on oeis.org

3, 17, 23, 37, 41, 53, 59, 67, 71, 79, 89, 97, 113, 131, 157, 163, 179, 211, 223, 239, 251, 269, 293, 307, 311, 331, 337, 367, 373, 379, 383, 397, 409, 419, 439, 449, 487, 491, 499, 503, 521, 547, 593, 599, 613, 631, 673, 683, 691, 701, 709, 719, 733, 739
Offset: 1

Views

Author

Vincenzo Librandi, Jan 10 2016

Keywords

Comments

From Robert Israel, Jan 10 2016: (Start)
Includes all members of A063638 except 11.
The first terms not in A063638 are 3 and 1367. (End)

Crossrefs

Programs

  • Magma
    [n: n in [3..1000] | IsPrime(n) and MoebiusMu(n-2) eq 1];
    
  • Maple
    select(p -> isprime(p) and numtheory:-mobius(p-2)=1, [seq(i,i=3..1000,2)]); # Robert Israel, Jan 10 2016
  • Mathematica
    Select[Prime[Range[200]], MoebiusMu[# - 2] == 1 &]
  • PARI
    isok(p) = isprime(p) && (p>2) && (moebius(p-2)==1); \\ Michel Marcus, Mar 08 2023

A322665 Partial sums of A089451.

Original entry on oeis.org

1, 0, 0, 1, 2, 2, 2, 2, 3, 3, 2, 2, 2, 1, 2, 2, 3, 3, 2, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, -1, -1, -1, -1, -1, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, -1, -1, -1, 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 2, 2, 2, 2, 1, 1, 0, 0, -1
Offset: 1

Views

Author

Jianing Song, Dec 22 2018

Keywords

Comments

a(n) is the number of primes p among the first n ones such that the sum of primitive roots is congruent to +1 modulo p minus the number of primes p among the first n ones such that the sum of primitive roots is congruent to -1 modulo p. Here, the prime number 2 is counted in the minuends but not in the subtrahends.
Although there are more positive terms among the first few ones, there are 5887 negative ones among the first 10000 terms, along with 237 zeros.
The largest terms among the first 10000 ones are a(n) = 41 for n in {8389, 8749, 8750, 8751, 8752, 8753}, and the smallest being a(n) = -41 for n in {4037, 4038, 4039, 4040, 4041, 4043, 4044, 4045, 4063, 4064, 4065, 4081, 4082, 4083, 4086, 4098, 4099, 4100}. What is the rate of growth for sup_{i=1..n} a(i) and inf_{i=1..n} a(i)?

Examples

			prime(11) = 31, mu(1) = mu(6) = mu(10) = mu(22) = +1, mu(2) = mu(30) = -1, so a(11) = 4 - 2 = 2.
prime(22) = 79, mu(1) = mu(6) = mu(10) = mu(22) = mu(46) = mu(58) = +1, mu(2) = mu(30) = mu(42) = mu(66) = mu(70) = mu(78) = -1, so a(22) = 6 - 6 = 0.
		

Crossrefs

Programs

  • PARI
    a(n) = sum(i=1, n, moebius(prime(i)-1))
Showing 1-8 of 8 results.