login
Numbers having '12' as a substring of their digits.
13

%I #17 Nov 02 2022 13:57:14

%S 12,112,120,121,122,123,124,125,126,127,128,129,212,312,412,512,612,

%T 712,812,912,1012,1112,1120,1121,1122,1123,1124,1125,1126,1127,1128,

%U 1129,1200,1201,1202,1203,1204,1205,1206,1207,1208,1209,1210,1211,1212,1213,1214,1215,1216,1217,1218

%N Numbers having '12' as a substring of their digits.

%C Row 12 of A292690 and A293869. A121032 is the subsequence of multiples of 12.

%H Robert Israel, <a href="/A293872/b293872.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Ar#10-automatic">Index entries for 10-automatic sequences</a>

%F a(n) ~ n. - _Charles R Greathouse IV_, Nov 02 2022

%p f:= proc(d) local i,x,y;

%p 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),

%p seq(12*10^(d-2)+x,x=0..10^(d-2)-1)},list))

%p end proc:

%p seq(op(f(d)),d=2..4); # _Robert Israel_, Nov 20 2017

%t Select[Range@ 1220, SequenceCount[IntegerDigits[#], {1, 2}] > 0 &] (* _Michael De Vlieger_, Nov 20 2017 *)

%o (PARI) is_A293872 = has(n, p=12, m=10^#Str(p))=until(p>n\=10, n%m==p&&return(1))

%Y Cf. A292690, A293869.

%Y Cf. A011540, A011531, A011532, A011533, A011534, A011535, A011536, A011537, A011538, A011539: analog for '0' - '9'.

%Y Cf. A293870, A293871, A293873, A293874, A293875, A293876, A293877, A293878, A293879, A293880: same for '10' - '20'.

%Y Cf. A121041, A121022, A121023, A121024, A121025, A121026, A121027, A121028, A121029, A121030, A121031, A121032, A121033, A121034, A121035, A121036, A121037, A121038, A121039, A121040: subsequences of the above, containing only multiples of the pattern p.

%K nonn,base,easy

%O 1,1

%A _M. F. Hasler_, Oct 18 2017