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.

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.

This page as a plain text file.
%I A135680 #22 Nov 02 2016 11:31:56
%S A135680 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,
%T A135680 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,
%U A135680 5,4,5,4,67,4,5,4,71,4,73
%N 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.
%H A135680 G. C. Greubel, <a href="/A135680/b135680.txt">Table of n, a(n) for n = 1..1000</a>
%t A135680 Table[Which[n == 1, 1, PrimeQ[n], n, EvenQ[n], 4, True,5], {n, 80}] (* _Harvey P. Dale_, Jul 22 2012 *)
%t A135680 Table[If[PrimeQ[n] || n == 1, n, If[EvenQ[n], 4, 5]], {n, 25}] (* _G. C. Greubel_, Oct 26 2016 *)
%t A135680 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 *)
%Y A135680 Cf. A135679.
%K A135680 nonn,easy
%O A135680 1,2
%A A135680 _Mohammad K. Azarian_, Dec 01 2007