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.

A068319 a(n) = if n <= lpf(n)^2 then lpf(n) else a(lpf(n) + n/lpf(n)), where lpf = least prime factor, A020639.

Original entry on oeis.org

1, 2, 3, 2, 5, 5, 7, 5, 3, 7, 11, 5, 13, 3, 5, 7, 17, 11, 19, 5, 7, 13, 23, 3, 5, 5, 5, 7, 29, 17, 31, 11, 3, 19, 5, 5, 37, 7, 7, 13, 41, 23, 43, 3, 11, 5, 47, 5, 7, 5, 5, 7, 53, 29, 7, 17, 13, 31, 59, 11, 61, 3, 3, 19, 11, 5, 67, 5, 5, 37, 71, 7, 73, 7
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 27 2002, Jul 13 2007

Keywords

Comments

n>1: a(n) is prime and a(n)=n iff n is prime.
a(n) = if n <= A088377(n) then A020639(n) else a(A111234(n)).

Examples

			a(12)=a(2*6)=a(8)=a(2*4)=a(6)=a(2*3)=a(5)=a(5*1)=5.
		

Crossrefs

Cf. A032742.

Programs

  • Haskell
    a068319 n = if n <= spf ^ 2 then spf else a068319 $ spf + div n spf
                where spf = a020639 n
    -- Reinhard Zumkeller, Jun 24 2013
  • Mathematica
    lpf[n_] := FactorInteger[n][[1, 1]]; a[n_] := a[n] = If[n <= lpf[n]^2, lpf[n], a[lpf[n] + n/lpf[n]]]; Table[a[n], {n, 1, 74}](* Jean-François Alcover, Dec 21 2011 *)