login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A176569 a(n) = (-1)^n + (n-th prime of the form 3k-+1). 1
1, 6, 6, 12, 12, 18, 18, 24, 28, 32, 36, 42, 42, 48, 52, 60, 60, 68, 70, 74, 78, 84, 88, 98, 100, 104, 106, 110, 112, 128, 130, 138, 138, 150, 150, 158, 162, 168, 172, 180, 180, 192, 192, 198, 198, 212, 222, 228, 228, 234, 238, 242, 250, 258, 262, 270, 270, 278 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,2
LINKS
FORMULA
a(n) = (-1)^n + A045344(n). - Michel Marcus, Feb 07 2019
MAPLE
A045344 := proc(n) if n = 1 then 2; else ithprime(n+1) ; end if; end proc:
A176569 := proc(n) (-1)^n+A045344(n) ; end proc:
seq(A176569(n), n=1..120) ; # R. J. Mathar, Apr 27 2010
MATHEMATICA
Total /@ Nest[Append[#1, Block[{p = NextPrime@ #1[[-1, -1]]}, While[Mod[p, 3] == 0, p = NextPrime@ p]; {(-1)^#2, p}]] & @@ {#, Length@ # + 1} &, {{-1, 2}}, 57] (* Michael De Vlieger, Feb 09 2019 *)
PROG
(PARI) a045344(n) = if(n<2, 2, prime(n+1));
a(n) = (-1)^n + a045344(n); \\ Michel Marcus, Feb 07 2019
CROSSREFS
Cf. A045344.
Sequence in context: A338992 A055665 A168328 * A315778 A315779 A315780
KEYWORD
nonn
AUTHOR
EXTENSIONS
Corrected (double-5 replaced by double-6, 146 removed) by R. J. Mathar, Apr 27 2010
STATUS
approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 09:35 EDT 2024. Contains 371967 sequences. (Running on oeis4.)