This site is supported by donations to The OEIS Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A172022 a(n)=prime(n)+(-1)^n. 0
 1, 4, 4, 8, 10, 14, 16, 20, 22, 30, 30, 38, 40, 44, 46, 54, 58, 62, 66, 72, 72, 80, 82, 90, 96, 102, 102, 108, 108, 114, 126, 132, 136, 140, 148, 152, 156, 164, 166, 174, 178, 182, 190, 194, 196, 200, 210, 224, 226, 230, 232, 240, 240, 252, 256, 264, 268, 272, 276 (list; graph; refs; listen; history; text; internal format)
 OFFSET 1,2 COMMENTS 1 together with A014687. LINKS FORMULA a(n+1)=A014687(n). EXAMPLE a(1)=prime(1)+(-1)^1=2-1=1. MATHEMATICA upto=300; Total/@Partition[Riffle[Prime[Range[PrimePi[upto]]], {-1, 1}], 2] (* From Harvey P. Dale, May 12 2011 *) PROG (PARI) a(n)=prime(n)+(-1)^n \\ Charles R Greathouse IV, May 12, 2011 (PARI) k=1; forprime(p=2, 300, print1(p+(k*=-1)", ")) \\ Charles R Greathouse IV, May 25, 2011 CROSSREFS Cf. A000040, A014687. Sequence in context: A046558 A180854 A014687 * A152967 A004024 A086663 Adjacent sequences:  A172019 A172020 A172021 * A172023 A172024 A172025 KEYWORD nonn,easy,changed AUTHOR Juri-Stepan Gerasimov, Jan 22 2010 EXTENSIONS Entries checked by D. S. McNeil, Dec 01 2010 STATUS approved

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

Content is available under The OEIS End-User License Agreement .