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-6 of 6 results.

A067563 Product of n-th prime number and n-th composite number.

Original entry on oeis.org

8, 18, 40, 63, 110, 156, 238, 285, 368, 522, 620, 777, 902, 1032, 1175, 1378, 1593, 1708, 2010, 2272, 2409, 2686, 2905, 3204, 3686, 3939, 4120, 4494, 4796, 5085, 5842, 6288, 6713, 6950, 7599, 7852, 8478, 8965, 9352, 9861, 10382, 10860, 11842, 12159
Offset: 1

Views

Author

Rick L. Shepherd, Jan 29 2002

Keywords

Examples

			E.g. a(4)=63 because the fourth prime is 7 and the fourth composite is 9.
		

Crossrefs

Programs

  • Haskell
    a067563 n = a000040 n * a002808 n  -- Reinhard Zumkeller, Apr 30 2014
    
  • Mathematica
    Module[{nn=50,prs,comps,len},prs=Prime[Range[nn]];comps=Complement[ Range[ 4,3nn],prs];len=Min[nn,Length[comps]];Times@@@Thread[ {Take[ prs,len], Take[comps,len]}]](* Harvey P. Dale, Sep 02 2015 *)
  • Python
    from sympy import prime, composite
    def A067563(n):
        return prime(n)*composite(n) # Chai Wah Wu, Dec 27 2018

Formula

a(n) = prime(n) * composite(n).

A022797 a(n) = n-th prime + n-th nonprime.

Original entry on oeis.org

3, 7, 11, 15, 20, 23, 29, 33, 38, 45, 49, 57, 62, 65, 71, 78, 85, 88, 95, 101, 105, 112, 117, 124, 133, 139, 142, 147, 151, 157, 172, 177, 185, 188, 199, 202, 209, 217, 222, 229, 236, 239, 251, 255, 260, 263, 276, 289, 295, 298, 303, 311, 315, 326
Offset: 1

Views

Author

Keywords

Examples

			The first four primes are 2, 3, 5, 7 and the first four nonprimes are 1, 4, 6, 8. Hence a(1) = 2 + 1 = 3, a(2) = 3 + 4 = 7, a(3) = 5 + 6 = 11 and a(4) = 7 + 8 = 15.
		

Crossrefs

Cf. A064799 (with composite numbers instead of nonprimes).

Programs

  • Mathematica
    ppnp[terms_] := Module[{prs = Prime[Range[terms]], nprs, lenprs}, nprs = Complement[Range[Prime[terms]], prs]; lenprs = Length[prs]; Total /@ Thread[{prs, Take[nprs, lenprs]}]]; ppnp[60] (* Harvey P. Dale, Nov 29 2011 *)
  • PARI
    a(n) = my(nonprime(i)=my(p=1, q=i); while(p!=q, p=q; q=i+primepi(p)); q); prime(n) + nonprime(n); \\ Ruud H.G. van Tol, Feb 16 2024
    
  • PARI
    alist(N) = my(r=primes(N), q=3); r[1]+=1; for(n=2, N, if(isprime(q++),q++); r[n]+=q); r; \\ Ruud H.G. van Tol, Feb 16 2024
  • Python
    from sympy import prime, composite
    def A022797(n): return 3 if n == 1 else prime(n)+composite(n-1) # Chai Wah Wu, Aug 30 2021
    

Formula

a(n) = A000040(n) + A018252(n). - Jaroslav Krizek, Nov 18 2009

A127118 a(n) = n-th prime * n-th nonprime.

Original entry on oeis.org

2, 12, 30, 56, 99, 130, 204, 266, 345, 464, 558, 740, 861, 946, 1128, 1325, 1534, 1647, 1876, 2130, 2336, 2607, 2822, 3115, 3492, 3838, 4017, 4280, 4578, 4972, 5715, 6026, 6576, 6811, 7450, 7701, 8164, 8802, 9185, 9688, 10203, 10498, 11460, 11966, 12411
Offset: 1

Views

Author

Neven Juric (neven.juric(AT)apis-it.hr), Mar 21 2007

Keywords

Crossrefs

Programs

  • Haskell
    a127118 n = a000040 n * a018252 n  -- Reinhard Zumkeller, Apr 30 2014
    
  • Mathematica
    Module[{nn=100,prs,non,len},prs=Prime[Range[nn]];non=Complement[ Range[ nn],prs]; len=Min[Length[prs],Length[non]]; Times@@#&/@ Thread[ {Take[ prs,len],Take[non,len]}]] (* Harvey P. Dale, Dec 29 2012 *)
  • Python
    from sympy import prime, composite
    def A127118(n):
        return 2 if n == 1 else prime(n)*composite(n-1) # Chai Wah Wu, Dec 27 2018

Formula

a(n) = A000040(n) * A018252(n).

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

A171639 Sum of n-th nonprime number and n-th noncomposite number.

Original entry on oeis.org

2, 6, 9, 13, 16, 21, 25, 31, 34, 39, 47, 51, 58, 63, 67, 72, 79, 86, 89, 97, 103, 106, 113, 118, 125, 135, 140, 143, 149, 153, 158, 173, 179, 186, 189, 200, 203, 211, 218, 223, 230, 237, 241, 253, 256, 261, 264, 277, 291, 296
Offset: 1

Views

Author

Jaroslav Krizek, Dec 13 2009

Keywords

Comments

a(n) = A008578(n) + A018252(n).

Formula

a(n) = A064799(n-1) for n >= 2.

A129188 n + n-th prime + n-th composite.

Original entry on oeis.org

7, 11, 16, 20, 26, 31, 38, 42, 48, 57, 62, 70, 76, 81, 87, 95, 103, 107, 116, 123, 127, 135, 141, 149, 160, 166, 170, 177, 182, 188, 204, 211, 219, 223, 235, 239, 248, 256, 262, 270, 278, 283, 296, 300, 306, 310, 324, 339, 345, 349, 356, 365, 369, 381, 389, 397
Offset: 1

Views

Author

Edwin F. Sampang, Apr 01 2007

Keywords

Examples

			a(1)=1+2+4, a(2)=2+3+6, a(3)=3+5+8, a(4)=4+7+9.
		

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..70); # Emeric Deutsch, Apr 16 2007
  • Mathematica
    prs=Prime[Range[200]]; comps=Rest[Complement[Range[prs[[-1]]], prs]]; Table[n + prs[[n]] + comps[[n]], {n, Length[prs]}] (* Harvey P. Dale, Jan 11 2011 *)

Formula

a(n) = n+A064799(n). - R. J. Mathar, Nov 25 2008
Showing 1-6 of 6 results.