login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A135680
a(n) = n if n = 1 or if n is prime. Otherwise, n = 4 if n is even and n = 5 if n is odd.
3
1, 2, 3, 4, 5, 4, 7, 4, 5, 4, 11, 4, 13, 4, 5, 4, 17, 4, 19, 4, 5, 4, 23, 4, 5, 4, 5, 4, 29, 4, 31, 4, 5, 4, 5, 4, 37, 4, 5, 4, 41, 4, 43, 4, 5, 4, 47, 4, 5, 4, 5, 4, 53, 4, 5, 4, 5, 4, 59, 4, 61, 4, 5, 4, 5, 4, 67, 4, 5, 4, 71, 4, 73
OFFSET
1,2
LINKS
MATHEMATICA
Table[Which[n == 1, 1, PrimeQ[n], n, EvenQ[n], 4, True, 5], {n, 80}] (* Harvey P. Dale, Jul 22 2012 *)
Table[If[PrimeQ[n] || n == 1, n, If[EvenQ[n], 4, 5]], {n, 25}] (* G. C. Greubel, Oct 26 2016 *)
Join[{1, 2}, Table[Boole[PrimeQ[n]] * (n - 1) + Boole[Not[PrimeQ[n]]] * 4 + Boole[OddQ[n]], {n, 3, 80}]] (* Alonso del Arte, Oct 26 2016 *)
CROSSREFS
Cf. A135679.
Sequence in context: A118577 A377070 A135681 * A135682 A287415 A352612
KEYWORD
nonn,easy
AUTHOR
Mohammad K. Azarian, Dec 01 2007
STATUS
approved