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

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

A025474 Exponent of the n-th prime power A000961(n).

Original entry on oeis.org

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

Views

Author

Keywords

Comments

a(n) is the number of automorphisms on the field with order A000961(n). This group of automorphisms is cyclic of order a(n). - Geoffrey Critzer, Feb 23 2018

Crossrefs

Cf. A000961 (the prime powers), A025473 (prime root of these), A100995 (exponent of prime powers or 0 otherwise), A001222 (bigomega), A056798 (prime powers with even exponents).
Cf. A117331.

Programs

  • Haskell
    a025474 = a001222 . a000961 -- Reinhard Zumkeller, Aug 13 2013
    
  • Mathematica
    Prepend[Table[ FactorInteger[q][[1, 2]], {q,
    Select[Range[1, 1000], PrimeNu[#] == 1 &]}], 0] (* Geoffrey Critzer, Feb 23 2018 *)
  • PARI
    A025474_upto(N)=apply(bigomega, A000961_list(N)) \\ M. F. Hasler, Jun 16 2022
    
  • Python
    A025474_upto = lambda N: [A001222(n) for n in A000961_list(N)] # M. F. Hasler, Jun 16 2022
    
  • Python
    from sympy import prime, integer_nthroot, factorint
    def A025474(n):
        if n == 1: return 0
        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 list(factorint(m).values())[0] # Chai Wah Wu, Aug 15 2024

Formula

a(n) = A100995(A000961(n)).
A000961(n) = A025473(n)^a(n); A056798(n) = A025473(n)^(2*a(n));
A192015(n) = a(n)*A025473(n)^(a(n)-1). - Reinhard Zumkeller, Jun 24 2011
a(n) = A001222(A000961(n)). - David Wasserman, Feb 16 2006

Extensions

Edited by M. F. Hasler, Jun 16 2022

A025473 a(1) = 1; for n > 1, a(n) = prime root of n-th prime power (A000961).

Original entry on oeis.org

1, 2, 3, 2, 5, 7, 2, 3, 11, 13, 2, 17, 19, 23, 5, 3, 29, 31, 2, 37, 41, 43, 47, 7, 53, 59, 61, 2, 67, 71, 73, 79, 3, 83, 89, 97, 101, 103, 107, 109, 113, 11, 5, 127, 2, 131, 137, 139, 149, 151, 157, 163, 167, 13, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239
Offset: 1

Views

Author

David W. Wilson, Dec 11 1999

Keywords

Comments

This sequence is related to the cyclotomic sequences A013595 and A020500, leading to the procedure used in the Mathematica program. - Roger L. Bagula, Jul 08 2008
"LCM numeral system": a(n+1) is radix for index n, n >= 0; a(-n+1) is 1/radix for index n, n < 0. - Daniel Forgues, May 03 2014
This is the LCM-transform of A000961; same as A014963 with all 1's (except a(1)) removed. - David James Sycamore, Jan 11 2024

References

  • Paul J. McCarthy, Algebraic Extensions of Fields, Dover books, 1976, pages 40, 69

Crossrefs

Programs

  • Haskell
    a025473 = a020639 . a000961 -- Reinhard Zumkeller, Aug 14 2013
    
  • Maple
    cvm := proc(n, level) local f,opf; if n < 2 then RETURN() fi;
    f := ifactors(n); opf := op(1,op(2,f)); if nops(op(2,f)) > 1 or
    op(2,opf) <= level then RETURN() fi; op(1,opf) end:
    A025473_list := n -> [1,seq(cvm(i,0),i=1..n)];
    A025473_list(240); # Peter Luschny, Sep 21 2011
  • Mathematica
    a = Join[{1}, Flatten[Table[If[PrimeQ[Apply[Plus, CoefficientList[Cyclotomic[n, x], x]]], Apply[Plus, CoefficientList[Cyclotomic[n, x], x]], {}], {n, 1, 1000}]]] (* Roger L. Bagula, Jul 08 2008 *)
    Join[{1}, First@ First@# & /@ FactorInteger@ Select[Range@ 240, PrimePowerQ]] (* Robert G. Wilson v, Aug 17 2017 *)
  • PARI
    print1(1); for(n=2,1e3, if(isprimepower(n,&p), print1(", "p))) \\ Charles R Greathouse IV, Apr 28 2014
    
  • Python
    from sympy import primepi, integer_nthroot, primefactors
    def A025473(n):
        if n == 1: return 1
        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 primefactors(m)[0] # Chai Wah Wu, Aug 15 2024
  • Sage
    def A025473_list(n) :
        R = [1]
        for i in (2..n) :
            if i.is_prime_power() :
                R.append(prime_divisors(i)[0])
        return R
    A025473_list(239) # Peter Luschny, Feb 07 2012
    

Formula

a(n) = A006530(A000961(n)) = A020639(A000961(n)). - David Wasserman, Feb 16 2006
From Reinhard Zumkeller, Jun 26 2011: (Start)
A000961(n) = a(n)^A025474(n).
A056798(n) = a(n)^(2*A025474(n)).
A192015(n) = A025474(n)*a(n)^(A025474(n)-1). (End)
a(1) = A051451(1) ; for n > 1, a(n) = A051451(n)/A051451(n-1). - Peter Munn, Aug 11 2024

Extensions

Offset corrected by David Wasserman, Dec 22 2008

A024622 Position of 2^n among the powers of primes (A000961).

Original entry on oeis.org

1, 2, 4, 7, 11, 19, 28, 45, 71, 118, 199, 341, 605, 1079, 1962, 3591, 6636, 12371, 23151, 43580, 82268, 155922, 296348, 564689, 1078556, 2064590, 3959000, 7605135, 14632961, 28195587, 54403836, 105102702, 203287170, 393625232, 762951923, 1480223717, 2874422304
Offset: 0

Views

Author

Keywords

Comments

Number of prime powers <= 2^n. - Jon E. Schoenfield, Nov 06 2016
A000961(a(n)) = A000079(n); also position of record values in A192015: A001787(n) = A192015(a(n)). - Reinhard Zumkeller, Jun 26 2011

Crossrefs

Programs

  • Mathematica
    {1}~Join~Flatten[1 + Position[Select[Range[10^6], PrimePowerQ], k_ /; IntegerQ@ Log2@ k ]] (* Michael De Vlieger, Nov 14 2016 *)
  • PARI
    lista(nn) = {v = vector(2^nn, i, i); vpp = select(x->ispp(x), v); print1(1, ", "); for (i=1, #vpp, if ((vpp[i] % 2) == 0, print1(i, ", ")););} \\ Michel Marcus, Nov 17 2014
    
  • PARI
    a(n)=sum(k=1,n,primepi(sqrtnint(2^n,k)))+1 \\ Charles R Greathouse IV, Nov 21 2014
    
  • PARI
    a(n)=my(s=0);for(i=1, 2^n, isprimepower(i) && s++);s+1 \\ Dana Jacobsen, Mar 23 2021
    
  • Perl
    use ntheory ":all"; for my $n (0..20) { my $s=1; is_prime_power($) && $s++ for 1..2**$n; print "$n $s\n" } # _Dana Jacobsen, Mar 23 2021
    
  • Perl
    use ntheory ":all"; for my $n (0..64) { my $s = ($n < 1) ? 1 : vecsum(map{prime_count(rootint(powint(2,$n)-1,$))}1..$n)+2; print "$n $s\n"; } # _Dana Jacobsen, Mar 23 2021
    
  • Perl
    # with b-file for pi(2^n)
    perl -Mntheory=:all -nE 'my($n,$pc)=split; say "$n ", addint($pc,vecsum( map{prime_count(rootint(powint(2,$n),$))} 2..$n )+1);'  b007053.txt  # _Dana Jacobsen, Mar 23 2021
    
  • Python
    from sympy import primepi, integer_nthroot
    def A024622(n):
        x = 1<Chai Wah Wu, Nov 05 2024
  • SageMath
    def a(n): return sum(prime_pi(ZZ(2^n).nth_root(k+1,truncate_mode=1)[0]) for k in range(n))+1 # Dana Jacobsen, Mar 23 2021
    

Formula

From Ridouane Oudra, Oct 26 2020: (Start)
a(n) = 1 + Sum_{i=1..n} pi(floor(2^(n/i))), where pi(n) = A000720(n);
a(n) = 1 + A182908(n). (End)
a(n) = A025528(2^n)+1. - Pontus von Brömssen, Sep 28 2024

Extensions

a(28)-a(36) from Hiroaki Yamanouchi, Nov 21 2014
a(46)-a(53) corrected by Hiroaki Yamanouchi, Nov 15 2016

A192134 Difference between n-th prime power and its arithmetic derivative.

Original entry on oeis.org

1, 1, 2, 0, 4, 6, -4, 3, 10, 12, -16, 16, 18, 22, 15, 0, 28, 30, -48, 36, 40, 42, 46, 35, 52, 58, 60, -128, 66, 70, 72, 78, -27, 82, 88, 96, 100, 102, 106, 108, 112, 99, 50, 126, -320, 130, 136, 138, 148, 150, 156, 162, 166, 143, 172, 178, 180, 190, 192, 196
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 26 2011

Keywords

Crossrefs

Programs

  • Haskell
    a192134 n = a000961 n - a192015 n  -- Reinhard Zumkeller, Apr 16 2014
  • Mathematica
    f[n_] := If[n == 1, 1, If[PrimePowerQ[n], {p, e} = FactorInteger[n][[1]]; n - e*p^(e-1), Nothing]]; Array[f, 300] (* Amiram Eldar, Apr 11 2025 *)

Formula

a(n) = A000961(n)-A192015(n) = A000961(n)-A003415(A000961(n)) = A192133(n)*A025473(n)^(A025474(n)-1) = A192133(n)*A000961(n)/A025473(n).
a(A095874(A000040(n))) = A006093(n).
a(A095874(A001248(n))) = A005722(n) + 1.

A192016 Second arithmetic derivative of prime powers: a(n) = A068346(A000961(n)).

Original entry on oeis.org

0, 0, 0, 4, 0, 0, 16, 5, 0, 0, 80, 0, 0, 0, 7, 27, 0, 0, 176, 0, 0, 0, 0, 9, 0, 0, 0, 640, 0, 0, 0, 0, 216, 0, 0, 0, 0, 0, 0, 0, 0, 13, 55, 0, 1408, 0, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 621, 0, 5120, 0, 0, 0, 0, 0, 0, 0, 19
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 26 2011

Keywords

Crossrefs

Programs

  • Haskell
    a192016 = a068346 . a000961  -- Reinhard Zumkeller, Apr 16 2014
  • Mathematica
    ad[n_] := n * Plus @@ ((Last[#]/First[#]) & /@ FactorInteger[n]); ad[0] = ad[1] = 0; f[n_] := If[n == 1, 0, If[PrimePowerQ[n], {p, e} = FactorInteger[n][[1]]; e*p^(e-1), Nothing]]; ad /@ Array[f, 300] (* Amiram Eldar, Apr 11 2025 *)

Formula

a(n) = A003415(A192015(n)).
a(A000040(n)) = 0; a(A002808(n)) > 0.
Showing 1-6 of 6 results.