A258409 Greatest common divisor of all (d-1)'s, where the d's are the positive divisors of n.
1, 2, 1, 4, 1, 6, 1, 2, 1, 10, 1, 12, 1, 2, 1, 16, 1, 18, 1, 2, 1, 22, 1, 4, 1, 2, 1, 28, 1, 30, 1, 2, 1, 2, 1, 36, 1, 2, 1, 40, 1, 42, 1, 2, 1, 46, 1, 6, 1, 2, 1, 52, 1, 2, 1, 2, 1, 58, 1, 60, 1, 2, 1, 4, 1, 66, 1, 2, 1, 70, 1, 72, 1, 2, 1, 2, 1, 78, 1
Offset: 2
Keywords
Examples
65 has divisors 1, 5, 13, and 65, hence a(65) = gcd(1-1,5-1,13-1,65-1) = gcd(0,4,12,64) = 4.
Links
- Ivan Neretin, Table of n, a(n) for n = 2..10000
Crossrefs
Programs
-
Haskell
a258409 n = foldl1 gcd $ map (subtract 1) $ tail $ a027750_row' n -- Reinhard Zumkeller, Jun 25 2015
-
Maple
f:= n -> igcd(op(map(`-`,numtheory:-factorset(n),-1))): map(f, [$2..100]); # Robert Israel, Sep 14 2016
-
Mathematica
Table[GCD @@ (Divisors[n] - 1), {n, 2, 100}]
-
PARI
a(n) = my(g=0); fordiv(n, d, g = gcd(g, d-1)); g; \\ Michel Marcus, May 29 2015
-
PARI
a(n) = gcd(apply(x->x-1, divisors(n))); \\ Michel Marcus, Nov 10 2015
-
PARI
a(n)=if(n%2==0, return(1)); if(n%3==0, return(2)); if(n%5==0 && n%4 != 1, return(2)); gcd(apply(p->p-1, factor(n)[,1])) \\ Charles R Greathouse IV, Sep 19 2016
Comments