A058185 Numbers (written in decimal) which appear the same when written in base 5 and base 10/2.
0, 1, 2, 3, 4, 10, 11, 12, 13, 14, 20, 21, 22, 23, 24, 50, 51, 52, 53, 54, 60, 61, 62, 63, 64, 70, 71, 72, 73, 74, 100, 101, 102, 103, 104, 110, 111, 112, 113, 114, 120, 121, 122, 123, 124, 250, 251, 252, 253, 254, 260, 261, 262, 263, 264, 270, 271, 272, 273, 274
Offset: 1
Examples
10 is a term since it is written as 20 both in base 5 and base 10/2. 40 it not a term since it is written as 130 in base 5 and 80 in base 10/2.
Links
Programs
-
Mathematica
s[n_] := s[n] = If[n == 0, 0, 10 * s[2 * Floor[n/10]] + Mod[n, 10]]; q[k_] := s[k] == FromDigits[IntegerDigits[k, 5]]; Select[Range[0, 300], q] (* Amiram Eldar, Aug 02 2025 *)
-
PARI
s(n) = if(n == 0, 0, 10 * s(n\10 * 2) + n % 10); isok(k) = s(k) == fromdigits(digits(k, 5)); \\ Amiram Eldar, Aug 02 2025
Extensions
Offset corrected by Amiram Eldar, Aug 02 2025
Comments