login
Number of prime powers in all composite numbers between n-th prime and next prime.
47

%I #23 Nov 14 2024 12:11:45

%S 0,1,0,2,0,1,0,0,2,0,1,0,0,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,2,1,0,0,0,

%T 0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,

%U 0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0

%N Number of prime powers in all composite numbers between n-th prime and next prime.

%C The maximum value of terms in the sequence, through the (10^5)th term, is 2. - _Harvey P. Dale_, Aug 24 2014

%C This is conjectured to be the maximum, see also A366833. - _Gus Wiseman_, Nov 06 2024

%H Harvey P. Dale, <a href="/A080101/b080101.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = A366833(n) - 1. - _Gus Wiseman_, Nov 06 2024

%e There are two prime powers between 2179=A000040(327) and 2203=A000040(328): 2187=3^7 and 2197=13^3, therefore a(327)=2, A080102(327)=2187 and A080103(327)=2197.

%p a := proc(n) local c, k, p: c, p := 0, ithprime(n): for k from p+1 to nextprime(p)-1 do if nops(numtheory:-factorset(k)) = 1 then c := c+1: fi: od: c: end:

%p seq(a(n), n = 1 .. 105); # _Lorenzo Sauras Altuzarra_, Jul 08 2022

%t prpwQ[n_]:=Module[{fi=FactorInteger[n]},Length[fi]==1&&fi[[1,2]]>1]; nn=600;With[{pwrs=Table[If[prpwQ[n],1,0],{n,nn}]},Table[Total[ Take[ pwrs,{Prime[n],Prime[n+1]}]],{n,PrimePi[nn]-1}]] (* _Harvey P. Dale_, Aug 24 2014 *)

%t Table[Length[Select[Range[Prime[n]+1,Prime[n+1]-1],PrimePowerQ]],{n,30}] (* _Gus Wiseman_, Nov 06 2024 *)

%Y Cf. A080102, A080103, A025475, A000961.

%Y For powers of 2 instead of primes we have A244508, see also A013597, A014210, A014234, A304521.

%Y Adding one gives A366833.

%Y For non-prime-powers instead of prime-powers we have A368748.

%Y Positions of positive terms are A377057, primes A053607.

%Y Positions of 0 are A377286.

%Y Positions of 1 are A377287.

%Y Positions of 2 are A377288, primes A053706.

%Y For perfect-powers (instead of prime-powers) we have A377432.

%Y A000015 gives the least prime-power >= n, difference A377282.

%Y A000040 lists the primes, differences A001223.

%Y A000961 lists the powers of primes, differences A057820, seconds A376596.

%Y A031218 gives the greatest prime-power <= n, difference A276781.

%Y A046933(n) counts the interval from A008864(n) to A006093(n+1).

%Y A065514 gives the greatest prime-power < prime(n), difference A377289.

%Y A246655 lists the prime-powers not including 1, complement A361102.

%Y A345531 gives the least prime-power > prime(n), difference A377281.

%Y Cf. A001597, A002808, A024619, A065890, A182908, A224363, A376597, A377051, A377054, A377436.

%K nonn

%O 1,4

%A _Reinhard Zumkeller_, Jan 28 2003