%I #22 Nov 16 2019 10:29:55
%S 1,3,7,9,13,21,31,37,43,49,63,67,73,79,93,111,127,129,151,163,169,193,
%T 201,211,219,223,237,241,259,283,307,331,349,367,409,421,433,463,487,
%U 489,511,541,553,559,577,579,601,613,619,631,643,673,723,727,739,769
%N Numbers k such that all divisors of k are lucky numbers.
%H Amiram Eldar, <a href="/A043772/b043772.txt">Table of n, a(n) for n = 1..10000</a>
%e 21 is included because its (positive) divisors, i.e., 1, 3, 7 and 21, are all lucky numbers.
%p N:= 10^3: # to get all terms <= N
%p L:= [seq(2*i+1, i=0..floor((N1)/2))]:
%p for n from 2 while n < nops(L) do
%p r:= L[n];
%p L:= subsop(seq(r*i=NULL, i=1..nops(L)/r), L);
%p od:
%p LS:= convert(L,set):
%p select(t > numtheory:divisors(t) subset LS, L); # _Robert Israel_, Jul 20 2015
%t 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 *)
%Y Cf. A000959.
%Y Cf. A118643 (subset).
%K easy,nonn
%O 1,2
%A _Naohiro Nomoto_, Oct 08 2000
