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”).

Numbers n such that n - pi(n) is a power of 10.
2

%I #27 Jun 08 2020 12:01:57

%S 1,2,3,16,17,132,1196,11373,110486,1084604,10708554,106091744,

%T 1053422338,10475688326,104287176418,1039019056245,10358018863852,

%U 103307491450819,1030734020030317,10287026204717357,102692313540015923,1025351434864118025,10239531292310798955,102270102190290407385

%N Numbers n such that n - pi(n) is a power of 10.

%C For n > 1 there exist at most two n-digit terms. If n is a term of the sequence and n + 1 is prime then n + 1 is also in the sequence.

%C Numbers n such that pi(n) is equal to n - 10^floor(log(10, n)). - _Farideh Firoozbakht_, Jan 01 2015

%p A[1]:= 1: A[2]:= 2: A[3]:= 3:

%p count:= 3:

%p for k from 1 to 8 do

%p x:= 10^k; y:= x + numtheory:-pi(x);

%p while x < y and y < 10^(k+1) do

%p x:= y; y:= 10^k + numtheory:-pi(x);

%p od;

%p count:= count+1; A[count]:= x;

%p if isprime(x+1) then

%p count:= count+1; A[count]:= x+1

%p fi;

%p od:

%p seq(A[i],i=1..count); # _Robert Israel_, Dec 31 2014

%t Select[Range[1000], IntegerQ[Log[10, # - PrimePi[#]]] &] (* _Alonso del Arte_, Jan 01 2015 *)

%o (PARI) for(n=1,10^3,s=digits(n-primepi(n)-1);if(s==[]||vecmin(s)==9,print1(n,", "))) \\ _Derek Orr_, Jan 02 2015

%Y Cf. A000720, A248856, A248857.

%K nonn,hard

%O 1,2

%A _Farideh Firoozbakht_, Dec 31 2014

%E a(19)-a(24) from _Giovanni Resta_, Jun 07 2020