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!)
A138223 a(n) = the nearest divisor of n to the number of positive divisors of n. In case of tie, round up. 4
1, 2, 3, 4, 1, 3, 1, 4, 3, 5, 1, 6, 1, 2, 5, 4, 1, 6, 1, 5, 3, 2, 1, 8, 5, 2, 3, 7, 1, 10, 1, 8, 3, 2, 5, 9, 1, 2, 3, 8, 1, 7, 1, 4, 5, 2, 1, 12, 1, 5, 3, 4, 1, 9, 5, 8, 3, 2, 1, 12, 1, 2, 7, 8, 5, 6, 1, 4, 3, 7, 1, 12, 1, 2, 5, 4, 7, 6, 1, 10, 3, 2, 1, 12, 5, 2, 3, 8, 1, 10, 7, 4, 3, 2, 5, 12, 1, 7, 9, 10, 1 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
EXAMPLE
There are four positive divisors of 15: (1,3,5,15). There are two divisors, 3 and 5, that are nearest 4. We take the larger divisor, 5 in this case, in case of a tie; so a(15) = 5.
MAPLE
A138223 := proc(n) if n = 1 then RETURN(1); fi; t := numtheory[tau](n) ; dvs := sort(convert(numtheory[divisors](n), list)) ; a := op(-1, dvs) ; for i from 2 to nops(dvs) do if abs(op(-i, dvs) - t) < abs(a-t) then a := op(-i, dvs) ; fi; od: a ; end: seq(A138223(n), n=1..120) ; # R. J. Mathar, Jul 20 2009
MATHEMATICA
a[n_] := With[{d = Divisors[n]}, Nearest[d, Length[d]][[-1]]];
Table[a[n], {n, 1, 101}] (* Jean-François Alcover, Oct 18 2023 *)
CROSSREFS
Sequence in context: A337210 A361258 A141063 * A194742 A159798 A294236
KEYWORD
nonn
AUTHOR
Leroy Quet, Mar 06 2008
EXTENSIONS
Extended beyond a(15) by R. J. Mathar, Jul 20 2009
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 25 12:33 EDT 2024. Contains 371969 sequences. (Running on oeis4.)