OFFSET
1,1
COMMENTS
LINKS
K. Bouallègue, O. Echi and R. G. E. Pinch, Korselt numbers and sets, International Journal of Number Theory, 6 (2010), 257-269.
A. Korselt, G. Tarry, I. Franel and G. Vacca, Problème chinois, L'intermédiaire des mathématiciens 6 (1899), 142-144.
Peter Luschny, Strong Coprimality
C. Pomerance, J. L. Selfridge, and S. S. Wagstaff, Jr., The pseudoprimes to 25*10^9, Math. Comp., 35 (1980), 1003-1026.
V. Šimerka, Zbytky z arithmetické posloupnosti, (On the remainders of an arithmetic progression), Časopis pro pěstování matematiky a fysiky. 14 (1885), 221-225.
L. Wang, The Korselt set of a power of a prime, International Journal of Number Theory, 14 (2018), 233-240.
EXAMPLE
2, 3 and 5 are not in this sequence because primes are not in this sequence.
4 and 6 are in this sequence because there are no primes strongly prime to 4 respectively 6.
For n = 1729 there are 1296 test cases using the definition of A002997 but only 264 test cases using the definition of a(n).
PROG
(Sage)
def is_strongCarmichael(n):
if n == 1 or is_prime(n): return False
for k in (1..n):
if is_prime(k) and not k.divides(n-1) and is_primeto(k, n):
if power_mod(k, n-1, n) != 1: return false
return true
def A323214_list(len):
return [n for n in (1..len) if is_strongCarmichael(n)]
print(A323214_list(600000))
(Julia)
using IntegerSequences
PrimesPrimeTo(n) = (p for p in Primes(n) if isPrimeTo(p, n))
function isStrongCarmichael(n)
if isComposite(n)
for k in PrimesPrimeTo(n)
if ! Divides(k, n-1)
if powermod(k, n-1, n) != 1
return false
end
end
end
return true
end
return false
end
L323214(len) = [n for n in 1:len if isStrongCarmichael(n)]
L323214(30000) |> println
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Apr 01 2019
STATUS
approved