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.

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

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