A062671 Every divisor (except 1) contains the digit 5.
5, 25, 53, 59, 125, 151, 157, 251, 257, 265, 295, 353, 359, 457, 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, 625, 653, 659, 751, 755, 757, 785, 853, 857, 859, 953, 1051, 1151, 1153, 1255, 1259, 1285, 1325, 1451, 1453, 1459, 1475, 1511
Offset: 1
Examples
25 has divisors 1, 5 and 25, all of which (except 1) contain the digit 5.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Magma
[k:k in [2..1500]| forall{d:d in Set(Divisors(k)) diff {1}| 5 in Intseq(d)}]; // Marius A. Burtea, Nov 07 2019
-
Mathematica
fQ[n_, dgt_] := Union[ MemberQ[#, dgt] & /@ IntegerDigits@ Rest@ Divisors@ n][[1]]; Select[ Range[2, 1500], fQ[#, 5] &] (* Robert G. Wilson v, Jun 11 2014 *)
-
Python
from sympy import divisors def ok(n): return all('5' in str(d) for d in divisors(n)[1:]) print(list(filter(ok, range(2, 1512)))) # Michael S. Branicky, May 25 2021
Extensions
Offset corrected by Amiram Eldar, Nov 07 2019