A074749 Smallest difference between consecutive anti-divisors of n (ordered by size).
0, 0, 0, 0, 1, 0, 1, 2, 4, 1, 1, 3, 1, 1, 4, 8, 1, 1, 1, 5, 4, 1, 1, 9, 1, 1, 1, 2, 1, 8, 1, 2, 1, 1, 1, 16, 1, 1, 1, 6, 1, 1, 1, 5, 1, 1, 1, 13, 1, 1, 4, 1, 1, 8, 1, 13, 1, 1, 1, 1, 1, 1, 1, 40, 1, 3, 1, 1, 4, 1, 1, 2, 1, 1, 4, 1, 1, 1, 1, 4, 1, 1, 1, 5, 1, 1
Offset: 1
Keywords
Examples
For n=13, anti-divisors={2,3,5,9}; differences={1,2,4}; a(13) = smallest difference = 1.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..20000
Programs
-
Mathematica
min[s_] := If[Length[s] > 0, Min[s], 0]; min /@ Differences /@ Table[Select[Range[2, n - 1], Abs[Mod[n, #] - #/2] < 1 &], {n, 100}] (* Amiram Eldar, Feb 03 2020 after Harvey P. Dale at A066272 *)
-
PARI
A074749(n) = { my(pad=0,md=0); for(k=2,n,if((n%k) && (!((2*n)%k) || !((2*n-1)%k) || !((2*n+1)%k)), if(pad, md=if(md,min(k-pad,md),k-pad)); pad = k)); (md); }; \\ Antti Karttunen, Jan 15 2025
Extensions
More terms from Amiram Eldar, Feb 03 2020
Comments