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

A038529 n-th prime - n-th composite.

Original entry on oeis.org

-2, -3, -3, -2, 1, 1, 3, 4, 7, 11, 11, 16, 19, 19, 22, 27, 32, 33, 37, 39, 40, 45, 48, 53, 59, 62, 63, 65, 65, 68, 81, 83, 88, 89, 98, 99, 103, 108, 111, 116, 121, 121, 129, 130, 133, 134, 145, 155, 158, 159, 161, 165, 166, 175, 180, 185, 189, 190, 195, 197, 198, 207
Offset: 1

Views

Author

Vasiliy Danilov (danilovv(AT)usa.net), Jul 14 1998

Keywords

Comments

Sequence is monotonically increasing starting from a(2). a(n) = a(n+1) if and only if both prime(n)+2 and composite(n)+1 are prime. - Jianing Song, Jun 27 2021

Crossrefs

Programs

  • Haskell
    a038529 n = a000040 n - a002808 n  -- Reinhard Zumkeller, Apr 30 2014
    
  • Mathematica
    composite[n_Integer] := Block[{k=n+PrimePi[n]+1}, While[k-PrimePi[k]-1 != n, k++]; k]; Table[Prime[n] - composite[n], {n,65}] (* corrected by Harvey P. Dale, Aug 08 2011 *)
    Module[{nn=300,prs,cmps,len},prs=Prime[Range[PrimePi[nn]]];cmps= Complement[ Range[4,nn],prs];len=Min[Length[prs],Length[cmps]]; #[[1]]- #[[2]]&/@ Thread[{Take[prs,len],Take[cmps,len]}]] (* Harvey P. Dale, Jun 18 2015 *)
  • Python
    from sympy import prime, composite
    def A038529(n):
        return prime(n)-composite(n) # Chai Wah Wu, Dec 27 2018

Formula

a(n) = A000040(n) - A002808(n). - Reinhard Zumkeller, Apr 30 2014

A133019 Product of n-th prime and n-th prime written backwards.

Original entry on oeis.org

4, 9, 25, 49, 121, 403, 1207, 1729, 736, 2668, 403, 2701, 574, 1462, 3478, 1855, 5605, 976, 5092, 1207, 2701, 7663, 3154, 8722, 7663, 10201, 31003, 75007, 98209, 35143, 91567, 17161, 100147, 129409, 140209, 22801, 117907, 58843, 127087
Offset: 1

Views

Author

Omar E. Pol, Oct 27 2007

Keywords

Comments

a(8) = 1729 is the second taxicab number, also called the Hardy-Ramanujan number (see A001235, A011541 and A133029).

Examples

			a(8) = 1729 because the 8th prime is 19 and 19 written backwards is 91 and 19*91 = 1729.
		

Crossrefs

Programs

  • Mathematica
    #*FromDigits[Reverse[IntegerDigits[#]]] & /@ Prime[Range[1, 50]] (* G. C. Greubel, Oct 02 2017 *)
    #*IntegerReverse[#]&/@Prime[Range[40]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jun 29 2021 *)
  • PARI
    vector(60, n, prime(n)*subst(Polrev(digits(prime(n))), x, 10)) \\ Michel Marcus, Dec 17 2014

Formula

a(n) = A000040(n) * A004087(n)

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).

A331999 a(n) is the product of n, the n-th prime and the n-th composite number.

Original entry on oeis.org

8, 36, 120, 252, 550, 936, 1666, 2280, 3312, 5220, 6820, 9324, 11726, 14448, 17625, 22048, 27081, 30744, 38190, 45440, 50589, 59092, 66815, 76896, 92150, 102414, 111240
Offset: 1

Views

Author

Soham B. Patel, Feb 04 2020

Keywords

Examples

			For n=1; prime(1)=2, composite(1)=4; a(1) = 8;
For n=2; prime(2)=3, composite(2)=6; a(2) = 36;
For n=3; prime(3)=5, composite(3)=8; a(3) = 120.
		

Crossrefs

Programs

  • Mathematica
    m = 105; p = Select[Range[m], PrimeQ]; n = Length[p]; c = Complement[Range[2, m], p][[1;;n]]; p * c * Range[n] (* Amiram Eldar, Feb 12 2020 *)

Formula

a(n) = n*prime(n)*composite(n).
a(n) = n*A067563(n).
Showing 1-4 of 4 results.