A337572 Numbers having at least one 4 in their representation in base 5.
4, 9, 14, 19, 20, 21, 22, 23, 24, 29, 34, 39, 44, 45, 46, 47, 48, 49, 54, 59, 64, 69, 70, 71, 72, 73, 74, 79, 84, 89, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 129, 134
Offset: 1
Examples
75 is not in the sequence since it is 300_5 in base 5, but 74 is in the sequence since it is 244_5 in base 5.
Links
- François Marques, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Maple
seq(`if`(numboccur(4, convert(n, base, 5))>0, n, NULL), n=0..100);
-
Mathematica
Select[ Range[ 0, 100 ], (Count[ IntegerDigits[ #, 5 ], 4 ]>0)& ]
-
PARI
isok(m) = #select(x->(x==4), digits(m, 5)) >= 1; \\ Michel Marcus, Sep 20 2020
-
Python
from gmpy2 import digits def A337572(n): def f(x): l = (s:=digits(x,5)).find('4') if l >= 0: s = s[:l]+'3'*(len(s)-l) return n+int(s,4) m, k = n, f(n) while m != k: m, k = k, f(k) return m # Chai Wah Wu, Dec 04 2024
Comments