login
A181840
Maximum of { k>0 | k<n and k is strongly prime to n }, or zero if this set is empty.
2
0, 1, 0, 0, 0, 3, 0, 5, 5, 7, 7, 9, 7, 11, 11, 13, 13, 15, 13, 17, 17, 19, 19, 21, 19, 23, 23, 25, 25, 27, 23, 29, 29, 31, 31, 33, 31, 35, 35, 37, 37, 39, 37, 41, 41, 43, 43, 45, 43, 47, 47, 49, 49, 51, 49, 53, 53, 55, 55, 57, 53, 59, 59, 61, 61, 63, 61, 65, 65, 67, 67, 69
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.
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
Sequence in context: A354836 A197690 A351692 * A198432 A102391 A038556
KEYWORD
nonn
AUTHOR
Peter Luschny, Nov 17 2010
STATUS
approved