A293872 Numbers having '12' as a substring of their digits.
12, 112, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 212, 312, 412, 512, 612, 712, 812, 912, 1012, 1112, 1120, 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1200, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1217, 1218
Offset: 1
Links
Crossrefs
Programs
-
Maple
f:= proc(d) local i,x,y; sort(convert({seq(seq(seq(x+10^i*12+10^(i+2)*y, y=10^(d-3-i)..10^(d-2-i)-1),x=0..10^i-1),i=0..d-3), seq(12*10^(d-2)+x,x=0..10^(d-2)-1)},list)) end proc: seq(op(f(d)),d=2..4); # Robert Israel, Nov 20 2017
-
Mathematica
Select[Range@ 1220, SequenceCount[IntegerDigits[#], {1, 2}] > 0 &] (* Michael De Vlieger, Nov 20 2017 *)
-
PARI
is_A293872 = has(n, p=12, m=10^#Str(p))=until(p>n\=10, n%m==p&&return(1))
Formula
a(n) ~ n. - Charles R Greathouse IV, Nov 02 2022
Comments