A257219 Numbers that have at least one divisor containing the digit 2 in base 10.
2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 63, 64, 66, 68, 69, 70, 72, 74, 75, 76, 78, 80, 81, 82, 84, 86, 87, 88, 90, 92, 94, 96, 98, 100, 102, 104, 105, 106, 108
Offset: 1
Examples
18 is in sequence because the list of divisors of 18: (1, 2, 3, 6, 9, 18) contains digit 2. In the same way all even numbers have the divisor 2 and thus are in this sequence; numbers N in { 20,...,29, 120,...,129, 200,...,299 } have the digit 2 in N which is divisor of itself. - _M. F. Hasler_, Apr 22 2015
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Programs
-
Magma
[n: n in [1..1000] | [2] subset Setseq(Set(Sort(&cat[Intseq(d): d in Divisors(n)])))]
-
Mathematica
Select[Range@108, Part[Plus @@ DigitCount@ Divisors@ #, 2] > 0 &] (* Michael De Vlieger, Apr 20 2015 *)
-
PARI
is(n)=!bittest(n,0)||setsearch(Set(digits(n)),2)||fordiv(n,d,setsearch(Set(digits(d)),2)&&return(1)) \\ M. F. Hasler, Apr 22 2015
Formula
a(n) ~ n. - Charles R Greathouse IV, Apr 22 2015
Comments