A004725 Delete all 6's from the sequence of nonnegative integers.
0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1, 17, 18, 19, 20, 21, 22, 23, 24, 25, 2, 27, 28, 29, 30, 31, 32, 33, 34, 35, 3, 37, 38, 39, 40, 41, 42, 43, 44, 45, 4, 47, 48, 49, 50, 51, 52, 53, 54, 55, 5, 57, 58, 59, 0, 1, 2, 3, 4, 5, 7, 8, 9, 70, 71, 72, 73, 74, 75, 7
Offset: 0
Programs
-
Mathematica
d6[n_]:=Module[{c=DeleteCases[IntegerDigits[n],6]},If[c=={},Nothing, FromDigits[ c]]]; Array[d6,80,0] (* Harvey P. Dale, Oct 09 2017 *)
-
Python
def A004725(n): l = len(str(n)) m = 2*(10**l-1)//3 k = n + l - int(n+l < m) return 5 if k == m else int(str(k).replace('6','')) # Chai Wah Wu, Apr 20 2021