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.

Showing 1-1 of 1 results.

A316190 a(n) is the distance between n and the nearest prime power (in the sense of A246655) other than n.

Original entry on oeis.org

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, 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, 2, 1, 2, 1, 2, 1, 2, 3, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3
Offset: 1

Views

Author

Peter Luschny, Jun 26 2018

Keywords

Examples

			Note that 1369, 1373, 1381 and 1399 are prime powers. This leads to the mapping:
1373 -> 4,
1374 -> 1,
1375 -> 2,
1376 -> 3,
1377 -> 4,
1378 -> 3,
1379 -> 2,
1380 -> 1,
1381 -> 8.
		

References

  • 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.
  • S. M. Gonek, An explicit formula of Landau and its applications to the theory of the zeta-function, Contemporary Math. 143 (1993), 395-413.

Crossrefs

Programs

  • Maple
    A316190_list := proc(N) local a, b, d, m, k, P, R; R := NULL; m := 1;
    P := select(t -> nops(numtheory:-factorset(t)) = 1 or t = 0, [$0..N]);
    for k from 1 to nops(P)-1 do
        a := P[k]; b := P[k+1];
        if m = a then
           R := R, min(m - P[k-1] , b - m);
           m := m + 1;
        fi;
        while m < b do
            R := R, min(m - a , b - m);
            m := m + 1;
        od;
    od; [R] end:
    A316190_list(100);
  • Mathematica
    a[n_] := Module[{k = 1}, While[!PrimePowerQ[n+k] && !PrimePowerQ[n-k], k++]; k]; Array[a, 100] (* Jean-François Alcover, Jul 25 2019 *)
Showing 1-1 of 1 results.