login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Nonprime numbers starting with a digit 1.
3

%I #14 Dec 10 2024 09:57:36

%S 1,10,12,14,15,16,18,100,102,104,105,106,108,110,111,112,114,115,116,

%T 117,118,119,120,121,122,123,124,125,126,128,129,130,132,133,134,135,

%U 136,138,140,141,142,143,144,145,146,147,148,150,152,153,154,155,156,158

%N Nonprime numbers starting with a digit 1.

%C Complement of A045707 with respect to A131835. Supersequence of A206288.

%t Select[Range[200], ! PrimeQ[#] && IntegerDigits[#][[1]] == 1 &] (* _T. D. Noe_, Feb 13 2012 *)

%o (Python)

%o from sympy import primepi

%o def A206286(n):

%o def f(x): return n-1+x+((m:=10**(l:=len(str(x))-1))-(k:=min((m<<1)-1,x))-primepi(m-1)+primepi(k))-sum((m:=10**i)+primepi(m-1)-primepi((m<<1)-1) for i in range(l))

%o m, k = n, f(n)

%o while m != k: m, k = k, f(k)

%o return m # _Chai Wah Wu_, Dec 10 2024

%Y Cf. A045707 (primes with first digit 1), A131835 (numbers starting with a digit 1).

%Y Cf. A206288.

%K nonn,base

%O 1,2

%A _Jaroslav Krizek_, Feb 12 2012