A338090 Numbers having at least one 8 in their representation in base 9.
8, 17, 26, 35, 44, 53, 62, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 89, 98, 107, 116, 125, 134, 143, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 170, 179, 188, 197, 206, 215, 224, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 251, 260, 269, 278, 287, 296, 305, 314, 315
Offset: 1
Examples
70 is not in the sequence since it is 77_9 in base 9, but 76 is in the sequence since it is 84_9 in base 9.
Links
- François Marques, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Maple
seq(`if`(numboccur(8, convert(n, base, 9))>0, n, NULL), n=0..100);
-
Mathematica
Select[ Range[ 0, 100 ], (Count[ IntegerDigits[ #, 9 ], 8 ]>0)& ]
-
PARI
isok(m) = #select(x->(x==8), digits(m, 9)) >= 1;
-
Python
from gmpy2 import digits def A338090(n): def f(x): l = (s:=digits(x,9)).find('8') if l >= 0: s = s[:l]+'7'*(len(s)-l) return n+int(s,8) m, k = n, f(n) while m != k: m, k = k, f(k) return m # Chai Wah Wu, Dec 04 2024
Comments