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.

Showing 1-1 of 1 results.

A245811 Number of primes of the form k^(n+1) - n^k for some k > 1.

Original entry on oeis.org

1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 2
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Aug 22 2014

Keywords

Comments

The search radius for k is effectively limited to k<=n+1 because the subtracted term n^k has exponential growth and the added term k^(n+1) only polynomial growth as k increases. - R. J. Mathar, Sep 07 2014

Crossrefs

Cf. A245809.

Programs

  • Maple
    A245811 := proc(n)
        local a,k,p ;
        a := 0 ;
        for k from 2 to n+1 do
            p := k^(n+1)-n^k ;
            if isprime(p) then
                 a := a+1 ;
            end if;
        end do:
        a ;
    end proc:
    seq(A245811(n),n=1..120) ; # R. J. Mathar, Sep 07 2014
  • PARI
    a(n) = if(n==1, return(1)); my(k=2, c=0, t); while((t=k^(n+1)-n^k)>0, k++; if(isprime(t), c++)); c
    vector(80, n, a(n)) \\ Colin Barker, Aug 26 2014
Showing 1-1 of 1 results.