A101257 Remainder when the least divisor of n greater than or equal to the square root of n (A033677(n)) is divided by the greatest divisor of n less than or equal to the square root of n (A033676(n)).
0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 2, 0, 0, 0, 0, 1, 1, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 0, 2, 1, 2, 0, 0, 1, 1, 3, 0, 1, 0, 3, 4, 1, 0, 2, 0, 0, 2, 1, 0, 3, 1, 1, 1, 1, 0, 4, 0, 1, 2, 0, 3, 5, 0, 1, 2, 3, 0, 1, 0, 1, 0, 3, 4, 1, 0, 2, 0, 1, 0, 5, 2, 1, 2, 3, 0, 1, 6, 3, 1, 1, 4, 4, 0, 0, 2, 0, 0, 5, 0, 5, 1
Offset: 1
Examples
a(6)=1 because the least divisor of 6 greater than sqrt(6) is 3, the greater divisor of 6 less than sqrt(6) is 2 and 3 mod 2 = 1
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
- Eric Weisstein's World of Mathematics, Point Lattice.
- Eric Weisstein's World of Mathematics, Divisor.
Programs
-
Mathematica
num[n_] := If[OddQ[DivisorSigma[0, n]], Sqrt[n], Divisors[n][[DivisorSigma[0, n]/2 + 1]]] den[n_] := If[OddQ[DivisorSigma[0, n]], Sqrt[n], Divisors[n][[DivisorSigma[0, n]/2]]] Table[Mod[num[n], den[n]], {n, 1, 128}]
-
PARI
A033676(n) = if(n<2, 1, my(d=divisors(n)); d[(length(d)+1)\2]); \\ From A033676 A033677(n) = (n/A033676(n)); A101257(n) = (A033677(n)%A033676(n)); \\ Antti Karttunen, Sep 23 2018
Extensions
Definition corrected by Antti Karttunen, Sep 23 2018
Comments