login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A289144 The difference between the second divisor of n and the penultimate divisor of n. 1
1, 2, 0, 4, -1, 6, -2, 0, -3, 10, -4, 12, -5, -2, -6, 16, -7, 18, -8, -4, -9, 22, -10, 0, -11, -6, -12, 28, -13, 30, -14, -8, -15, -2, -16, 36, -17, -10, -18, 40, -19, 42, -20, -12, -21, 46, -22, 0, -23, -14, -24, 52, -25, -6, -26, -16, -27, 58, -28 (list; graph; refs; listen; history; text; internal format)
OFFSET
2,2
COMMENTS
a(1) is not defined since 1 has fewer than 2 divisors.
n is a prime number if and only if a(n) > 0.
n is the square of a prime number if and only if a(n) = 0.
n is composite and is not the square of a prime number if and only if a(n) < 0.
If n is prime, then a(n) = n - 1,
else, if 2 divides n, then a(n) = 2 - (n / 2),
else, if 3 divides n, then a(n) = 3 - (n / 3),
else, if 5 divides n, then a(n) = 5 - (n / 5),
and so on, with infinitely many statements of the
"else, if p divides n, then a(n) = p - (n / p)," kind, over all p, prime numbers.
LINKS
EXAMPLE
The divisors of 7 are { 1, 7 }. Then a(7) = 7 - 1 = 6.
The divisors of 25 are { 1, 5, 25 }. Then a(25) = 5 - 5 = 0.
The divisors of 221 are { 1, 13, 17, 221 }. Then a(221) = 13 - 17 = -4.
PROG
(PARI) a(n)={my(T=divisors(n)); T[2]-T[#T-1]}
CROSSREFS
Cf. A027750.
Sequence in context: A369657 A338824 A056737 * A350576 A008797 A239004
KEYWORD
sign
AUTHOR
Luc Rousseau, Jun 26 2017
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 16 12:05 EDT 2024. Contains 371711 sequences. (Running on oeis4.)