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-10 of 68 results. Next

A377780 First differences of A000015 (smallest prime-power >= n).

Original entry on oeis.org

0, 1, 1, 1, 2, 0, 1, 1, 2, 0, 2, 0, 3, 0, 0, 1, 2, 0, 4, 0, 0, 0, 2, 0, 2, 0, 2, 0, 2, 0, 1, 5, 0, 0, 0, 0, 4, 0, 0, 0, 2, 0, 4, 0, 0, 0, 2, 0, 4, 0, 0, 0, 6, 0, 0, 0, 0, 0, 2, 0, 3, 0, 0, 3, 0, 0, 4, 0, 0, 0, 2, 0, 6, 0, 0, 0, 0, 0, 2, 0, 2, 0, 6, 0, 0, 0, 0
Offset: 1

Views

Author

Gus Wiseman, Nov 13 2024

Keywords

Crossrefs

First differences of A000015, restriction to primes A345531.
The opposite is A377782, restriction to primes A377781, differences of A065514.
For squarefree instead of prime-power see A067535, A112925, A112926, A120327.
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime-powers, differences A057820.
A024619 lists the non-prime-powers, differences A375735, seconds A376599.
A080101 counts prime-powers between primes (exclusive).
A361102 lists the non-powers of primes, differences A375708.
A366833 counts prime-powers between primes.

