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.

A174857 The minimum distance k > 0 such that A020639(n+k) = A020639(n).

Original entry on oeis.org

2, 6, 2, 20, 2, 42, 2, 6, 2, 110, 2, 156, 2, 6, 2, 272, 2, 342, 2, 6, 2, 506, 2, 10, 2, 6, 2, 812, 2, 930, 2, 6, 2, 20, 2, 1332, 2, 6, 2, 1640, 2, 1806, 2, 6, 2, 2162, 2, 28, 2, 6, 2, 2756, 2, 10, 2, 6, 2, 3422, 2, 3660, 2, 6, 2, 20, 2, 4422, 2, 6, 2, 4970, 2, 5256, 2, 6, 2, 14, 2, 6162
Offset: 2

Views

Author

Vladimir Shevelev, Mar 31 2010

Keywords

Comments

The sequence has the same records as A002618.

Crossrefs

Programs

  • Maple
    A174857 := proc(n) local k,aref ; aref := A020639(n) ; for k from 1 do if A020639(n+k) = aref then return k; end if; end do: end proc:
    seq(A174857(n),n=2..80) ; # R. J. Mathar, Dec 07 2010
  • Mathematica
    Block[{s = Array[FactorInteger[#][[1, 1]] &, 10^4]}, Array[If[EvenQ[#], 2, Block[{k = 1, n = s[[#]]}, While[n != s[[# + k]], k++; If[# + k > Length[s], AppendTo[s, FactorInteger[# + k][[1, 1]] ]] ]; k]] &, 78, 2]] (* Michael De Vlieger, Apr 06 2021 *)
  • PARI
    A020639(n) = if(1==n, n, factor(n)[1, 1]);
    A174857(n) = if(isprime(n), (n-1)*n, my(spf=A020639(n)); for(k=1,oo,if(A020639(n+k)==spf,return(k)))); \\ Antti Karttunen, Apr 06 2021

Formula

If n is even, then a(n) = 2.
If n = 3k and A020639(k) >= 3, then a(n) = 6.
If n is prime, then a(n) = A036689(n).