A031954 Numbers with exactly two distinct base-9 digits.
9, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28, 29, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 51, 52, 53, 54, 55, 56, 57, 58, 59, 61, 62, 63, 64, 65, 66, 67, 68, 69, 71, 72, 73, 74, 75, 76, 77, 78, 79, 81, 82, 90, 92, 93, 94, 95, 96, 97, 98, 100, 101, 109, 111
Offset: 1
Crossrefs
Cf. A007095.
Programs
-
Maple
isA031954 := proc(n) local dgs,p,s ; dgs := convert(convert(n,base,9),set) ; if nops(dgs) = 2 then true ; else false ; end if ; end proc: A031954 := proc(n) option remember ; if n =1 then 9 ; else for a from procname(n-1)+1 do if isA031954(a) then return a; end if; end do: end if; end proc: seq(A031954(n),n=1..80) ; # R. J. Mathar, Jan 24 2023
-
PARI
a(n)=n+8+(n+7)\9 \\ Charles R Greathouse IV, Mar 10 2021