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.

A129189 n-th prime + n-th composite - n.

Original entry on oeis.org

5, 7, 10, 12, 16, 19, 24, 26, 30, 37, 40, 46, 50, 53, 57, 63, 69, 71, 78, 83, 85, 91, 95, 101, 110, 114, 116, 121, 124, 128, 142, 147, 153, 155, 165, 167, 174, 180, 184, 190, 196, 199, 210, 212, 216, 218, 230, 243, 247, 249, 254, 261, 263, 273, 279, 285, 292, 294
Offset: 1

Views

Author

Edwin F. Sampang, Apr 01 2007

Keywords

Examples

			n(1)=2+4-1, n(2)=3+6-2, n(3)=5+8-3, n(4)=7+9-4, n(5)=11+10-5.
		

Programs

  • Maple
    c:=proc(n) if isprime(n)=false then n else fi end: C:=[seq(c(n),n=2..100)]: a:=n->ithprime(n)+C[n]-n: seq(a(n),n=1..74); # Emeric Deutsch, Apr 16 2007
  • Mathematica
    Module[{nn=80,prs,cmps,len},prs=Prime[Range[nn]];cmps=Complement[ Range[ 2,2nn],prs];len=Min[nn,Length[cmps]];#[[1]]+#[[2]]-#[[3]]&/@ Thread[ {Take[ prs,len],Take[cmps,len],Range[len]}]] (* Harvey P. Dale, Oct 05 2016 *)

Formula

a(n) = A064799(n) - n. - Michel Marcus, Mar 14 2014

Extensions

More terms from Emeric Deutsch, Apr 16 2007