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.

A079431 Least m>n with same smallest odd prime factor as n.

Original entry on oeis.org

2, 4, 6, 8, 10, 9, 14, 16, 12, 20, 22, 15, 26, 28, 18, 32, 34, 21, 38, 25, 24, 44, 46, 27, 35, 52, 30, 49, 58, 33, 62, 64, 36, 68, 40, 39, 74, 76, 42, 50, 82, 45, 86, 88, 48, 92, 94, 51, 56, 55, 54, 104, 106, 57, 65, 77, 60, 116, 118, 63, 122, 124, 66, 128, 70, 69, 134, 136
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 09 2003

Keywords

Comments

A078701(a(n))=A078701(n), A078701(i)<>A078701(n), n
n + A078701(n) <= a(n) <= 2*n;
a(2^k) = 2^(k+1), as A078701(2^k) = 1.

Crossrefs

Cf. A079432(n) = a(a(n)).
Cf. A078701.

Programs

  • Maple
    N:= 100:
    A:= Vector(N):
    p:= 2:
    do
      p:= nextprime(p);
      if p > N then break fi;
      R:= select(k -> A[k] = 0, [$1..N]);
      S:= select(`<=`,R,N/p);
      A[p*S]:= Vector(p*R[2..1+nops(S)]);
    od:
    for k from 0 to ilog2(N) do A[2^k]:= 2^(k+1) od:
    convert(A,list); # Robert Israel, Oct 25 2017
  • Mathematica
    sopf[n_] := SelectFirst[FactorInteger[n][[All, 1]], # > 2&];
    a[n_] := For[p = sopf[n]; m = n+1, True, m++, If[p == sopf[m], Return[m]]];
    Array[a, 100] (* Jean-François Alcover, Mar 09 2019 *)