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.

A053707 First differences of A025475, powers of a prime but not prime.

Original entry on oeis.org

3, 4, 1, 7, 9, 2, 5, 17, 15, 17, 40, 4, 3, 41, 74, 13, 33, 54, 18, 151, 17, 96, 104, 112, 120, 63, 307, 38, 312, 168, 199, 139, 10, 12, 192, 408, 316, 356, 240, 375, 393, 424, 128, 288, 912, 320, 298, 30, 1032, 271, 1217, 792, 408, 840, 432, 286, 602, 1872, 984, 504
Offset: 1

Views

Author

Labos Elemer, Feb 14 2000

Keywords

Comments

In the graph of this sequence, the lowest curve corresponds to differences of squares of twin primes; the next-lowest curve is for squares of adjacent primes differing by 4, etc. - T. D. Noe, Aug 03 2007

Examples

			2^0 = 1 is the first number that meets the definition of A025475, the next one is 2^2 = 4, hence a(1) = 4 - 1 = 3.
a(3) = A025475(4) - A025475(3) = 9 - 8 = 1; a(11) = A025475(12) - A025475(11) = 121 - 81 = 40.
		

Crossrefs

Cf. A025475.

Programs

  • Mathematica
    Differences@ Join[{1}, Select[Range@ 16200, And[! PrimeQ@ #, PrimePowerQ@ #] &]] (* Michael De Vlieger, Jul 04 2016 *)
  • PARI
    {k=1; for(n=2,16300,if(matsize(factor(n))[1]==1&&factor(n)[1,2]>1,d=n-k; print1(d,","); k=n))} \\ Klaus Brockhaus, Sep 25 2003
    
  • Python
    from sympy import primepi, integer_nthroot
    def A053707(n):
        if n==1: return 3
        def f(x): return int(n-2+x-sum(primepi(integer_nthroot(x,k)[0]) for k in range(2,x.bit_length())))
        kmin, kmax = 1,2
        while f(kmax)+1 >= kmax:
            kmax <<= 1
        rmin, rmax = 1, kmax
        while True:
            kmid = kmax+kmin>>1
            if f(kmid)+1 < kmid:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        while True:
            rmid = rmax+rmin>>1
            if f(rmid) < rmid:
                rmax = rmid
            else:
                rmin = rmid
            if rmax-rmin <= 1:
                break
        return kmax-rmax # Chai Wah Wu, Aug 13 2024

Formula

a(n) = A025475(n+1) - A025475(n).

Extensions

Edited by Klaus Brockhaus, Sep 25 2003