A014891 n is equal to the number of 2's in all numbers <= n written in base 6.
3878, 3879, 3880, 3881, 3882, 3883, 3888, 46656, 50534, 50535, 50536, 50537, 50538, 50539, 50544
Offset: 1
Crossrefs
Cf. A014778.
Programs
-
Mathematica
Module[{nn=51000,d2},d2=Accumulate[DigitCount[#,6,2]&/@Range[nn]];Select[ Thread[ {Range[ nn],d2}],#[[1]]==#[[2]]&]][[;;,1]] (* Harvey P. Dale, Sep 04 2024 *)
Extensions
List proved complete by Hugo van der Sanden (cf. A014886).