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 A316190 #12 Jul 25 2019 08:40:57 %S A316190 1,1,1,1,1,1,1,1,1,1,2,1,2,1,1,1,1,1,2,1,2,1,2,1,2,1,2,1,2,1,1,1,1,2, %T A316190 2,1,4,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,4,1,2,3,2,1,2,1,2,1,1,3,1,1,3,1, %U A316190 2,1,2,1,2,1,2,3,2,1,2,1,2,1,2,1,2,3 %N A316190 a(n) is the distance between n and the nearest prime power (in the sense of A246655) other than n. %D A316190 S. M. Gonek, A formula of Landau and mean values of Zeta(s), Topics in Analytic Number Theory, ed. by S. W. Graham and J. D. Vaaler, 92-97, Univ. Texas Press 1985. %D A316190 S. M. Gonek, An explicit formula of Landau and its applications to the theory of the zeta-function, Contemporary Math. 143 (1993), 395-413. %H A316190 Peter Luschny, <a href="/A316190/b316190.txt">Table of n, a(n) for n = 1..10000</a> %H A316190 E. Landau, <a href="https://eudml.org/doc/158549">Über die Nullstellen der Zetafunktion</a>, Math. Annalen 71, 548-564, (1911). %e A316190 Note that 1369, 1373, 1381 and 1399 are prime powers. This leads to the mapping: %e A316190 1373 -> 4, %e A316190 1374 -> 1, %e A316190 1375 -> 2, %e A316190 1376 -> 3, %e A316190 1377 -> 4, %e A316190 1378 -> 3, %e A316190 1379 -> 2, %e A316190 1380 -> 1, %e A316190 1381 -> 8. %p A316190 A316190_list := proc(N) local a, b, d, m, k, P, R; R := NULL; m := 1; %p A316190 P := select(t -> nops(numtheory:-factorset(t)) = 1 or t = 0, [$0..N]); %p A316190 for k from 1 to nops(P)-1 do %p A316190 a := P[k]; b := P[k+1]; %p A316190 if m = a then %p A316190 R := R, min(m - P[k-1] , b - m); %p A316190 m := m + 1; %p A316190 fi; %p A316190 while m < b do %p A316190 R := R, min(m - a , b - m); %p A316190 m := m + 1; %p A316190 od; %p A316190 od; [R] end: %p A316190 A316190_list(100); %t A316190 a[n_] := Module[{k = 1}, While[!PrimePowerQ[n+k] && !PrimePowerQ[n-k], k++]; k]; Array[a, 100] (* _Jean-François Alcover_, Jul 25 2019 *) %Y A316190 Cf. A246655, A316191. %K A316190 nonn %O A316190 1,11 %A A316190 _Peter Luschny_, Jun 26 2018