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.

A039787 Primes p such that p-1 is squarefree.

Original entry on oeis.org

2, 3, 7, 11, 23, 31, 43, 47, 59, 67, 71, 79, 83, 103, 107, 131, 139, 167, 179, 191, 211, 223, 227, 239, 263, 283, 311, 331, 347, 359, 367, 383, 419, 431, 439, 443, 463, 467, 479, 499, 503, 547, 563, 571, 587, 599, 607, 619, 643, 647, 659, 683, 691, 719, 743
Offset: 1

Views

Author

Keywords

Comments

An equivalent definition: numbers n such that phi(n) is equal to the squarefree kernel of n-1.
Minimal value of first differences (between odd terms) is 4. - Zak Seidov, Apr 16 2013
The density of this set in A000040 is Artin's constant A = A005596 = 37.39...%, see Mirsky. - Charles R Greathouse IV, Oct 26 2015

Examples

			phi(43)=42, 42=2^1*3^1*7^1, 2*3*7=42.
p=223 is here because p-1=222=2*3*37
		

Crossrefs

Cf. A000010, A007947, A049092 (complement).

Programs

  • Magma
    [p: p in PrimesUpTo(780) | IsSquarefree(p-1)];  // Bruno Berselli, Mar 03 2011
    
  • Maple
    isA039787 := proc(n)
        if isprime(n) then
            numtheory[issqrfree](n-1) ;
        else
            false;
        end if;
    end proc:
    for n from 2 to 100 do
        if isA039787(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Apr 17 2013
    with(numtheory): lis:=[]; for n from 1 to 10000 do if issqrfree(ithprime(n)-1) then lis:=[op(lis), ithprime(n)]; fi; od: lis; # N. J. A. Sloane, Oct 25 2015
  • Mathematica
    Select[Prime[Range[132]],SquareFreeQ[#-1]&](* Zak Seidov, Aug 22 2012 *)
  • PARI
    is(n)=isprime(n) && issquarefree(n-1) \\ Charles R Greathouse IV, Jul 02 2013
    
  • PARI
    forprime(p=2, 1e3, if(issquarefree(p-1), print1(p", "))); \\ Altug Alkan, Oct 26 2015

Extensions

More terms from Labos Elemer

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

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

Original entry on oeis.org

2, 7, 11, 23, 47, 59, 83, 107, 167, 179, 211, 227, 263, 331, 347, 359, 383, 463, 467, 479, 503, 547, 563, 571, 587, 691, 719, 839, 859, 863, 887, 911, 967, 983, 1019, 1123, 1187, 1231, 1283, 1291, 1303, 1307, 1319, 1327, 1367, 1439, 1483, 1487, 1523, 1619, 1723
Offset: 1

Views

Author

N. J. A. Sloane and T. D. Noe, Nov 03 2003

Keywords

Comments

It is an unsolved problem to determine if this sequence has a positive density in the primes. - Pieter Moree (moree(AT)mpim-bonn.mpg.de), Nov 03 2003
Except for the initial element 2, this sequence seems to be exactly those primes the sum of whose nonquadratic, nonprimitive-root residues is congruent to -1(mod p). - Dimitri Papadopoulos, Jan 10 2016

Crossrefs

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

Programs

  • Magma
    [n: n in [2..2000] | IsPrime(n) and MoebiusMu(n-1) eq 1]; // Vincenzo Librandi, Jan 10 2016
  • Maple
    filter:= proc(p) isprime(p) and numtheory:-mobius(p-1) = 1 end proc:
    select(filter, [2,seq(i,i=3..2000,2)]); # Robert Israel, Feb 03 2016
  • Mathematica
    Select[Prime[Range[400]], MoebiusMu[ #-1]==1&]
  • PARI
    lista(nn) = forprime(p=2, nn, if (moebius(p-1) == 1, print1(p, ", "))); \\ Michel Marcus, Jan 10 2016
    
  • PARI
    list(lim)=my(v=List(),last); forsquarefree(k=1,lim\1, if(moebius(k)==1, last=k[1], if(k[2][,2]==[1]~ && k[1]-last==1, listput(v,k[1])))); Vec(v) \\ Charles R Greathouse IV, Jan 08 2018
    

A145199 Nonsquarefree numbers k such that k+1 is prime.

Original entry on oeis.org

4, 12, 16, 18, 28, 36, 40, 52, 60, 72, 88, 96, 100, 108, 112, 126, 136, 148, 150, 156, 162, 172, 180, 192, 196, 198, 228, 232, 240, 250, 256, 268, 270, 276, 280, 292, 306, 312, 316, 336, 348, 352, 372, 378, 388, 396, 400, 408, 420, 432, 448, 456, 460, 486, 490
Offset: 1

Views

Author

Giovanni Teofilatto, Oct 04 2008

Keywords

Examples

			4 is in the sequence because it is not squarefree and 5 is prime. - _Emeric Deutsch_, Oct 12 2008
		

Crossrefs

Programs

  • Magma
    [n: n in [1..5*10^2]| not IsSquarefree(n) and IsPrime(n+1)]; // Vincenzo Librandi, Dec 24 2015
    
  • Maple
    with(numtheory): a:=proc(n) if issqrfree(n)=false and isprime(n+1)=true then n else end if end proc: seq(a(n),n=1..600); # Emeric Deutsch, Oct 12 2008
    with(numtheory): a:=proc(k) if issqrfree(ithprime(k)-1)=false then ithprime(k)-1 else end if end proc: seq(a(k),k=1..110); # Emeric Deutsch, Oct 12 2008
  • Mathematica
    Select[Prime[Range[120]]-1, !SquareFreeQ[ # ]&] (* T. D. Noe, Oct 06 2008 *)
  • PARI
    is(n)=isprime(n+1) && !issquarefree(n) \\ Charles R Greathouse IV, Jun 13 2017

Formula

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

Extensions

Corrected and extended by T. D. Noe, Emeric Deutsch and R. J. Mathar, Oct 05 2008

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