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.

A072292 Number of proper powers b^d <= n (b > 1, d > 1).

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 1, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11
Offset: 1

Views

Author

Reinhard Zumkeller, Jul 12 2002

Keywords

Comments

Base b = 1 is excluded since 1 would be 1^d for any degree d (degree of power not well defined).

Crossrefs

a(i)=A069637(i) for i<36=6^2. Cf. A001597.
Cf. A075802 (first differences).

Programs

  • Haskell
    a072292 n = a072292_list !! (n-1)
    a072292_list = scanl (+) 0 $ tail a075802_list
    -- Reinhard Zumkeller, May 26 2012
    
  • Mathematica
    a[n_] := (pp = Reap[ Do[ If[b^d <= n, Sow[b^d]], {b, 2, Sqrt[n]}, {d, 2, Log[2, n]}]]; If[pp == {Null, {}}, 0, Length[ Union[ pp[[2, 1]]]]]); Table[a[n], {n, 1, 90}](* Jean-François Alcover, May 16 2012 *)
    Module[{nn=10,pp},pp=Union[Flatten[Table[a^b,{a,2,nn},{b,2,nn}]]];Accumulate[ Table[ If[ MemberQ[pp,n],1,0],{n,2^nn}]]] (* Harvey P. Dale, Nov 14 2022 *)
  • PARI
    A072292(n)=n=floor(n)+.5;-sum(k=2,log(n)\log(2),floor(n^(1/k)-1)*moebius(k))
    \\ Charles R Greathouse IV, Sep 07 2010
    
  • Python
    from sympy import mobius, integer_nthroot
    def A072292(n): return int(-sum(mobius(k)*(integer_nthroot(n,k)[0]-1) for k in range(2,n.bit_length()))) # Chai Wah Wu, Mar 11 2025

Extensions

Edited by Daniel Forgues, Mar 03 2009