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.

A089091 a(n) is the smallest composite number coprime to n and n+1.

Original entry on oeis.org

9, 25, 25, 9, 49, 25, 9, 25, 49, 9, 25, 25, 9, 121, 49, 9, 25, 25, 9, 121, 25, 9, 25, 49, 9, 25, 25, 9, 49, 49, 9, 25, 25, 9, 121, 25, 9, 25, 49, 9, 25, 25, 9, 49, 49, 9, 25, 25, 9, 49, 25, 9, 25, 49, 9, 25, 25, 9, 49, 49, 9, 25, 25, 9, 49, 25, 9, 25, 121, 9, 25, 25, 9, 49, 49, 9, 25, 25
Offset: 1

Views

Author

Labos Elemer, Nov 26 2003

Keywords

Crossrefs

Programs

  • Mathematica
    m=0;Table[fla=1;Do[s=GCD[n, k]; s1=GCD[n, k+1];s2=GCD[n, k+2];s3=GCD[n, k+3]; If[Equal[s, 1]&&Equal[s1, 1]&&!PrimeQ[n]&&!Equal[n, 1]&& Equal[fla, 1], m=m+1;Print[n];fla=0], {n, 1, 1000}], {k, 1, 256}]
  • Python
    from math import gcd
    def a(n):
        k, m = 3, n*(n+1)
        while gcd(k, m) != 1: k += 2
        return k*k
    print([a(n) for n in range(1, 79)]) # Michael S. Branicky, Sep 25 2021

Formula

a(n) = A053670(n)^2.

Extensions

Offset corrected by Mohammed Yaseen, Aug 15 2023