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.

A127597 Least number k such that k 4^n + (4^n-1)/3 is prime.

Original entry on oeis.org

2, 1, 0, 2, 3, 2, 4, 4, 3, 10, 3, 3, 2, 7, 2, 25, 6, 17, 4, 13, 3, 20, 36, 20, 11, 27, 66, 23, 39, 24, 19, 13, 3, 10, 6, 122, 71, 58, 24, 13, 3, 2, 41, 10, 6, 32, 58, 17, 4, 79, 26, 55, 36, 48, 31, 28, 9, 2, 76, 24, 32, 28, 63, 20, 37, 9, 2, 7, 39, 10, 91, 47
Offset: 0

Views

Author

Artur Jasinski, Jan 19 2007

Keywords

Crossrefs

Programs

  • Mathematica
    a = {}; Do[k = 0; While[ !PrimeQ[k 4^n + (4^n - 1)/3], k++ ]; AppendTo[a, k], {n, 0, 50}]; a (*Artur Jasinski*)
    lnk[n_]:=Module[{k=0,n4=4^n},While[!PrimeQ[k*n4+(n4-1)/3],k++];k]; Array[ lnk,60,0] (* Harvey P. Dale, May 28 2018 *)
  • Python
    from sympy import isprime
    def a(n):
        k, fourn = 0, 4**n
        while not isprime(k*fourn + (fourn-1)//3): k += 1
        return k
    print([a(n) for n in range(72)]) # Michael S. Branicky, May 18 2022

Extensions

Offset corrected and a(51) and beyond from Michael S. Branicky, May 18 2022