

A117818


a(n) = n if n is 1 or a prime, otherwise a(n) = n divided by the least prime factor of n (A032742(n)).


3



1, 2, 3, 2, 5, 3, 7, 4, 3, 5, 11, 6, 13, 7, 5, 8, 17, 9, 19, 10, 7, 11, 23, 12, 5, 13, 9, 14, 29, 15, 31, 16, 11, 17, 7, 18, 37, 19, 13, 20, 41, 21, 43, 22, 15, 23, 47, 24, 7, 25, 17, 26, 53, 27, 11, 28, 19, 29, 59, 30, 61, 31, 21, 32, 13, 33, 67, 34, 23, 35, 71, 36, 73, 37, 25, 38
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


COMMENTS

A026741 generalized to give either a prime or the largest proper divisor of a nonprime.
Sometimes called "Conway's subprime function", although it surely predates John Conway.  N. J. A. Sloane, Sep 29 2017


LINKS

Reinhard Zumkeller, Table of n, a(n) for n = 1..10000


MATHEMATICA

Table[If[PrimeQ[n], n, If[n == 1, 1, n/FactorInteger[n][[1, 1]]]], {n, 1, 76}]
Table[Which[n==1, 1, PrimeQ[n], 1, True, Divisors[n][[2]]], {n, 80}] (* Harvey P. Dale, Feb 02 2022 *)


PROG

(Haskell)
a117818 n = if a010051 n == 1 then n else a032742 n
 Reinhard Zumkeller, Jun 24 2013


CROSSREFS

Cf. A026741, A032742, A292772.
Sequence in context: A348582 A346701 A347044 * A073890 A079311 A060474
Adjacent sequences: A117815 A117816 A117817 * A117819 A117820 A117821


KEYWORD

nonn,easy


AUTHOR

Roger L. Bagula, Apr 30 2006


EXTENSIONS

Edited by Stefan Steinerberger, Jul 22 2007
Extended by Charles R Greathouse IV, Jul 28 2010


STATUS

approved



