A257226 Numbers that have at least one divisor containing the digit 9 in base 10.
9, 18, 19, 27, 29, 36, 38, 39, 45, 49, 54, 57, 58, 59, 63, 69, 72, 76, 78, 79, 81, 87, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 108, 109, 114, 116, 117, 118, 119, 126, 129, 133, 135, 138, 139, 144, 145, 147, 149, 152, 153, 156, 158, 159, 162, 169, 171, 174
Offset: 1
Examples
18 is in sequence because the list of divisors of 18: (1, 2, 3, 6, 9, 18) contains digit 9.
Crossrefs
Programs
-
Magma
[n: n in [1..1000] | [9] subset Setseq(Set(Sort(&cat[Intseq(d): d in Divisors(n)])))];
-
Mathematica
Select[Range@108, Part[Plus @@ DigitCount@ Divisors@ #, 9] > 0 &] (* after Michael De Vlieger *)
-
PARI
is(n)=fordiv(n, d, if(setsearch(Set(digits(d)), 9), return(1))); 0 \\ after Charles R Greathouse IV
-
Python
from itertools import count, islice from sympy import divisors def A257226_gen(): return filter(lambda n:any('9' in str(d) for d in divisors(n,generator=True)),count(1)) A257226_list = list(islice(A257226_gen(),20)) # Chai Wah Wu, Dec 27 2021
Formula
a(n) ~ n.
Comments