OFFSET
1,4
COMMENTS
a(2n-1) = 1 for all positive integers n. 2 has no isolated divisors. a(2) is 0 only as a placeholder.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..16384
Antti Karttunen, Data supplement: n, a(n) computed for n = 1..65537
EXAMPLE
a(18)=6 because the isolated divisors of 18 are 6,9 and 18.
MAPLE
with(numtheory): a:=proc(n) local div, ISO, i: div:=divisors(n): ISO:={}: for i to tau(n) do if member(div[i]-1, div)=false and member(div[i]+1, div) = false then ISO := `union`(ISO, {div[i]}) end if end do end proc: 1, 0, seq(a(j)[1], j=3..80); # Emeric Deutsch, Oct 16 2007
A133828 := proc(n) local divs, k, i ; divs := sort(convert(numtheory[divisors](n), list)) ; for i from 1 to nops(divs) do k := op(i, divs) ; if not k-1 in divs and not k+1 in divs then RETURN(k) ; fi ; od: RETURN(0) ; end: seq(A133828(n), n=1..100) ; # R. J. Mathar, Oct 19 2007
MATHEMATICA
a[n_] := If[OddQ[n], 1, For[d = 2, d <= n, d++, If[Divisible[n, d] && !Divisible[n, d-1] && !Divisible[n, d+1], Return[d]]]] /. Null -> 0;
Table[a[n], {n, 1, 100}] (* Jean-François Alcover, Jul 20 2024 *)
PROG
(PARI) A133828(n) = if(n%2, 1, fordiv(n, d, if((d>1)&&(n%(d-1))&&(n%(d+1)), return(d))); (0)); \\ Antti Karttunen, Apr 01 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Sep 25 2007
EXTENSIONS
More terms from Emeric Deutsch and R. J. Mathar, Oct 16 2007
STATUS
approved