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.
%I A377289 #12 Oct 26 2024 22:58:22 %S A377289 1,1,1,2,2,2,1,2,4,2,2,5,4,2,4,4,6,2,3,4,2,6,2,6,8,4,2,4,2,4,2,3,6,2, %T A377289 10,2,6,6,4,4,6,2,10,2,4,2,12,12,4,2,4,6,2,8,1,6,6,2,6,4,2,4,14,4,2,4, %U A377289 14,6,4,2,4,6,6,6,6,4,6,8,4,8,10,2,10,2 %N A377289 Difference between prime(n) and the previous prime-power (exclusive). %F A377289 a(n) = prime(n) - A031218(prime(n)-1). %F A377289 a(n) = prime(n) - A065514(n). %F A377289 a(n) = A276781(prime(n)-1). %e A377289 The twelfth prime is 37, with previous prime-power 32, so a(12) = 5. %t A377289 Table[Prime[n]-NestWhile[#-1&, Prime[n]-1,#>1&&!PrimePowerQ[#]&],{n,100}] %o A377289 (Python) %o A377289 from sympy import prime, factorint %o A377289 def A377289(n): return (p:=prime(n))-next(filter(lambda m:len(factorint(m))<=1, range(p-1,0,-1))) # _Chai Wah Wu_, Oct 25 2024 %Y A377289 For powers of two see A013597, A014210, A014234, A244508, A304521. %Y A377289 For prime instead of prime-power we have A075526. %Y A377289 This is the restriction of A276781 (shifted right) to the primes. %Y A377289 For next instead of previous prime-power we have A377281, restriction of A377282. %Y A377289 A000015 gives the least prime-power >= n. %Y A377289 A000040 lists the primes, differences A001223. %Y A377289 A000961 lists the powers of primes, differences A057820, complement A361102. %Y A377289 A031218 gives the greatest prime-power <= n. %Y A377289 A065514 gives the greatest prime-power < prime(n). %Y A377289 A080101 counts prime-powers between primes (exclusive), cf. A377286, A377287, A377288. %Y A377289 A246655 lists the prime-powers not including 1. %Y A377289 Cf. A002808, A024619, A053707, A059305, A064113, A065890, A366833, A376596, A376597, A377051, A377054. %K A377289 nonn %O A377289 1,4 %A A377289 _Gus Wiseman_, Oct 23 2024