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.

A301295 Smallest distance from n to a prime power (as defined in A000961).

This page as a plain text file.
%I A301295 #17 Sep 25 2018 20:51:23
%S A301295 0,0,0,0,0,1,0,0,0,1,0,1,0,1,1,0,0,1,0,1,2,1,0,1,0,1,0,1,0,1,0,0,1,2,
%T A301295 2,1,0,1,2,1,0,1,0,1,2,1,0,1,0,1,2,1,0,1,2,3,2,1,0,1,0,1,1,0,1,1,0,1,
%U A301295 2,1,0,1,0,1,2,3,2,1,0,1,0,1,0,1,2,3,2,1,0,1,2,3,4,3,2,1,0,1,2,1,0,1,0,1,2
%N A301295 Smallest distance from n to a prime power (as defined in A000961).
%H A301295 Antti Karttunen, <a href="/A301295/b301295.txt">Table of n, a(n) for n = 1..65537</a>
%o A301295 (PARI) A301295(n) = if(1==n,0,my(k=0);while(!isprimepower(n+k) && !isprimepower(n-k), k++); (k)); \\ _Antti Karttunen_, Sep 25 2018
%Y A301295 There are four different sequences which may legitimately be called "prime powers": A000961 (p^k, k >= 0), A246655 (p^k, k >= 1), A246547 (p^k, k >= 2), A025475 (p^k, k=0 and k >= 2).
%Y A301295 Identical to A080732 except here a(1)=0.
%Y A301295 Cf. also A051699, A175851.
%K A301295 nonn,look
%O A301295 1,21
%A A301295 _N. J. A. Sloane_, Mar 24 2018
%E A301295 More terms from _Antti Karttunen_, Sep 25 2018