A337250 Numbers having at least one 3 in their representation in base 4.
3, 7, 11, 12, 13, 14, 15, 19, 23, 27, 28, 29, 30, 31, 35, 39, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 67, 71, 75, 76, 77, 78, 79, 83, 87, 91, 92, 93, 94, 95, 99, 103, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119
Offset: 1
Examples
18 is not in the sequence since it is 102_4 in base 4, but 19 is in the sequence since it is 103_4 in base 4.
Links
- François Marques, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Maple
seq(`if`(numboccur(3, convert(n, base, 4))>0, n, NULL), n=0..100);
-
Mathematica
Select[ Range[ 0, 100 ], (Count[ IntegerDigits[ #, 4 ], 3 ]>0)& ]
-
PARI
isok(m) = #select(x->(x==3), digits(m, 4)) >= 1; \\ Michel Marcus, Sep 20 2020
-
Python
from gmpy2 import digits def A337250(n): def f(x): l = (s:=digits(x,4)).find('3') if l >= 0: s = s[:l]+'2'*(len(s)-l) return n+int(s,3) m, k = n, f(n) while m != k: m, k = k, f(k) return m # Chai Wah Wu, Dec 04 2024
Comments