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.

A319857 Difference between 4^n and the product of primes less than or equal to n.

Original entry on oeis.org

0, 3, 14, 58, 250, 994, 4066, 16174, 65326, 261934, 1048366, 4191994, 16774906, 67078834, 268405426, 1073711794, 4294937266, 17179358674, 68718966226, 274868207254, 1099501928086, 4398036811414, 17592176344726, 70368521084794, 281474753617786, 1125899683749754, 4503599404277626
Offset: 0

Views

Author

Alonso del Arte, Sep 29 2018

Keywords

Examples

			4^5 = 1024. The primes less than or equal to 5 are 2, 3, and 5. Then 2 * 3 * 5 = 30 and hence a(5) = 1024 - 30 = 994.
		

Crossrefs

Cf. A000302 (4^n), A034386 (n#), A319852.

Programs

  • Maple
    restart;
    with(NumberTheory);
    a := n -> 4^n-product(ithprime(i), i = 1 .. PrimeCounting(n)):
    0, seq(a(n), n = 1 .. 15); # Stefano Spezia, Nov 06 2018
  • Mathematica
    Table[4^n - Times@@Select[Range[n], PrimeQ], {n, 0, 31}]
  • PARI
    a034386(n) = my(v=primes(primepi(n))); prod(i=1, #v, v[i]) \\ after Charles R Greathouse IV in A034386
    a(n) = 4^n - a034386(n) \\ Felix Fröhlich, Nov 04 2018

Formula

a(n) = 4^n - n#, where n# is the product of primes less than or equal to n (see A034386).

A319880 Difference between 2^n and the product of primes less than or equal to n.

Original entry on oeis.org

0, 1, 2, 2, 10, 2, 34, -82, 46, 302, 814, -262, 1786, -21838, -13646, 2738, 35506, -379438, -248366, -9175402, -8651114, -7602538, -5505386, -214704262, -206315654, -189538438, -155984006, -88875142, 45342586, -5932822318, -5395951406, -198413006482
Offset: 0

Views

Author

Alonso del Arte, Sep 30 2018

Keywords

Comments

This sequence shows 2^n is neither a lower bound nor an upper bound for the primorials.

Crossrefs

Programs

  • Maple
    restart;
    with(NumberTheory);
    a := n -> 2^n-product(ithprime(i), i = 1 .. PrimeCounting(n)):
    0, seq(a(n), n = 1 .. 15); # Stefano Spezia, Nov 05 2018
  • Mathematica
    Table[2^n - Times@@Select[Range[n], PrimeQ], {n, 0, 31}]
  • PARI
    a(n) = 2^n - prod(k=1, primepi(n), prime(k)); \\ Michel Marcus, Nov 05 2018

Formula

a(n) = 2^n - n#, where n# is the product of primes less than or equal to n (A034386).
a(n) = A000079(n) - A034386(n) .
Showing 1-2 of 2 results.