OFFSET
1,2
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
21 is included because its (positive) divisors, i.e., 1, 3, 7 and 21, are all lucky numbers.
MAPLE
N:= 10^3: # to get all terms <= N
L:= [seq(2*i+1, i=0..floor((N-1)/2))]:
for n from 2 while n < nops(L) do
r:= L[n];
L:= subsop(seq(r*i=NULL, i=1..nops(L)/r), L);
od:
LS:= convert(L, set):
select(t -> numtheory:-divisors(t) subset LS, L); # Robert Israel, Jul 20 2015
MATHEMATICA
lst = Range[1, 776, 2]; i = 2; While[ i <= (len = Length@lst) && (k = lst[[i]]) <= len, lst = Drop[lst, {k, len, k}]; i++ ]; fQ[n_] := Block[{d = Rest@Divisors@n, k = 1, lmt = DivisorSigma[0, n]}, While[k < lmt && MemberQ[lst, d[[k]]], k++ ]; k == lmt]; Select[lst, fQ@# &] (* Robert G. Wilson v, May 12 2006 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Naohiro Nomoto, Oct 08 2000
STATUS
approved