Programs

  • Mathematica
    Differences[Table[NestWhile[#+1&,n,!PrimePowerQ[#]&],{n,100}]]

A000961 Powers of primes. Alternatively, 1 and the prime powers (p^k, p prime, k >= 1).

Original entry on oeis.org

1, 2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, 29, 31, 32, 37, 41, 43, 47, 49, 53, 59, 61, 64, 67, 71, 73, 79, 81, 83, 89, 97, 101, 103, 107, 109, 113, 121, 125, 127, 128, 131, 137, 139, 149, 151, 157, 163, 167, 169, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227
Offset: 1

Views

Author

Keywords

Comments

The term "prime power" is ambiguous. To a mathematician it means any number p^k, p prime, k >= 0, including p^0 = 1.
Any nonzero integer is a product of primes and units, where the units are +1 and -1. This is tied to the Fundamental Theorem of Arithmetic which proves that the factorizations are unique up to order and units. (So, since 1 = p^0 does not have a well defined prime base p, it is sometimes not regarded as a prime power. See A246655 for the sequence without 1.)
These numbers are (apart from 1) the numbers of elements in finite fields. - Franz Vrabec, Aug 11 2004
Numbers whose divisors form a geometrical progression. The divisors of p^k are 1, p, p^2, p^3, ..., p^k. - Amarnath Murthy, Jan 09 2002
These are also precisely the orders of those finite affine planes that are known to exist as of today. (The order of a finite affine plane is the number of points in an arbitrarily chosen line of that plane. This number is unique for all lines comprise the same number of points.) - Peter C. Heinig (algorithms(AT)gmx.de), Aug 09 2006
Except for first term, the index of the second number divisible by n in A002378, if the index equals n. - Mats Granvik, Nov 18 2007
These are precisely the numbers such that lcm(1,...,m-1) < lcm(1,...,m) (=A003418(m) for m>0; here for m=1, the l.h.s. is taken to be 0). We have a(n+1)=a(n)+1 if a(n) is a Mersenne prime or a(n)+1 is a Fermat prime; the converse is true except for n=7 (from Catalan's conjecture) and n=1, since 2^1-1 and 2^0+1 are not considered as Mersenne resp. Fermat prime. - M. F. Hasler, Jan 18 2007, Apr 18 2010
The sequence is A000015 without repetitions, or more formally, A000961=Union[A000015]. - Zak Seidov, Feb 06 2008
Except for a(1)=1, indices for which the cyclotomic polynomial Phi[k] yields a prime at x=1, cf. A020500. - M. F. Hasler, Apr 04 2008
Also, {A138929(k) ; k>1} = {2*A000961(k) ; k>1} = {4,6,8,10,14,16,18,22,26,32,34,38,46,50,54,58,62,64,74,82,86,94,98,...} are exactly the indices for which Phi[k](-1) is prime. - M. F. Hasler, Apr 04 2008
A143201(a(n)) = 1. - Reinhard Zumkeller, Aug 12 2008
Number of distinct primes dividing n=omega(n) < 2. - Juri-Stepan Gerasimov, Oct 30 2009
Numbers n such that Sum_{p-1|p is prime and divisor of n} = Product_{p-1|p is prime and divisor of n}. A055631(n) = A173557(n-1). - Juri-Stepan Gerasimov, Dec 09 2009, Mar 10 2010
Numbers n such that A028236(n) = 1. Klaus Brockhaus, Nov 06 2010
A188666(k) = a(k+1) for k: 2*a(k) <= k < 2*a(k+1), k > 0; notably a(n+1) = A188666(2*a(n)). - Reinhard Zumkeller, Apr 25 2011
A003415(a(n)) = A192015(n); A068346(a(n)) = A192016(n); a(n)=A192134(n) + A192015(n). - Reinhard Zumkeller, Jun 26 2011
A089233(a(n)) = 0. - Reinhard Zumkeller, Sep 04 2013
The positive integers n such that every element of the symmetric group S_n which has order n is an n-cycle. - W. Edwin Clark, Aug 05 2014
Conjecture: these are numbers m such that Sum_{k=0..m-1} k^phi(m) == phi(m) (mod m), where phi(m) = A000010(m). - Thomas Ordowski and Giovanni Resta, Jul 25 2018
Numbers whose (increasingly ordered) divisors are alternatingly squares and nonsquares. - Michel Marcus, Jan 16 2019
Possible numbers of elements in a finite vector space. - Jianing Song, Apr 22 2021

References

  • M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 870.
  • M. Koecher and A. Krieg, Ebene Geometrie, Springer, 1993.
  • R. Lidl and H. Niederreiter, Introduction to Finite Fields and Their Applications, Cambridge 1986, Theorem 2.5, p. 45.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

There are four different sequences which may legitimately be called "prime powers": A000961 (p^k, k >= 0), A246655 (p^k, k >= 1), A246547 (p^k, k >= 2), A025475 (p^k, k=0 and k >= 2). When you refer to "prime powers", be sure to specify which of these you mean. Also A001597 is the sequence of nontrivial powers n^k, n >= 1, k >= 2. - N. J. A. Sloane, Mar 24 2018
Cf. indices of record values of A003418; A000668 and A019434 give a member of twin pairs a(n+1)=a(n)+1.
A138929(n) = 2*a(n).
A028236 (if n = Product (p_j^k_j), a(n) = numerator of Sum 1/p_j^k_j). - Klaus Brockhaus, Nov 06 2010
A000015(n) = Min{term : >= n}; A031218(n) = Max{term : <= n}.
Complementary (in the positive integers) to sequence A024619. - Jason Kimberley, Nov 10 2015

Programs

  • Haskell
    import Data.Set (singleton, deleteFindMin, insert)
    a000961 n = a000961_list !! (n-1)
    a000961_list = 1 : g (singleton 2) (tail a000040_list) where
    g s (p:ps) = m : g (insert (m * a020639 m) $ insert p s') ps
    where (m, s') = deleteFindMin s
    -- Reinhard Zumkeller, May 01 2012, Apr 25 2011
    
  • Magma
    [1] cat [ n : n in [2..250] | IsPrimePower(n) ]; // corrected by Arkadiusz Wesolowski, Jul 20 2012
    
  • Maple
    readlib(ifactors): for n from 1 to 250 do if nops(ifactors(n)[2])=1 then printf(`%d,`,n) fi: od:
    # second Maple program:
    a:= proc(n) option remember; local k; for k from
          1+a(n-1) while nops(ifactors(k)[2])>1 do od; k
        end: a(1):=1: A000961:= a:
    seq(a(n), n=1..100);  # Alois P. Heinz, Apr 08 2013
  • Mathematica
    Select[ Range[ 2, 250 ], Mod[ #, # - EulerPhi[ # ] ] == 0 & ]
    Select[ Range[ 2, 250 ], Length[FactorInteger[ # ] ] == 1 & ]
    max = 0; a = {}; Do[m = FactorInteger[n]; w = Sum[m[[k]][[1]]^m[[k]][[2]], {k, 1, Length[m]}]; If[w > max, AppendTo[a, n]; max = w], {n, 1, 1000}]; a (* Artur Jasinski *)
    Join[{1}, Select[Range[2, 250], PrimePowerQ]] (* Jean-François Alcover, Jul 07 2015 *)
  • PARI
    A000961(n,l=-1,k=0)=until(n--<1,until(lA000961(lim=999,l=-1)=for(k=1,lim, l==lcm(l,k) && next; l=lcm(l,k); print1(k,",")) \\ M. F. Hasler, Jan 18 2007
    
  • PARI
    isA000961(n) = (omega(n) == 1 || n == 1) \\ Michael B. Porter, Sep 23 2009
    
  • PARI
    nextA000961(n)=my(m,r,p);m=2*n;for(e=1,ceil(log(n+0.01)/log(2)),r=(n+0.01)^(1/e);p=prime(primepi(r)+1);m=min(m,p^e));m \\ Michael B. Porter, Nov 02 2009
    
  • PARI
    is(n)=isprimepower(n) || n==1 \\ Charles R Greathouse IV, Nov 20 2012
    
  • PARI
    list(lim)=my(v=primes(primepi(lim)),u=List([1])); forprime(p=2,sqrtint(lim\1),for(e=2,log(lim+.5)\log(p),listput(u,p^e))); vecsort(concat(v,Vec(u))) \\ Charles R Greathouse IV, Nov 20 2012
    
  • Python
    from sympy import primerange
    def A000961_list(limit): # following Python style, list terms < limit
        L = [1]
        for p in primerange(1, limit):
            pe = p
            while pe < limit:
                L.append(pe)
                pe *= p
        return sorted(L) # Chai Wah Wu, Sep 08 2014, edited by M. F. Hasler, Jun 16 2022
    
  • Python
    from sympy import primepi
    from sympy.ntheory.primetest import integer_nthroot
    def A000961(n):
        def f(x): return int(n+x-1-sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length())))
        m, k = n, f(n)
        while m != k:
            m, k = k, f(k)
        return m # Chai Wah Wu, Jul 23 2024
  • Sage
    def A000961_list(n):
        R = [1]
        for i in (2..n):
            if i.is_prime_power(): R.append(i)
        return R
    A000961_list(227) # Peter Luschny, Feb 07 2012
    

Formula

a(n) = A025473(n)^A025474(n). - David Wasserman, Feb 16 2006
a(n) = A117331(A117333(n)). - Reinhard Zumkeller, Mar 08 2006
Panaitopol (2001) gives many properties, inequalities and asymptotics, including a(n) ~ prime(n). - N. J. A. Sloane, Oct 31 2014, corrected by M. F. Hasler, Jun 12 2023 [The reference gives pi*(x) = pi(x) + pi(sqrt(x)) + ... where pi*(x) counts the terms up to x, so it is the inverse function to a(n).]
m=a(n) for some n <=> lcm(1,...,m-1) < lcm(1,...,m), where lcm(1...0):=0 as to include a(1)=1. a(n+1)=a(n)+1 <=> a(n+1)=A019434(k) or a(n)=A000668(k) for some k (by Catalan's conjecture), except for n=1 and n=7. - M. F. Hasler, Jan 18 2007, Apr 18 2010
A001221(a(n)) < 2. - Juri-Stepan Gerasimov, Oct 30 2009
A008480(a(n)) = 1 for all n >= 1. - Alois P. Heinz, May 26 2018
Sum_{k=1..n} 1/a(k) ~ log(log(a(n))) + 1 + A077761 + A136141. - François Huppé, Jul 31 2024

Extensions

Description modified by Ralf Stephan, Aug 29 2014

A057820 First differences of sequence of consecutive prime powers (A000961).

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 2, 2, 3, 1, 2, 4, 2, 2, 2, 2, 1, 5, 4, 2, 4, 2, 4, 6, 2, 3, 3, 4, 2, 6, 2, 2, 6, 8, 4, 2, 4, 2, 4, 8, 4, 2, 1, 3, 6, 2, 10, 2, 6, 6, 4, 2, 4, 6, 2, 10, 2, 4, 2, 12, 12, 4, 2, 4, 6, 2, 2, 8, 5, 1, 6, 6, 2, 6, 4, 2, 6, 4, 14, 4, 2, 4, 14, 6, 6, 4, 2, 4, 6, 2, 6, 6, 6, 4, 6, 8, 4, 8, 10, 2, 10
Offset: 1

Views

Author

Labos Elemer, Nov 08 2000

Keywords

Comments

a(n) = 1 iff A000961(n) = A006549(k) for some k. - Reinhard Zumkeller, Aug 25 2002
Also run lengths of distinct terms in A070198. - Reinhard Zumkeller, Mar 01 2012
Does this sequence contain all positive integers? - Gus Wiseman, Oct 09 2024

Examples

			Odd differences arise in pairs in neighborhoods of powers of 2, like {..,2039,2048,2053,..} gives {..,11,5,..}
		

Crossrefs

For perfect-powers (A001597) we have A053289.
For non-perfect-powers (A007916) we have A375706.
Positions of ones are A375734.
Run-compression is A376308.
Run-lengths are A376309.
Sorted positions of first appearances are A376340.
The second (instead of first) differences are A376596, zeros A376597.
Prime-powers:
- terms: A000961 or A246655, complement A024619
- differences: A057820 (this), first appearances A376341
- anti-runs: A373576, A120430, A006549, A373671
Non-prime-powers:
- terms: A361102
- differences: A375708 (ones A375713)
- anti-runs: A373679, A373575, A255346, A373672

Programs

  • Haskell
    a057820_list = zipWith (-) (tail a000961_list) a000961_list
    -- Reinhard Zumkeller, Mar 01 2012
    
  • Maple
    A057820 := proc(n)
            A000961(n+1)-A000961(n) ;
    end proc: # R. J. Mathar, Sep 23 2016
  • Mathematica
    Map[Length, Split[Table[Apply[LCM, Range[n]], {n, 1, 150}]]] (* Geoffrey Critzer, May 29 2015 *)
    Join[{1},Differences[Select[Range[500],PrimePowerQ]]] (* Harvey P. Dale, Apr 21 2022 *)
  • PARI
    isA000961(n) = (omega(n) == 1 || n == 1)
    n_prev=1;for(n=2,500,if(isA000961(n),print(n-n_prev);n_prev=n)) \\ Michael B. Porter, Oct 30 2009
    
  • Python
    from sympy import primepi, integer_nthroot
    def A057820(n):
        def f(x): return int(n+x-1-sum(primepi(integer_nthroot(x,k)[0]) for k in range(1,x.bit_length())))
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        r, k = m, f(m)+1
        while r != k: r, k = k, f(k)+1
        return r-m # Chai Wah Wu, Sep 12 2024

Formula

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

Extensions

Offset corrected and b-file adjusted by Reinhard Zumkeller, Mar 03 2012

A031218 Largest prime power <= n.

Original entry on oeis.org

1, 2, 3, 4, 5, 5, 7, 8, 9, 9, 11, 11, 13, 13, 13, 16, 17, 17, 19, 19, 19, 19, 23, 23, 25, 25, 27, 27, 29, 29, 31, 32, 32, 32, 32, 32, 37, 37, 37, 37, 41, 41, 43, 43, 43, 43, 47, 47, 49, 49, 49, 49, 53, 53, 53, 53, 53, 53, 59, 59, 61, 61, 61, 64, 64, 64, 67, 67, 67, 67, 71, 71
Offset: 1

Views

Author

Keywords

Comments

The length of the m-th run of {a(n)} is the length of the (m+1)-st run of A000015 for m > 1. - Colin Linzer, Mar 08 2024

Crossrefs

Programs

  • Haskell
    a031218 n = last $ takeWhile (<= n) a000961_list
    -- Reinhard Zumkeller, Apr 25 2011
    
  • Maple
    A031218 := proc(n)
        local a,pi,p,m ;
        a := 1 ;
        for pi from 1 do
            p := ithprime(pi) ;
            if p > n then
                return a;
            end if;
            for m from 0 do
                if p^m > n then
                    break;
                elif p^m <= n then
                    a := max(a,p^m) ;
                end if;
            end do:
        end do:
        a ;
    end proc:
    seq(A031218(n),n=1..40) ; # R. J. Mathar, Jul 20 2025
  • PARI
    a(n)=if(n<1,0, while(matsize(factor(n))[1]>1,n--); n)
    
  • Python
    from sympy import factorint
    def A031218(n): return next(filter(lambda m:len(factorint(m))<=1, range(n,0,-1))) # Chai Wah Wu, Oct 25 2024

Formula

a(n) = n - A378457(n). - R. J. Mathar, Jul 20 2025
a(n) = A000961(A065515(n)). - Ridouane Oudra, Aug 22 2025

Extensions

More terms from Erich Friedman

A345531 Smallest prime power greater than the n-th prime.

Original entry on oeis.org

3, 4, 7, 8, 13, 16, 19, 23, 25, 31, 32, 41, 43, 47, 49, 59, 61, 64, 71, 73, 79, 81, 89, 97, 101, 103, 107, 109, 113, 121, 128, 137, 139, 149, 151, 157, 163, 167, 169, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 243, 256, 263, 269, 271, 277
Offset: 1

Views

Author

Dario T. de Castro, Jun 20 2021

Keywords

Comments

Take the family of correlated prime-indexed conjectures appearing in A343249 - A343253, in which an alternative formula for the p-adic order of positive integers is proposed. There, the general p-indexed conjecture says that v_p(n), the p-adic order of n, is given by the formula: v_p(n) = log_p(n / L_p(k0, n)), where L_p(k0, n) is the lowest common denominator of the elements of the set S_p(k0, n) = {(1/n)*binomial(n, k), with 0 < k <= k0 such that k is not divisible by p}. Evidence suggests that the primality of p is a necessary condition in this general conjecture. So, if a composite number q is used instead of a prime p in the proposed formula for the p-adic (now, q-adic) order of n, the first counterexample (failure) is expected to occur for n = q * a(i), where i is the index of the smallest prime that divides q.
The prime-power a(n) is at most the next prime, so this sequence is strictly increasing. See also A366833. - Gus Wiseman, Nov 06 2024

Examples

			a(4) = 8 because the fourth prime number is 7, and the least power of a prime which is greater than 7 is 2^3 = 8.
		

Crossrefs

Starting with n instead of prime(n): A000015, A031218, A377468, A377780, A377782.
Opposite (greatest prime-power less than): A065514, A377289, A377781.
For squarefree instead of prime-power: A112926, opposite A112925.
The difference from prime(n) is A377281.
The prime terms have indices A377286(n) - 1.
First differences are A377703.
A version for perfect-powers is A378249.
A000961 and A246655 list the prime-powers, differences A057820.
A024619 and A361102 list the non-prime-powers, differences A375735.

Programs

  • Maple
    f:= proc(n) local p,x;
      p:= ithprime(n);
      for x from p+1 do
        if nops(numtheory:-factorset(x)) = 1 then return x fi
      od
    end proc:
    map(f, [$1..100]); # Robert Israel, Aug 25 2024
  • Mathematica
    a[i_]:= Module[{j, k, N = 0, tab={}}, tab = Sort[Drop[DeleteDuplicates[Flatten[Table[ If[Prime[j]^k > Prime[i], Prime[j]^k], {j, 1, i+1}, {k, 1, Floor[Log[Prime[j], Prime[i+1]]]}]]], 1]]; N = Take[tab, 1][[1]]; N];
    tabseq = Table[a[i],{i, 1, 100}];
    (* second program *)
    Table[NestWhile[#+1&,Prime[n]+1, Not@*PrimePowerQ],{n,100}] (* Gus Wiseman, Nov 06 2024 *)
  • PARI
    A000015(n) = for(k=n,oo,if((1==k)||isprimepower(k),return(k)));
    A345531(n) = A000015(1+prime(n)); \\ Antti Karttunen, Jul 19 2021
    
  • Python
    from itertools import count
    from sympy import prime, factorint
    def A345531(n): return next(filter(lambda m:len(factorint(m))<=1, count(prime(n)+1))) # Chai Wah Wu, Oct 25 2024

Formula

a(n) = A000015(1+A000040(n)). - Antti Karttunen, Jul 19 2021
a(n) = A000015(A008864(n)). - Omar E. Pol, Oct 27 2021

A065514 Largest power of a prime < prime(n).

Original entry on oeis.org

1, 2, 4, 5, 9, 11, 16, 17, 19, 27, 29, 32, 37, 41, 43, 49, 53, 59, 64, 67, 71, 73, 81, 83, 89, 97, 101, 103, 107, 109, 125, 128, 131, 137, 139, 149, 151, 157, 163, 169, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 243, 256, 257, 263, 269, 271
Offset: 1

Views

Author

Reinhard Zumkeller, Nov 27 2001

Keywords

Crossrefs

Starting with n instead of prime(n) gives A031218 (A377282, A377782).
The squarefree version is A112925 (A070321, A378038).
The opposite squarefree version is A112926 (A378037, restriction of A067535).
Difference from prime(n) is A377289 (restriction of A276781, opposite A377281).
First differences are A377781.
The nonsquarefree version is A378032 (A377783 (restriction of A378033), A378034, A378040).
The perfect power version is A378035.
A000015 gives the least prime power >= n, differences A377780.
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime powers, differences A057820.
A024619 and A361102 list the non prime powers, differences A375708 and A375735.
A345531 gives the least prime power > prime(n), differences A377703.
Prime powers between primes: A053607, A080101, A304521, A366833, A377057, A377286.

Programs

  • Mathematica
    lpp[n_]:=Module[{k=n-1},While[!PrimePowerQ[k],k--];k]; Join[{1},Table[ lpp[ n],{n,Prime[Range[2,60]]}]] (* Harvey P. Dale, Nov 24 2018 *)
  • Python
    from sympy import factorint, prime
    def A065514(n): return next(filter(lambda m:len(factorint(m))<=1, range(prime(n)-1,0,-1))) # Chai Wah Wu, Oct 25 2024

Extensions

Name edited (1 is technically not a prime power even though it is a power of a prime) by Gus Wiseman, Dec 03 2024.

A080101 Number of prime powers in all composite numbers between n-th prime and next prime.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jan 28 2003

Keywords

Comments

The maximum value of terms in the sequence, through the (10^5)th term, is 2. - Harvey P. Dale, Aug 24 2014
This is conjectured to be the maximum, see also A366833. - Gus Wiseman, Nov 06 2024

Examples

			There are two prime powers between 2179 = A000040(327) and 2203 = A000040(328): 2187 = 3^7 and 2197 = 13^3, therefore a(327) = 2, A080102(327) = 2187 and A080103(327) = 2197.
		

Crossrefs

For powers of 2 instead of primes we have A244508, see also A013597, A014210, A014234, A304521.
Adding one gives A366833.
For non-prime-powers instead of prime-powers we have A368748.
Positions of positive terms are A377057, primes A053607.
Positions of 0 are A377286.
Positions of 1 are A377287.
Positions of 2 are A377288, primes A053706.
For perfect-powers (instead of prime-powers) we have A377432.
A000015 gives the least prime-power >= n, difference A377282.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820, seconds A376596.
A031218 gives the greatest prime-power <= n, difference A276781.
A046933(n) counts the interval from A008864(n) to A006093(n+1).
A065514 gives the greatest prime-power < prime(n), difference A377289.
A246655 lists the prime-powers not including 1, complement A361102.
A345531 gives the least prime-power > prime(n), difference A377281.

Programs

  • Maple
    a := proc(n) local c, k, p: c, p := 0, ithprime(n): for k from p+1 to nextprime(p)-1 do if nops(numtheory:-factorset(k)) = 1 then c := c+1: fi: od: c: end:
    seq(a(n), n = 1 .. 105); # Lorenzo Sauras Altuzarra, Jul 08 2022
  • Mathematica
    prpwQ[n_]:=Module[{fi=FactorInteger[n]},Length[fi]==1&&fi[[1,2]]>1]; nn=600;With[{pwrs=Table[If[prpwQ[n],1,0],{n,nn}]},Table[Total[ Take[ pwrs,{Prime[n],Prime[n+1]}]],{n,PrimePi[nn]-1}]] (* Harvey P. Dale, Aug 24 2014 *)
    Table[Length[Select[Range[Prime[n]+1,Prime[n+1]-1],PrimePowerQ]],{n,30}] (* Gus Wiseman, Nov 06 2024 *)

Formula

a(n) = A366833(n) - 1. - Gus Wiseman, Nov 06 2024

A366833 Number of times n appears in A362965 (number of primes <= the n-th prime power).

Original entry on oeis.org

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

Views

Author

Paolo Xausa, Oct 25 2023

Keywords

Comments

Conjecture: a(n) can be only 1, 2, or 3 (with the first occurrences of 3 appearing at n = 4, 9, 30, 327 and 3512).
One less than the number of prime powers between prime(n) and prime(n+1), inclusive. - Gus Wiseman, Jan 09 2025

Crossrefs

Run lengths of A362965.
Subtracting one gives A080101.
For non prime powers we have A368748.
Positions of terms > 1 are A377057.
Positions of 1 are A377286.
Positions of 2 are A377287.
For perfect powers we have A377432.
For squarefree we have A373198.
A000015 gives the least prime power >= n, difference A377282.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A024619 and A361102 list the non prime powers, differences A375708 and A375735.
A031218 gives the greatest prime power <= n, difference A276781.
A046933(n) counts the interval from A008864(n) to A006093(n+1).
A246655 lists the prime powers not including 1.
A366835 counts primes between prime powers.

Programs

  • Mathematica
    With[{upto=1000},Map[Length,Most[Split[PrimePi[Select[Range[upto],PrimePowerQ]]]]]] (* Considers prime powers up to 1000 *)

Formula

a(n) = A080101(n) + 1. - Gus Wiseman, Jan 09 2025

A120327 Smallest nonsquarefree number >= n.

Original entry on oeis.org

4, 4, 4, 4, 8, 8, 8, 8, 9, 12, 12, 12, 16, 16, 16, 16, 18, 18, 20, 20, 24, 24, 24, 24, 25, 27, 27, 28, 32, 32, 32, 32, 36, 36, 36, 36, 40, 40, 40, 40, 44, 44, 44, 44, 45, 48, 48, 48, 49, 50, 52, 52, 54, 54, 56, 56, 60, 60, 60, 60, 63, 63, 63, 64, 68, 68, 68, 68, 72, 72, 72, 72
Offset: 1

Views

Author

Zak Seidov, Aug 16 2006

Keywords

Crossrefs

For squarefree instead of nonsquarefree we have A067535, differences A378087.
The opposite for squarefree is A070321, differences A378085.
The run-lengths are A078147 if we prepend 4, differences A376593.
The restriction to primes is A377783 (union A378040), differences A377784.
The opposite is A378033 (differences A378036), for prime powers A031218.
First differences are A378039 if we assume that a(1) = 1.
A005117 lists the squarefree numbers.
A013929 lists the nonsquarefree numbers.
A061398 counts squarefree numbers between primes, zeros A068360.
A061399 counts nonsquarefree numbers between primes, zeros A068361.

Programs

  • Mathematica
    Table[NestWhile[ #+1&,n,SquareFreeQ],{n,100}] (* simplified by Harvey P. Dale, Apr 08 2014 *)

A377468 Least perfect-power >= n.

Original entry on oeis.org

1, 4, 4, 4, 8, 8, 8, 8, 9, 16, 16, 16, 16, 16, 16, 16, 25, 25, 25, 25, 25, 25, 25, 25, 25, 27, 27, 32, 32, 32, 32, 32, 36, 36, 36, 36, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 81, 81, 81
Offset: 1

Views

Author

Gus Wiseman, Nov 05 2024

Keywords

Comments

Perfect-powers (A001597) are numbers with a proper integer root, complement A007916.

Crossrefs

The version for prime-powers is A000015.
The union is A001597 (perfect-powers), without powers of two A377702.
Positions of last appearances are also A001597.
The version for primes is A007918 or A151800.
The version for squarefree numbers is A067535.
Run-lengths are A076412.
The opposite version (greatest perfect-power <= n) is A081676.
A000040 lists the primes, differences A001223.
A000961 lists the powers of primes, differences A057820.
A001597 lists the perfect-powers, differences A053289, seconds A376559.
A007916 lists the non-perfect-powers, differences A375706, seconds A376562.
A069623 counts perfect-powers <= n.
A076411 counts perfect-powers < n.
A131605 lists perfect-powers that are not prime-powers.
A377432 counts perfect-powers between primes, zeros A377436.

Programs

  • Mathematica
    perpowQ[n_]:=n==1||GCD@@FactorInteger[n][[All,2]]>1;
    Table[NestWhile[#+1&,n,#>1&&!perpowQ[#]&],{n,100}]
  • Python
    from sympy import mobius, integer_nthroot
    def A377468(n):
        if n == 1: return 1
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return int(x-1+sum(mobius(k)*(integer_nthroot(x,k)[0]-1) for k in range(2,x.bit_length())))
        m = n-f(n-1)
        return bisection(lambda x:f(x)+m,n-1,n) # Chai Wah Wu, Nov 05 2024

Formula

Positions of first appearances for n > 2 are A216765(n-2) = A001597(n-1) + 1.
Showing 1-10 of 68 results. Next