A322936
Triangular array in which the n-th row lists the numbers strongly prime to n (in ascending order). For the empty rows n = 2, 3, 4 and 6 we set by convention 0.
Original entry on oeis.org
1, 0, 0, 0, 3, 0, 4, 5, 3, 5, 5, 7, 7, 3, 4, 6, 7, 8, 9, 5, 7, 5, 7, 8, 9, 10, 11, 3, 5, 9, 11, 4, 8, 11, 13, 7, 9, 11, 13, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 5, 7, 11, 13, 4, 5, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 3, 7, 9, 11, 13, 17, 8, 11, 13, 16, 17, 19
Offset: 1
The length of row n is A181830(n) = phi(n) - tau(n-1). The triangular array starts:
[1] {1}
[2] {}
[3] {}
[4] {}
[5] {3}
[6] {}
[7] {4, 5}
[8] {3, 5}
[9] {5, 7}
[11] {3, 4, 6, 7, 8, 9}
[12] {5, 7}
[10] {7}
[13] {5, 7, 8, 9, 10, 11}
[14] {3, 5, 9, 11}
[15] {4, 8, 11, 13}
[16] {7, 9, 11, 13}
[17] {3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15}
[18] {5, 7, 11, 13}
[19] {4, 5, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17}
[20] {3, 7, 9, 11, 13, 17}
-
StrongCoprimes := n -> select(k -> igcd(k, n)=1, {$1..n}) minus numtheory:-divisors(n-1):
A322936row:= proc(n) if n in {2, 3, 4, 6} then return 0 else op(StrongCoprimes(n)) fi end:
seq(A322936row(n), n=1..20);
-
Table[If[n == 1, {1}, Select[Range[2, n], And[GCD[#, n] == 1, Mod[n - 1, #] != 0] &] /. {} -> {0}], {n, 21}] // Flatten (* Michael De Vlieger, Apr 01 2019 *)
-
def primeto(n):
return [p for p in range(n) if gcd(p, n) == 1]
def strongly_primeto(n):
return [p for p in set(primeto(n)) - set((n-1).divisors())]
def A322936row(n):
if n == 1: return [1]
if n in [2, 3, 4, 6]: return [0]
return sorted(strongly_primeto(n))
for n in (1..21): print(A322936row(n))
A323215
Numbers k such that row k of A322936 is not empty and has only primes as members.
Original entry on oeis.org
5, 8, 9, 10, 12, 18, 24, 30
Offset: 1
-
filter:= proc(n) local k, found;
found:= false;
for k from 2 to n-2 do
if igcd(k,n)=1 and (n-1) mod k <> 0 then
found:= true;
if not isprime(k) then return false fi;
fi
od;
found
end proc:
select(filter, [$1..1000]); # Robert Israel, Apr 02 2019
-
Select[Range[10^3], With[{n = #}, AllTrue[Select[Range[2, n], And[GCD[#, n] == 1, Mod[n - 1, #] != 0] &] /. {} -> {0}, PrimeQ]] &] (* Michael De Vlieger, Apr 01 2019 *)
-
# uses[A322936row from A322936]
def isA323215(n):
return all(is_prime(p) for p in A322936row(n))
[n for n in (1..100) if isA323215(n)] # Peter Luschny, Apr 03 2019
A323214
Composite numbers k such that p^(k-1) == 1 (mod k) for every prime p strongly prime to k.
Original entry on oeis.org
4, 6, 561, 1105, 1729, 2465, 2821, 6601, 8911, 10585, 15841, 29341, 41041, 46657, 52633, 62745, 63973, 75361, 101101, 115921, 126217, 162401, 172081, 188461, 252601, 278545, 294409, 314821, 334153, 340561, 399001, 410041, 449065, 488881, 512461, 530881, 552721
Offset: 1
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).
- 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.
-
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
-
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))
Showing 1-3 of 3 results.
Comments