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-3 of 3 results.

A097054 Nonsquare perfect powers.

Original entry on oeis.org

8, 27, 32, 125, 128, 216, 243, 343, 512, 1000, 1331, 1728, 2048, 2187, 2197, 2744, 3125, 3375, 4913, 5832, 6859, 7776, 8000, 8192, 9261, 10648, 12167, 13824, 16807, 17576, 19683, 21952, 24389, 27000, 29791, 32768, 35937, 39304, 42875, 50653
Offset: 1

Views

Author

Hugo Pfoertner, Jul 21 2004

Keywords

Comments

Terms of A001597 that are not in A000290.
All terms of this sequence are also in A070265 (odd powers), but omitting those odd powers that are also a square (e.g. 64=4^3=8^2).

Crossrefs

Cf. A001597 (perfect powers), A000290 (the squares), A008683, A070265 (odd powers), A097055, A097056, A239870, A239728, A093771.

Programs

  • Haskell
    import Data.Map (singleton, findMin, deleteMin, insert)
    a097054 n = a097054_list !! (n-1)
    a097054_list = f 9 (3, 2) (singleton 4 (2, 2)) where
       f zz (bz, be) m
        | xx < zz && even be =
                    f zz (bz, be+1) (insert (bx*xx) (bx, be+1) $ deleteMin m)
        | xx < zz = xx :
                    f zz (bz, be+1) (insert (bx*xx) (bx, be+1) $ deleteMin m)
        | xx > zz = f (zz+2*bz+1) (bz+1, 2) (insert (bz*zz) (bz, 3) m)
        | otherwise = f (zz + 2 * bz + 1) (bz + 1, 2) m
        where (xx, (bx, be)) = findMin m
    -- Reinhard Zumkeller, Mar 28 2014
    
  • Maple
    # uses code of A001597
    for n from 4 do
        if not issqr(n) and isA001597(n) then
            printf("%d,\n",n);
        end if;
    end do: # R. J. Mathar, Jan 13 2021
  • Mathematica
    nn = 50653; Select[Union[Flatten[Table[n^i, {i, Prime[Range[2, PrimePi[Log[2, nn]]]]}, {n, 2, nn^(1/i)}]]], ! IntegerQ[Sqrt[#]] &] (* T. D. Noe, Apr 19 2011 *)
  • PARI
    is(n)=ispower(n)%2 \\ Charles R Greathouse IV, Aug 28 2016
    
  • PARI
    list(lim)=my(v=List()); forprime(e=3,logint(lim\=1,2), for(b=2,sqrtnint(lim,e), if(!issquare(b), listput(v,b^e)))); Set(v) \\ Charles R Greathouse IV, Jan 09 2023
    
  • Python
    from sympy import mobius, integer_nthroot
    def A097054(n):
        def f(x): return int(n-1+x+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(3,x.bit_length())))
        kmin, kmax = 1,2
        while f(kmax) >= kmax:
            kmax <<= 1
        while True:
            kmid = kmax+kmin>>1
            if f(kmid) < kmid:
                kmax = kmid
            else:
                kmin = kmid
            if kmax-kmin <= 1:
                break
        return kmax # Chai Wah Wu, Aug 14 2024

Formula

A052409(a(n)) is odd. - Reinhard Zumkeller, Mar 28 2014
Sum_{n>=1} 1/a(n) = 1 - zeta(2) + Sum_{k>=2} mu(k)*(1-zeta(k)) = 0.2295303015... - Amiram Eldar, Dec 21 2020

A097056 Numbers n such that the interval n^2 < x < (n+1)^2 contains two or more distinct nonsquare perfect powers A097054.

Original entry on oeis.org

5, 11, 46, 2536, 558640, 572783, 3362407, 7928108, 8928803, 67460050, 106938971, 1763350849, 2501641555, 2756149047, 4584349318, 5713606932, 17941228664, 375376083513, 411124334926, 452894760105, 1167680330892, 1933159894790, 1946131548918, 2506032014606, 2507269866902, 8217688694093
Offset: 1

Views

Author

Hugo Pfoertner, Jul 21 2004

Keywords

Comments

Empirically, there seem to be no intervals between consecutive squares containing more than two nonsquare perfect powers.
It is easy to see that two distinct powers between n^2 and (n+1)^2 are necessarily of the form x^p and y^q where p, q are distinct odd primes. Among the first 180 terms, only 4 are of type (p,q) = (3,7) and all others are of type (3,5). The first term with q = 11, if it exists, is > (1e6)^(11/2) = 1e33. - M. F. Hasler, Jan 18 2021

Examples

			a(1) = 5: 5^2 < 3^3 < 2^5 < 6^2,
a(2) = 11: 11^2 < 5^3 < 2^7 < 12^2,
a(3) = 46: 46^2 = 2116 < 3^7 = 2187 < 13^3 = 2197 < 47^2 = 2209.
a(4) = 2536: 2536^2 = 6431296 < 186^3 = 6434856 < 23^5 = 6436343 < 2537^2 = 6436369.
22 is not in the sequence because 2^9 and 8^3 (22^2 < 512 < 23^2) are not distinct.
Also, 181 is not listed since between 181^2 and 182^2 there is only 32^3 = 8^5.
		

Crossrefs

Cf. A173341 (q=5), A173342 (q=7): y with a(n)^2 < y^q < (a(n)+1)^2.

Programs

  • PARI
    is(n)=my(s,t); forprime(p=3,2*log(n+1.5)\log(2), t=floor((n+1)^(2/p)); if(t^p>n^2 && !ispower(t) && s++ > 1, return(1))); 0 \\ Charles R Greathouse IV, Dec 11 2012
    
  • PARI
    haspow(lower,upper,eMin,eMax)=if(sqrtnint(upper,3)^3>lower, return(1)); forprime(e=eMin,eMax, if(sqrtnint(upper,e)^e>lower, return(1))); 0
    list(lim)=lim\=1; my(v=List(),M=(lim+1)^2,L=logint(M,2),s); forprime(e=5,L, forprime(p=2,sqrtnint(M,e), s=sqrtint(p^e); if(haspow(s^2,(s+1)^2-1,e+1,L) && s<=lim, listput(v,s)))); Set(v) \\ Charles R Greathouse IV, Nov 05 2015

Extensions

a(5)-a(20) from Don Reble
a(21)-a(26) from David Wasserman, Dec 17 2007

A117896 Number of perfect powers between consecutive squares n^2 and (n+1)^2.

Original entry on oeis.org

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

Views

Author

T. D. Noe, Mar 31 2006, Feb 15 2010

Keywords

Comments

a(n)=2 only 14 times for n^2 < 2^63. What is the least n such that a(n)=3? Is a(n) bounded?

Examples

			a(5)=2 because powers 27 and 32 are between 25 and 36.
		

Crossrefs

Cf. A001597 (perfect powers), A014085 (primes between squares), A097055, A097056, A117934.

Programs

  • Mathematica
    nn=151^2; powers=Join[{1}, Union[Flatten[Table[n^i, {i,Prime[Range[PrimePi[Log[2,nn]]]]}, {n,2,nn^(1/i)}]]]]; t=Table[0,{Sqrt[nn]-1}]; Do[n=Floor[Sqrt[i]]; If[i>n^2, t[[n]]++], {i,powers}]; t (* revised, T. D. Noe, Apr 19 2011 *)
  • PARI
    a(n)=my(k);-sum(e=3,2*log(n+1)\log(2),k=round((n+1/2)^(2/e))^e;if(n^2Charles R Greathouse IV, Dec 19 2011

Formula

Trivially, a(n) << log n/log log n. Turk gives a(n) << sqrt(log n) and Loxton improves this to a(n) <= exp(40 sqrt(log log n log log log n)). Stewart improves the constant from 40 to 30 and conjectures that a(n) < 3 for all but finitely many n. - Charles R Greathouse IV, Dec 11 2012
Showing 1-3 of 3 results.