A337141 Numbers having at least one 6 in their representation in base 7.
6, 13, 20, 27, 34, 41, 42, 43, 44, 45, 46, 47, 48, 55, 62, 69, 76, 83, 90, 91, 92, 93, 94, 95, 96, 97, 104, 111, 118, 125, 132, 139, 140, 141, 142, 143, 144, 145, 146, 153, 160, 167, 174, 181, 188, 189, 190, 191, 192, 193, 194, 195, 202, 209, 216, 223, 230, 237, 238, 239, 240
Offset: 1
Examples
33 is not in the sequence since it is 45_7 in base 7, but 34 is in the sequence since it is 46_7 in base 7.
Links
- François Marques, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Maple
seq(`if`(numboccur(6, convert(n, base, 7))>0, n, NULL), n=0..100);
-
Mathematica
Select[ Range[ 0, 100 ], (Count[ IntegerDigits[ #, 7 ], 6 ]>0)& ] Select[Range[300],DigitCount[#,7,6]>0&] (* Harvey P. Dale, Dec 23 2020 *)
-
PARI
isok(m) = #select(x->(x==6), digits(m, 7)) >= 1;
-
Python
from gmpy2 import digits def A337141(n): def f(x): l = (s:=digits(x,7)).find('6') if l >= 0: s = s[:l]+'5'*(len(s)-l) return n+int(s,6) m, k = n, f(n) while m != k: m, k = k, f(k) return m # Chai Wah Wu, Dec 04 2024
Comments