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!)
A347982 a(n) is the greatest k, 0 < k < n, such that tau(k) = tau(n), or -1 if no such k exists, where tau is A000005. 1
-1, -1, 2, -1, 3, -1, 5, 6, 4, 8, 7, -1, 11, 10, 14, -1, 13, 12, 17, 18, 15, 21, 19, -1, 9, 22, 26, 20, 23, 24, 29, 28, 27, 33, 34, -1, 31, 35, 38, 30, 37, 40, 41, 32, 44, 39, 43, -1, 25, 45, 46, 50, 47, 42, 51, 54, 55, 57, 53, -1, 59, 58, 52, -1, 62, 56, 61, 63, 65, 66, 67 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
COMMENTS
a(n) = -1 if and only if n is a term in A005179.
LINKS
EXAMPLE
a(1) = -1 because there is no positive number less than 1 having 1 divisor.
a(2) = -1 because 2 is the first prime.
a(3) = 2 because 2 is the greatest prime less than 3 and all primes have 2 divisors.
MATHEMATICA
a[1] = -1; a[n_] := Module[{k = n - 1, d = DivisorSigma[0, n]}, While[k > 0 && DivisorSigma[0, k] != d, k--]; If[k == 0, -1, k]]; Array[a, 100] (* Amiram Eldar, Sep 23 2021 *)
PROG
(PARI) a(n) = my(nd=numdiv(n)); forstep(k=n-1, 1, -1, if (numdiv(k)==nd, return(k))); return(-1); \\ Michel Marcus, Sep 22 2021
CROSSREFS
Sequence in context: A152063 A336617 A341865 * A321738 A022458 A084419
KEYWORD
sign
AUTHOR
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 30 16:06 EDT 2024. Contains 372136 sequences. (Running on oeis4.)