OFFSET
1,1
MATHEMATICA
Do[ If[ !PrimeQ[ n ] && Mod[ n, 7 ] != 0 && StringPosition[ ToString[ FromDigits[ IntegerDigits[ n, 7 ] ] ], ToString[ FromDigits[ IntegerDigits[ Divisors[ n ][ [ -2 ] ], 7 ] ] ] ] != {}, Print[ n ] ], {n, 3, 10^6} ]
Select[Range[10^6], CompositeQ[#]&&Mod[#, 7]!=0&&SequenceCount[ IntegerDigits[ #, 7], IntegerDigits[Divisors[#][[-2]], 7]]>0&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 15 2020 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Robert G. Wilson v, Aug 27 2001
STATUS
approved