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.

A307124 a(n) is twice the square of the product of the first n primes each decreased by one.

Original entry on oeis.org

2, 8, 128, 4608, 460800, 66355200, 16986931200, 5503765708800, 2663822603059200, 2088436920798412800, 1879593228718571520000, 2435952824419268689920000, 3897524519070829903872000000, 6875233251640943950430208000000
Offset: 1

Views

Author

Sally Myers Moite, Mar 26 2019

Keywords

Comments

a(n) is also the number of pairs (c, d) for which d !== c (mod p) and d !== -c (mod p) for every prime p up to and including the n-th prime, where 1 <= c, d <= the product of the first n primes.
In some cases, c - d and c + d are prime with (c - d) + (c + d) = 2c, as in Goldbach's conjecture.

Examples

			a(4) = 2 * 1^2 * 2^2 * 4^2 * 6^2 = 4608.
For n = 2, 2 * 3 = 6, the pairs (c, d) are (1, 6), (2, 3), (3, 2), (3, 4), (4, 3), (5, 6), (6, 1) and (6, 5), so a(2) = 8.
		

Crossrefs

Programs

  • Magma
    [2*(&*[(NthPrime(i)-1)^2: i in [1..n]]): n in [1..14]]; // Marius A. Burtea, Jun 19 2019
  • Mathematica
    a[n_]:=2 Product[(Prime[i] - 1)^2, {i, 1, n}]; Array[a,10]
    2*FoldList[Times,(Prime[Range[15]]-1)^2] (* Harvey P. Dale, Jul 20 2022 *)
  • PARI
    a(n) = 2*prod(k=1, n, prime(k)-1)^2; \\ Michel Marcus, Mar 27 2019
    

Formula

From Jon E. Schoenfield, Mar 26 2019: (Start)
a(n) = 2*Product_{j=1..n} (prime(j)-1)^2.
a(n) = 2*A005867(n)^2. (End)

Extensions

First Mathematica program edited by Harvey P. Dale, Jul 20 2022