login
A062664
Composite and every divisor (except for 1) contains the digit 2.
18
254, 422, 482, 502, 526, 529, 542, 562, 842, 1042, 1642, 2042, 2246, 2258, 2402, 2426, 2434, 2446, 2458, 2462, 2474, 2498, 2518, 2554, 2558, 2566, 2578, 2582, 2594, 2642, 2654, 2846, 2854, 2858, 2921, 3242, 3254, 3442, 4022, 4126, 4162, 4222, 4226
OFFSET
1,1
COMMENTS
If k is in the sequence, then all composite divisors of k are in the sequence. - Robert Israel, Jul 11 2019
LINKS
EXAMPLE
254 has divisors 1, 2, 127 and 254, all of which except for 1 contain the digit 2.
MAPLE
filter:= proc(n) local D;
if isprime(n) then return false fi;
andmap(con2, numtheory:-divisors(n) minus {1})
end proc:
con2:= proc(n) option remember; member(2, convert(n, base, 10)) end proc:
select(filter, [$4..10000]); # Robert Israel, Jul 11 2019
MATHEMATICA
fQ[n_, dgt_] := Union[ MemberQ[#, dgt] & /@ IntegerDigits@ Rest@ Divisors@ n][[1]]; Select[ Range[2, 4230], !PrimeQ[#] && fQ[#, 2] &] (* Robert G. Wilson v, Jun 11 2014 *)
PROG
(Magma) [m:m in [2..4300] | not IsPrime(m) and #[d:d in Divisors(m)|2 in Intseq(d)] eq #Divisors(m)-1]; // Marius A. Burtea, Jul 11 2019
KEYWORD
base,easy,nonn
AUTHOR
Erich Friedman, Jul 04 2001
EXTENSIONS
Offset changed by Robert Israel, Jul 11 2019
STATUS
approved