OFFSET
0,6
COMMENTS
k is strongly prime to n iff k is relatively prime to n and k does not divide n-1.
Editor's note: It seems that 1 is strongly prime to 1 by convention.
LINKS
Peter Luschny, Strong coprimality.
EXAMPLE
a(11) = max{3, 4, 6, 7, 8, 9} = 9.
MAPLE
with(numtheory):
Primes := n -> select(k->isprime(k), {$1..n}):
StrongCoprimes := n -> select(k->igcd(k, n)=1, {$1..n}) minus divisors(n-1):
A181840 := proc(n) max(op(StrongCoprimes(n))); subs(infinity=0, %) end:
MATHEMATICA
a[n_] := Max[ Select[ Range[n-1], CoprimeQ[#, n] && ! Divisible[n-1, #] &]] /. -Infinity -> 0; a[1] = 1; Table[a[n], {n, 0, 71}] (* Jean-François Alcover, Jun 27 2013 *)
PROG
(PARI) a(n)={ forstep(k=n-2, 2, -1, gcd(k, n)==1 & (n-1)%k & return(k)); n==1 } \\ M. F. Hasler, Nov 17 2010
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Nov 17 2010
STATUS
approved