A058186 Numbers (written in base 5) which appear the same when written in base 5 and base 10/2.
0, 1, 2, 3, 4, 20, 21, 22, 23, 24, 40, 41, 42, 43, 44, 200, 201, 202, 203, 204, 220, 221, 222, 223, 224, 240, 241, 242, 243, 244, 400, 401, 402, 403, 404, 420, 421, 422, 423, 424, 440, 441, 442, 443, 444, 2000, 2001, 2002, 2003, 2004, 2020, 2021, 2022, 2023
Offset: 1
Examples
20 (10 in decimal) is a term since it is written as 20 both in base 5 and base 10/2. 30 (15 in decimal) is not a term since it is written as 30 in base 5 and 25 in base 10/2.
Links
Programs
-
Mathematica
s[n_] := s[n] = If[n == 0, 0, 10*s[2*Floor[n/10]] + Mod[n, 10]]; f[n_] := FromDigits[IntegerDigits[n, 5]]; q[k_] := s[k] == f[k]; f /@ Select[Range[0, 300], q] (* Amiram Eldar, Aug 02 2025 *)
-
PARI
s(n) = if(n == 0, 0, 10 * s(n\10 * 2) + n % 10); f(n) = fromdigits(digits(n, 5)); list(lim) = apply(f, select(x -> s(x) == f(x), vector(lim+1, i, i-1))); \\ Amiram Eldar, Aug 02 2025
Formula
Extensions
Offset corrected by Amiram Eldar, Aug 02 2025
Comments