cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A377281 Difference between the n-th prime and the next prime-power (exclusive).

This page as a plain text file.
%I A377281 #12 Oct 25 2024 11:44:45
%S A377281 1,1,2,1,2,3,2,4,2,2,1,4,2,4,2,6,2,3,4,2,6,2,6,8,4,2,4,2,4,8,1,6,2,10,
%T A377281 2,6,6,4,2,6,2,10,2,4,2,12,12,4,2,4,6,2,2,5,6,6,2,6,4,2,6,14,4,2,4,14,
%U A377281 6,6,2,4,6,2,6,6,4,6,8,4,8,10,2,10,2,6
%N A377281 Difference between the n-th prime and the next prime-power (exclusive).
%F A377281 a(n) = A000015(prime(n)) - prime(n).
%F A377281 a(n) = A345531(n) - prime(n).
%F A377281 a(n) = A377282(prime(n)).
%e A377281 The twelfth prime is 37, with next prime-power 41, so a(12) = 4.
%t A377281 Table[NestWhile[#+1&,Prime[n]+1,!PrimePowerQ[#]&]-Prime[n],{n,100}]
%o A377281 (Python)
%o A377281 from itertools import count
%o A377281 from sympy import prime, factorint
%o A377281 def A377281(n): return -(p:=prime(n))+next(filter(lambda m:len(factorint(m))<=1, count(p+1))) # _Chai Wah Wu_, Oct 25 2024
%Y A377281 For prime instead of prime-power we have A001223.
%Y A377281 For powers of two instead of primes we have A013597, A014210, A014234, A244508, A304521.
%Y A377281 This is the restriction of A377282 to the prime numbers.
%Y A377281 For previous instead of next prime-power we have A377289, restriction of A276781.
%Y A377281 A000015 gives the least prime-power >= n.
%Y A377281 A000040 lists the primes, differences A001223.
%Y A377281 A000961 lists the powers of primes, differences A057820, complement A361102.
%Y A377281 A031218 gives the greatest prime-power <= n.
%Y A377281 A080101 counts prime-powers between primes (exclusive), cf. A377286, A377287, A377288.
%Y A377281 A246655 lists the prime-powers not including 1.
%Y A377281 Cf. A001597, A024619, A053289, A053707, A059305, A064113, A366833, A376596, A376597, A376598, A377051, A377054.
%K A377281 nonn
%O A377281 1,3
%A A377281 _Gus Wiseman_, Oct 23 2024