OFFSET
1,2
COMMENTS
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..10000.
FORMULA
a(n) = 2 iff n is prime.
EXAMPLE
a(10) = 7 because there are 7 integers, 1, 2, 3, 5, 7, 9 and 10, whose divisors meet the criterion for n = 10 (4 does not meet this criterion in that 4's 3rd smallest divisor is 4 and 10's third smallest divisor is 5; similarly 6 and 8 do not meet the criterion).
MATHEMATICA
f[n_] := Block[{c = 1, d = Divisors@ n, k = DivisorSigma[0, n], m = 1}, While[m != n, If[ Min[ PadRight[ Divisors@ m, k, n] - d] > -1, c++ ]; m++ ]; c]; Array[f, 80] (* Robert G. Wilson v *)
PROG
(PARI) A137849(n)={ local( d=divisors(n), d2 ); sum( m=1, n, d2=divisors(m); vecmin( vector(min(#d, #d2), i, d2[i]-d[i]))>=0 )} \\ - M. F. Hasler, May 01 2008
CROSSREFS
KEYWORD
nonn
AUTHOR
J. Lowell, Apr 29 2008
EXTENSIONS
Edited and extended by M. F. Hasler and Ray Chandler, May 01 2008
STATUS
approved