login
A089389
Sum of the smallest and the largest nontrivial divisor of n or 0 if n is 1 or a prime.
1
0, 0, 0, 4, 0, 5, 0, 6, 6, 7, 0, 8, 0, 9, 8, 10, 0, 11, 0, 12, 10, 13, 0, 14, 10, 15, 12, 16, 0, 17, 0, 18, 14, 19, 12, 20, 0, 21, 16, 22, 0, 23, 0, 24, 18, 25, 0, 26, 14, 27, 20, 28, 0, 29, 16, 30, 22, 31, 0, 32, 0, 33, 24, 34, 18, 35, 0, 36, 26, 37, 0, 38, 0, 39, 28, 40, 18, 41, 0, 42
OFFSET
1,4
COMMENTS
The product of the smallest and the largest nontrivial divisor is n. a(2m) = m+2, m >1.
LINKS
FORMULA
a(1) = 0, for n > 1, if n is prime, a(n) = 0, otherwise a(n) = A020639(n) + A032742(n). - Antti Karttunen, Feb 25 2018
MATHEMATICA
Array[If[Or[# == 1, PrimeQ@ #], 0, #[[2]] + #[[-2]] &@ Divisors@ #] &, 80] (* Michael De Vlieger, Feb 25 2018 *)
PROG
(PARI)
A020639(n) = if(1==n, n, vecmin(factor(n)[, 1])); \\ From A020639.
A089389(n) = {my(spf=A020639(n)); if((1==n)||isprime(n), 0, spf+(n/spf)); }; \\ Antti Karttunen, Feb 25 2018
(Scheme) (define (A089389 n) (if (or (= 1 n) (= 1 (A010051 n))) 0 (+ (A020639 n) (A032742 n)))) ;; Antti Karttunen, Feb 25 2018
CROSSREFS
Sequence in context: A055242 A200295 A352167 * A046779 A356174 A339436
KEYWORD
easy,nonn
AUTHOR
Amarnath Murthy, Nov 10 2003
EXTENSIONS
More terms from David Wasserman, Sep 15 2005
STATUS
approved