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.

A195336 Smallest number k such that k^n is the sum of numbers in a twin prime pair.

Original entry on oeis.org

8, 6, 2, 150, 96, 324, 6, 1518, 174, 168, 21384, 18, 20754, 2988, 2424, 8196, 3786, 14952, 34056, 48, 1620, 8256, 31344, 1176, 123360, 147456, 28650, 132, 90, 12834, 81126, 11790, 2340, 9702, 11496, 33000, 10716, 66954, 6816, 234, 109956, 3012, 6744, 117654, 19950, 26550, 8226, 40584, 23640, 30660
Offset: 1

Views

Author

Kausthub Gudipati, Sep 16 2011

Keywords

Comments

Schinzel's hypothesis H implies that a(n) exists for every n. [Charles R Greathouse IV, Sep 18 2011]

Crossrefs

Cf. A054735.

Programs

  • Maple
    isA054735 := proc(n)
            if type(n,'odd') then
                    false;
            else
                    isprime(n/2-1) and isprime(n/2+1) ;
            end if;
    end proc:
    A195336 := proc(n)
            for k from 1 do
                    if isA054735(k^n) then
                            return k;
                    end if;
            end do:
    end proc:
    for n from 1  do print(A195336(n)) ; end do: # R. J. Mathar, Sep 20 2011
  • PARI
    a(n)=my(k=2);while(!ispseudoprime(k^n/2-1)||!ispseudoprime(k^n/2+1),k+=2);k \\ Charles R Greathouse IV, Sep 18 2011
    
  • Python
    from sympy import isprime
    def cond(k, n): m = (k**n)//2; return isprime(m-1) and isprime(m+1)
    def a(n):
        k = 2
        while not cond(k, n): k += 2
        return k
    print([a(n) for n in range(1, 25)]) # Michael S. Branicky, Aug 06 2021

Formula

a(n) is the least k such that (1/2)*k^n - 1 and (1/2)*k^n + 1 are prime.

Extensions

a(11)-a(50) from Charles R Greathouse IV, Sep 18 2011