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.

A109805 a(n) = prime(n+2)*prime(n+1) - prime(n)*prime(n+1).

Original entry on oeis.org

9, 20, 42, 66, 78, 102, 114, 230, 232, 248, 370, 246, 258, 470, 636, 472, 488, 670, 426, 584, 790, 830, 1246, 1164, 606, 618, 642, 654, 2034, 2286, 1310, 1096, 1668, 1788, 1208, 1884, 1630, 1670, 2076, 1432, 2172, 2292, 1158, 1182, 2786, 5064, 3568, 1362
Offset: 1

Views

Author

Giovanni Teofilatto, Aug 16 2005

Keywords

Comments

9 is the only semiprime of the form prime(n+2)*prime(n+1) - prime(n)*prime(n+1).
First differences of A006094. [Reinhard Zumkeller, Mar 13 2011]

Crossrefs

Cf. A006094.
The largest prime factor of a(n) gives the sequence A065091.

Programs

  • Mathematica
    Table[Prime[n + 1]*(Prime[n + 2] - Prime[n]), {n, 48}] (* Ray Chandler, Aug 17 2005 *)
    #[[2]](#[[3]]-#[[1]])&/@Partition[Prime[Range[50]],3,1] (* Harvey P. Dale, Apr 01 2018 *)
  • Python
    from sympy import prime, primerange
    def aupton(nn):
        alst, prevp, prev_prod = [], 2, 6
        for p in primerange(3, prime(nn+2)+1):
            cur_prod = prevp * p
            alst.append(cur_prod - prev_prod)
            prevp = p
            prev_prod = cur_prod
        return alst[1:]
    print(aupton(48)) # Michael S. Branicky, Sep 20 2021

Extensions

Edited and extended by Ray Chandler, Aug 17 2005