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.

A176569 a(n) = (-1)^n + (n-th prime of the form 3k-+1).

Original entry on oeis.org

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
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Apr 20 2010

Keywords

Crossrefs

Cf. A045344.

Programs

  • 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 *)
  • PARI
    a045344(n) = if(n<2, 2, prime(n+1));
    a(n) = (-1)^n + a045344(n); \\ Michel Marcus, Feb 07 2019

Formula

a(n) = (-1)^n + A045344(n). - Michel Marcus, Feb 07 2019

Extensions

Corrected (double-5 replaced by double-6, 146 removed) by R. J. Mathar, Apr 27 2010