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

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

A244508 Number of odd prime powers (A246655) between 2^n and 2^(n+1).

Original entry on oeis.org

0, 1, 2, 3, 7, 8, 16, 25, 46, 80, 141, 263, 473, 882, 1628, 3044, 5734, 10779, 20428, 38687, 73653, 140425, 268340, 513866, 986033, 1894409, 3646134, 7027825, 13562625, 26208248, 50698865, 98184467, 190338061, 369326690, 717271793, 1394198586, 2712112561
Offset: 0

Views

Author

Michel Marcus, Nov 17 2014

Keywords

Examples

			Between 2 and 4, there is just 1 prime power: 3, so a(1) = 1.
Between 4 and 8, there are 2 prime powers: 5 and 7, so a(2) = 2.
		

Crossrefs

Cf. A246655 (prime powers), A182908 (positions of 2^n among prime powers).

Programs

  • Mathematica
    Table[Count[Range[2^n + 1, 2^(n + 1) - 1], ?PrimePowerQ], {n, 0, 27}] (* _Ivan N. Ianakiev, Nov 18 2014 *)
  • PARI
    a(n) = sum(i=2^n+1, 2^(n+1)-1, isprimepower(i)>0);
    
  • Python
    from sympy import primepi, integer_nthroot
    def A244508(n):
        def f(x): return int(1+sum(primepi(integer_nthroot(x, k)[0]) for k in range(1, x.bit_length())))
        return f((1<Chai Wah Wu, Nov 05 2024

Formula

a(n) = A182908(n+1) - A182908(n). - Ray Chandler, Aug 20 2021

Extensions

a(28)-a(36) from Hiroaki Yamanouchi, Nov 20 2014
Minor edits by Ray Chandler, Aug 20 2021

A182869 Joint-rank array of prime powers: p(i)^j, i>=1, j>=1, read by antidiagonals.

Original entry on oeis.org

1, 3, 2, 6, 7, 4, 10, 15, 14, 5, 18, 32, 42, 23, 8, 27, 68, 136, 86, 41, 9, 44, 152, 482, 392, 244, 53, 11, 70, 359, 1880, 2001, 1773, 360, 91, 12, 117, 893, 7771, 11211
Offset: 1

Views

Author

Clark Kimberling, Dec 09 2010

Keywords

Comments

Joint-rank arrays are defined in the first comment at A182801. A182869 is a permutation of the positive integers.

Examples

			First, arrange the prime powers in rows:
2....4....8....16....32...
3....9...27....81...243...
5...25..125...625..3125...
Then replace each prime power by its rank when they are all jointly ranked:
1....3....6....10.....18...
2....7...15....32.....68...
4...14...42...136....482...
5...23...86...392...2001...
8...41..244..1773..14901...
		

Crossrefs

Programs

  • Mathematica
    T[i_,j_]:=Sum[Floor[j*Log[Prime[i]]/Log[Prime[h]]],{h,1,PrimePi[Prime[i]^j]}];
    TableForm[Table[T[i,j],{i,1,6},{j,1,6}]]

Formula

T(i,j) = Sum_{h>=1} floor(j*log(p(i))/log(p(h))), where p(i) denotes the i-th prime.

Extensions

Corrected and extended by Clark Kimberling, Dec 13 2010

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

A333235 a(n) is the product of indices of unitary prime power divisors of n.

Original entry on oeis.org

1, 1, 2, 3, 4, 2, 5, 6, 7, 4, 8, 6, 9, 5, 8, 10, 11, 7, 12, 12, 10, 8, 13, 12, 14, 9, 15, 15, 16, 8, 17, 18, 16, 11, 20, 21, 19, 12, 18, 24, 20, 10, 21, 24, 28, 13, 22, 20, 23, 14, 22, 27, 24, 15, 32, 30, 24, 16, 25, 24, 26, 17, 35, 27, 36, 16, 28, 33, 26, 20
Offset: 1

Views

Author

Ilya Gutkovskiy, Mar 12 2020

Keywords

Comments

Equivalently: replace each prime power p^e in the prime factorization of n by its index in A246655. - M. F. Hasler, Jun 16 2021

Examples

			a(600) = a(2^3 * 3 * 5^2) = a(A246655(6) * A246655(2) * A246655(14)) = 6 * 2 * 14 = 168.
		

Crossrefs

Cf. A322981 (the index of n = p^e in A246655).

Programs

  • Maple
    N:= 1000: # for a(1)..a(N)
    R:= NULL: p:= 2:
    while p < N do
      R:= R,  seq(p^k,k=1..ilog[p](N));
      p:= nextprime(p);
    od:
    L:= sort([R]):
    f:= proc(n) local F, t;
      F:= ifactors(n)[2];
      mul(ListTools:-BinarySearch(L,t[1]^t[2]),t=F)
    end proc:
    map(f, [$1..N]); # Robert Israel, Feb 11 2021
  • Mathematica
    PrimePowerPi[n_] := Sum[Boole[PrimePowerQ[k]], {k, 1, n}]; a[1] = 1; a[n_] := Times @@ (PrimePowerPi[#[[1]]^#[[2]]] & /@ FactorInteger[n]); Table[a[n], {n, 1, 70}]
  • PARI
    apply( {A333235(n)=vecprod([A322981(f[1]^f[2])|f<-factor(n)~])}, [1..99]) \\ M. F. Hasler, Jun 16 2021

Formula

If n = Product (p_j^k_j) then a(n) = Product (A025528(p_j^k_j)).
a(prime(n)) = A027883(n).
a(2^n) = A182908(n).
a(A246655(n)) = n.

A372403 Number of k < 2^n that are neither squarefree nor prime powers.

Original entry on oeis.org

1, 5, 16, 37, 83, 178, 374, 772, 1565, 3160, 6361, 12770, 25599, 51265, 102634, 205374, 410873, 821924, 1644070, 3288433, 6577231, 13154868, 26310347, 52621521, 105244142, 210489792, 420981295, 841964929, 1683933254, 3367871086, 6735748322, 13471504796, 26943020642
Offset: 4

Views

Author

Michael De Vlieger, Jun 09 2024

Keywords

Comments

Analogous to A143658 (number of squarefree k <= 2^n) and A182908 (position of 2^n among prime powers A246655).

Examples

			Let quality Q represent a number k that is neither squarefree nor prime power. For instance, Q(k) is true if and only if Omega(k) > omega(k) > 1, i.e., A001222(k) > A001221(k) > 1.
a(4) = 1 since there is one number k = 12 such that Q(k) is true; 12 < 2^4.
a(5) = 5 since there are 5 numbers k such that Q(k) is true; {12, 18, 20, 24, 28} are less than 2^5.
a(6) = 16 since A126706(16) < 2^6 < A126706(17), etc.
		

Crossrefs

Programs

  • Maple
    filter:= proc(n) local F;
      F:= ifactors(n)[2];
      nops(F) > 1 and max(F[..,2]) > 1
    end proc:
    R:= NULL: v:= 0:
    for i from 4 to 20 do
      v:= v + nops(select(filter, [$2^(i-1)+1 .. 2^i-1]));
      R:= R,v;
    od:
    R; # Robert Israel, Jun 09 2024
  • Mathematica
    Table[2^n - Sum[PrimePi@Floor[2^(n/k)], {k, 2, n}] - Sum[MoebiusMu[k]*Floor[#/(k^2)], {k, Floor[Sqrt[#]]}] &[2^n], {n, 4, 36} ] (* Michael De Vlieger, Jan 24 2025 *)
  • Python
    from math import isqrt
    from sympy import mobius, nextprime, integer_log
    def A372403(n):
        m, p = (1<Chai Wah Wu, Jun 10 2024

Formula

a(n) = 2^n - A036386(n) - A143658(n). - Michael De Vlieger, Jan 24 2025

Extensions

a(30) onwards from Chai Wah Wu, Jun 10 2024

A380404 Number of prime powers that do not exceed the primorial number A002110(n).

Original entry on oeis.org

0, 1, 4, 16, 60, 377, 3323, 42518, 646580, 12285485, 300378113, 8028681592, 259488951722, 9414917934636, 362597756958862, 15397728568256861, 742238179325555125, 40068968503380861518, 2251262473065725514585, 139566579946046888545036
Offset: 0

Views

Author

Michael De Vlieger, Jan 24 2025

Keywords

Examples

			Let P = A002110 and let s = A246655.
a(0) = 0 since P(0) = 1, and the smallest term in s is 2.
a(1) = 1 since P(1) = 2.
a(2) = 4 since P(2) = 6 and the terms in s that do not exceed 6 are {2, 3, 4, 5}.
a(3) = 16 since P(3) = 30; the numbers 2, 3, 4, 5, 7, 8, 9, 11, 13, 16, 17, 19, 23, 25, 27, and 29 are less than 30, etc.
		

Crossrefs

Programs

  • Mathematica
    Table[Sum[PrimePi[Floor[#^(1/k)]], {k, Floor@ Log2[#]}] &[Product[Prime[i], {i, n}]], {n, 0, 14}]

Formula

a(n) = Sum_{k = 1..floor(log_2(P(n)))} pi(floor(P(n)^(1/k))), where P(n) = A002110(n).
a(n) = A000849(n) + A380402(n).
Showing 1-7 of 7 results.