OFFSET
1,8
COMMENTS
(Largest prime divisor) modulo (smallest prime divisor) of n-th composite number.
EXAMPLE
a(1) = 0 = 2 mod 2;
a(2) = 1 = 3 mod 2;
a(3) = 0 = 2 mod 2;
a(4) = 0 = 3 mod 3;
a(5) = 1 = 5 mod 2.
MAPLE
A002808 := proc(n) option remember; local a; if n = 1 then 4; else for a from procname(n-1)+1 do if not isprime(a) then RETURN(a) : fi; od: fi; end:
A006530 := proc(n) local u: if n=1 then 1 else u:= numtheory[factorset](n): max(seq(u[j], j=1..nops(u))) end if end:
A020639 := proc(n) local u: if n=1 then 1 else u:= numtheory[factorset](n): min(seq(u[j], j=1..nops(u))) end if end:
A161849 := proc(n) A052369(n) mod A056608(n) ; end: seq(A161849(n), n=1..120) ; # R. J. Mathar, Jun 23 2009
MATHEMATICA
Composite[n_] := FixedPoint[n + PrimePi[#] + 1&, n + PrimePi[n] + 1];
a[n_] := With[{f = FactorInteger[Composite[n]]}, f[[-1, 1]]~Mod~f[[1, 1]]];
Table[a[n], {n, 1, 105}] (* Jean-François Alcover, Oct 15 2023 *)
PROG
(Magma) [ D[ #D] mod D[1]: n in [2..140] | not IsPrime(n) where D is PrimeDivisors(n) ]; // Klaus Brockhaus, Jun 24 2009
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Jun 20 2009
EXTENSIONS
a(102) corrected by R. J. Mathar, Jun 23 2009
STATUS
approved