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.

Showing 1-2 of 2 results.

A071259 Integer part of the arithmetic mean of the n-th prime p(n) and the n-th composite number C(n).

Original entry on oeis.org

3, 4, 6, 8, 10, 12, 15, 17, 19, 23, 25, 29, 31, 33, 36, 39, 43, 44, 48, 51, 53, 56, 59, 62, 67, 70, 71, 74, 76, 79, 86, 89, 93, 94, 100, 101, 105, 109, 111, 115, 118, 120, 126, 128, 130, 132, 138, 145, 148, 149, 152, 156, 158, 163, 167, 170, 174, 176, 179, 182, 184
Offset: 1

Views

Author

Amarnath Murthy, May 30 2002

Keywords

Examples

			a(7) = {p(7) + C(7)}/2 = (17 + 14)/2 = 15.
p(9) = 23, C(9) = 16, average = 19.5, a(9) = 19.
		

Crossrefs

Programs

  • Mathematica
    c[x_] := FixedPoint[x+PrimePi[ # ]+1&, x] Do[s=(Prime[n]+c[n])/2; If[IntegerQ[s], Print[s]], {n, 1, 256}]
    IntegerPart[Mean[#]]&/@Module[{nn=100,cmps},cmps=Select[Range[nn], CompositeQ]; Thread[{cmps,Prime[Range[Length[cmps]]]}]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Feb 24 2018 *)

Formula

Floor [ (p(n) + C(n))/2]
a(n)=Floor[[A000040(n)+A002808(n)]/2]; Prime[n]>a(n)>Composite[n]

Extensions

More terms from Labos Elemer, Jul 31 2002

A073433 Value of [p(n)+c(n)]/2 when it is an integer; p(n) is n-th prime, c(n) is n-th composite.

Original entry on oeis.org

3, 8, 17, 29, 36, 43, 53, 59, 70, 79, 93, 100, 109, 115, 128, 132, 148, 158, 167, 176, 184, 197, 204, 215, 222, 233, 247, 265, 274, 280, 288, 292, 301, 308, 319, 337, 346, 359, 368, 373, 380, 397, 401, 410, 419, 433, 448, 455, 466, 473, 496, 503, 507, 514
Offset: 1

Views

Author

Labos Elemer, Jul 31 2002

Keywords

Examples

			p(8)=19, c(8)=15, average=17, corresponds to 3rd term.
		

Crossrefs

Programs

  • Mathematica
    c[x_] := FixedPoint[x+PrimePi[ # ]+1&, x] Do[s=(Prime[n]+c[n])/2; If[IntegerQ[s], Print[s]], {n, 1, 256}]
    Module[{nn=200,pr,cm,len},pr=Prime[Range[nn]];cm=Select[Range[ nn], CompositeQ]; len=Min[Length[pr],Length[cm]];Select[Total[#]/2&/@ Thread[ {Take[pr,len],Take[cm,len]}],IntegerQ]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 29 2019 *)

Formula

[A000040(n)+A002808(n)]/2 when it is an integer.
Showing 1-2 of 2 results.