login
This site is supported by donations to The OEIS Foundation.

 

Logo

Annual appeal: Please make a donation to keep the OEIS running! Over 6000 articles have referenced us, often saying "we discovered this result with the help of the OEIS".
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A135679 a(n) = n if n = 1 or if n is prime. Otherwise, a(n) = 2 if n is even and a(n) = 3 if n is odd. 6
1, 2, 3, 2, 5, 2, 7, 2, 3, 2, 11, 2, 13, 2, 3, 2, 17, 2, 19, 2, 3, 2, 23, 2, 3, 2, 3, 2, 29, 2, 31, 2, 3, 2, 3, 2, 37, 2, 3, 2, 41, 2, 43, 2, 3, 2, 47, 2, 3, 2, 3, 2, 53, 2, 3, 2, 3, 2, 59, 2, 61, 2, 3, 2, 3, 2, 67, 2, 3, 2, 71, 2, 73 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

The average value of a(n) is n/(2 log n) + O(n log log n/log^2 n). - Charles R Greathouse IV, May 29 2014

LINKS

G. C. Greubel, Table of n, a(n) for n = 1..1000

MATHEMATICA

a[n_] := If[PrimeQ[n] || n == 1, n, If[EvenQ[n], 2, 3] ]; Table[a[n], {n, 1, 25}] (* G. C. Greubel, Oct 26 2016 *)

PROG

(PARI) a(n)=if(isprime(n)||n==1, n, if(n%2, 3, 2)) \\ Charles R Greathouse IV, May 29 2014

CROSSREFS

Sequence in context: A209190 A086286 A272565 * A092028 A020639 A092067

Adjacent sequences:  A135676 A135677 A135678 * A135680 A135681 A135682

KEYWORD

nonn,easy

AUTHOR

Mohammad K. Azarian, Dec 01 2007

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified December 13 17:30 EST 2017. Contains 295959 sequences.