Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #50 Sep 08 2022 08:44:53
%S 2,3,7,11,23,31,43,47,59,67,71,79,83,103,107,131,139,167,179,191,211,
%T 223,227,239,263,283,311,331,347,359,367,383,419,431,439,443,463,467,
%U 479,499,503,547,563,571,587,599,607,619,643,647,659,683,691,719,743
%N Primes p such that p-1 is squarefree.
%C An equivalent definition: numbers n such that phi(n) is equal to the squarefree kernel of n-1.
%C Minimal value of first differences (between odd terms) is 4. Primes p such that both p and p + 4 are terms are: 3, 7, 43, 67, 79, 103, 223, 439, 463, 499, 643, 823, ... - _Zak Seidov_, Apr 16 2013
%C The density of this set in A000040 is Artin's constant A = A005596 = 37.39...%, see Mirsky. - _Charles R Greathouse IV_, Oct 26 2015
%H N. J. A. Sloane, <a href="/A039787/b039787.txt">Table of n, a(n) for n = 1..25000</a>, Oct 25 2015 (extending earlier b-file of _Zak Seidov_)
%H Theodor Estermann, <a href="http://eudml.org/doc/159528">Einige Sätze über quadratfreie Zahlen</a>, Math. Ann. 105:1 (1931), pp. 653-662.
%H Leon Mirsky, <a href="http://www.jstor.org/stable/2305811">The number of representations of an integer as the sum of a prime and a k-free integer</a>, American Mathematial Monthly 56:1 (1949), pp. 17-19.
%e phi(43)=42, 42=2^1*3^1*7^1, 2*3*7=42.
%e p=223 is here because p-1=222=2*3*37
%p isA039787 := proc(n)
%p if isprime(n) then
%p numtheory[issqrfree](n-1) ;
%p else
%p false;
%p end if;
%p end proc:
%p for n from 2 to 100 do
%p if isA039787(n) then
%p printf("%d,",n) ;
%p end if;
%p end do: # _R. J. Mathar_, Apr 17 2013
%p 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
%t Select[Prime[Range[132]],SquareFreeQ[#-1]&](* _Zak Seidov_, Aug 22 2012 *)
%o (Magma) [p: p in PrimesUpTo(780) | IsSquarefree(p-1)]; // _Bruno Berselli_, Mar 03 2011
%o (PARI) is(n)=isprime(n) && issquarefree(n-1) \\ _Charles R Greathouse IV_, Jul 02 2013
%o (PARI) forprime(p=2, 1e3, if(issquarefree(p-1), print1(p", "))); \\ _Altug Alkan_, Oct 26 2015
%Y Cf. A000010, A007947, A049092 (complement).
%K nonn
%O 1,1
%A _Olivier Gérard_
%E More terms from _Labos Elemer_