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.

Previous Showing 21-30 of 42 results. Next

A375734 Indices of consecutive prime-powers (exclusive) differing by 1. Positions of 1's in A057820.

Original entry on oeis.org

1, 2, 3, 5, 6, 10, 17, 43, 70, 1077, 6635, 12369, 43578, 105102700
Offset: 1

Views

Author

Gus Wiseman, Sep 04 2024

Keywords

Comments

The corresponding prime-powers A246655(a(n)) are given by A006549.
From A006549, it is not known whether this sequence is infinite.

Examples

			The fifth prime-power is 7 and the sixth is 8, so 5 is in the sequence.
		

Crossrefs

For nonprime numbers (A002808) we have A375926, differences A373403.
Positions of 1's in A057820.
First differences are A373671.
For nonsquarefree numbers we have A375709, differences A373409.
For non-prime-powers we have A375713.
For non-perfect-powers we have A375740.
For squarefree numbers we have A375927, differences A373127.
Prime-powers:
- terms: A000961, complement A024619.
- differences: A057820.
- anti-runs: A373576, A120430, A006549, A373671
Non-prime-powers:
- terms: A361102
- differences: A375708
- anti-runs: A373679, A373575, A255346, A373672
A000040 lists all of the primes, differences A001223.
A025528 counts prime-powers up to n.

Programs

  • Mathematica
    Join@@Position[Differences[Select[Range[100],PrimePowerQ]],1]

Formula

Numbers k such that A246655(k+1) - A246655(k) = 1.
The inclusive version is a(n) + 1 shifted.

Extensions

a(14) from Amiram Eldar, Sep 24 2024

A182908 Rank of 2^n when all prime powers (A246655) p^n, for n>=1, are jointly ranked.

Original entry on oeis.org

1, 3, 6, 10, 18, 27, 44, 70, 117, 198, 340, 604, 1078, 1961, 3590, 6635, 12370, 23150, 43579, 82267, 155921, 296347, 564688, 1078555, 2064589, 3958999, 7605134, 14632960, 28195586, 54403835, 105102701, 203287169, 393625231, 762951922, 1480223716, 2874422303
Offset: 1

Views

Author

Clark Kimberling, Dec 13 2010

Keywords

Examples

			a(3)=6 because 2^3 has rank 6 in the sequence (2,3,4,5,7,8,9,...).
		

Crossrefs

Row 1 of A182869. Complement of A182909.

Programs

  • Mathematica
    T[i_,j_]:=Sum[Floor[j*Log[Prime[i]]/Log[Prime[h]]],{h,1,PrimePi[Prime[i]^j]}]; Flatten[Table[T[i,j],{i,1,1},{j,1,22}]]
    f[n_] := Sum[ PrimePi[ Floor[2^(n/k)]], {k, n + 1}]; Array[f, 34] (* Robert G. Wilson v, Jul 08 2011 *)
  • Python
    from sympy import primepi, integer_nthroot
    def A182908(n):
        x = 1<Chai Wah Wu, Nov 05 2024

Formula

a(n) = A182908(n) = A024622(n) - 1 for n>=1.
a(n) = Sum_{i=1..n} pi(floor(2^(n/i))), where pi(n) = A000720(n). - Ridouane Oudra, Oct 26 2020
a(n) = A025528(2^n). - Pontus von Brömssen, Sep 27 2024

Extensions

Minor edits by Ray Chandler, Aug 20 2021

A376341 Position of first appearance of n in A057820, the sequence of first differences of prime-powers, or 0 if n does not appear.

Original entry on oeis.org

1, 5, 10, 13, 19, 25, 199, 35, 118, 48, 28195587, 61, 3745011205066703, 80, 6635, 312, 1079, 207, 3249254387600868788, 179, 43580, 216, 21151968922, 615, 762951923, 403, 1962, 466, 12371, 245, 1480223716, 783, 494890212533313, 1110, 2064590, 1235, 375744164943287809536
Offset: 1

Views

Author

Gus Wiseman, Sep 22 2024

Keywords

Comments

For odd n either a(n) or a(n)+1 is in A024622 (unless a(n) = 0), corresponding to cases where the smaller or the larger term in the pair of consecutive prime powers, respectively, is a power of 2. - Pontus von Brömssen, Sep 27 2024

Examples

			a(4) = 13, because the first occurrence of 4 in A057820 is at index 13. The corresponding first pair of consecutive prime powers with difference 4 is (19, 23), and a(4) = A025528(23) = 13.
a(61) = A024622(96), because the first pair of consecutive prime powers with difference 61 is (2^96, 2^96+61), and A025528(2^96+61) = A024622(96).
		

Crossrefs

For compression instead of first appearances we have A376308.
For run-lengths instead of first appearances we have A376309.
For run-sums instead of first appearances we have A376310.
For squarefree numbers instead of prime-powers we have A376311.
The sorted version is A376340.
A000040 lists the prime numbers, differences A001223.
A000961 and A246655 list prime-powers, first differences A057820.
A024619 and A361102 list non-prime-powers, first differences A375708.
A003242 counts compressed compositions, ranks A333489.
A005117 lists squarefree numbers, differences A076259.
A116861 counts partitions by compressed sum, by compressed length A116608.

Programs

  • Mathematica
    mnrm[s_]:=If[Min@@s==1,mnrm[DeleteCases[s-1,0]]+1,0];
    q=Differences[Select[Range[100],#==1||PrimePowerQ[#]&]];
    Table[Position[q,k][[1,1]],{k,mnrm[q]}]

Formula

A057820(a(n)) = n whenever a(n) > 0. - Pontus von Brömssen, Sep 24 2024

Extensions

Definition modified by Pontus von Brömssen, Sep 26 2024
More terms from Pontus von Brömssen, Sep 27 2024

A302778 Number of "Fermi-Dirac primes" (A050376) <= n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Apr 16 2018

Keywords

Crossrefs

Partial sums of A302777. A left inverse of A050376.
Differs from A203967 for the first time at n=64, where a(64) = 23, while A203967(64) = 24.
Cf. also A000720, A025528.

Programs

  • Mathematica
    s[n_] := Boole[n > 1 && Length[(f = FactorInteger[n])] == 1 && (e = f[[;; , 2]]) == 2^IntegerExponent[e, 2]]; Accumulate @ Array[s, 100] (* Amiram Eldar, Nov 27 2020 *)
  • PARI
    A209229(n) = (n && !bitand(n,n-1));
    A302777(n) = A209229(isprimepower(n));
    s=0; for(n=1,105,s+=A302777(n); print1(s,", "));
    
  • Python
    from sympy import primepi, integer_nthroot
    def A302778(n): return sum(primepi(integer_nthroot(n,1<Chai Wah Wu, Feb 18-19 2025

Formula

a(1) = 0; for n > 1, a(n) = A302777(n) + a(n-1).
For all n >= 1, a(A050376(n)) = n.

A024620 Positions of primes among the powers of primes (A000961).

Original entry on oeis.org

2, 3, 5, 6, 9, 10, 12, 13, 14, 17, 18, 20, 21, 22, 23, 25, 26, 27, 29, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 41, 44, 46, 47, 48, 49, 50, 51, 52, 53, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 70, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84, 85, 86, 88, 89, 90, 91, 93, 94
Offset: 1

Views

Author

Keywords

Crossrefs

Complement of A024621.
Cf. A001222 (bigomega), A025474, A056604, A027883.

Programs

  • Haskell
    a024620 n = a024620_list !! (n-1)
    a024620_list = filter ((== 1) . a025474) [1..]
    -- Reinhard Zumkeller, May 01 2015
    
  • Mathematica
    a[n_] := PrimeOmega[LCM @@ Range@Prime@n] + 1; Array[a, 100] (* Amiram Eldar, Dec 02 2018 *)
  • PARI
    lista(nn) = my(powpr = select((i->((omega(i)==1) || (i==1))), [1..nn])); for (i = 1, #powpr, if (isprime(powpr[i]), print1(i, ", ")); ); \\ Michel Marcus, Jun 03 2021
    
  • Python
    from sympy import prime, primepi, integer_nthroot
    def A024620(n):
        x = prime(n)
        return n+1+sum(primepi(integer_nthroot(x,k)[0]) for k in range(2,x.bit_length())) # Chai Wah Wu, Nov 05 2024

Formula

A025474(a(n)) = 1. - Reinhard Zumkeller, May 01 2015
a(n) = A001222(A056604(n)) + 1. - Eric Desbiaux, Dec 02 2018
From Ridouane Oudra, Oct 18 2020: (Start)
a(n) = A027883(n) + 1;
a(n) = A025528(A000040(n)) + 1;
a(n) = A065515(A000040(n)). (End)

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

A069637 Number of prime powers <= n with exponents > 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, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 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, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10
Offset: 1

Views

Author

Amarnath Murthy, Mar 27 2002

Keywords

Comments

Counts A025475 without 1 = prime^0: a(n) = A085501(n) - 1. - Reinhard Zumkeller, Jul 03 2003
Counts the prime powers (A246655) without the primes. - Peter Luschny, Nov 18 2019

References

  • H. Sahu, K. Kar and B.S.K.R. Somayajulu, On the average order of pi*(n) - pi(n), Acta Cienc. Indica Math., Vol. 11 (1985), pp. 165-168.
  • József Sándor, Dragoslav S. Mitrinovic and Borislav Crstici, Handbook of Number Theory I, Springer Science & Business Media, 2005, Chapter VII, p. 237.

Crossrefs

Partial sums of A268340.

Programs

  • Maple
    with(numtheory);
    A069637 := proc(N) local ct,i; ct:=0;
    for i from 1 to N do if not isprime(i) and nops(factorset(i))=1 then ct:=ct+1; fi; od; ct; end; # N. J. A. Sloane, Jun 05 2022
  • Mathematica
    Table[Sum[PrimePi[n^(1/k)], {k, Log[2, n]}]-PrimePi[n],{n,94}] (* Stefano Spezia, Jun 05 2022 *)
  • Python
    from sympy import primepi, integer_nthroot
    def A069637(n): return sum(primepi(integer_nthroot(n,k)[0]) for k in range(2,n.bit_length())) # Chai Wah Wu, Aug 15 2024
  • SageMath
    [A025528(n) - prime_pi(n)  for n in (1..100)] # Peter Luschny, Nov 18 2019
    

Formula

a(n) = A025528(n) - A000720(n) = A000720([n^(1/2)]) + A000720([n^(1/3)]) + ... . - Max Alekseyev, May 11 2009
Sum_{k=1..n} a(k) ~ (4/3) * n^(3/2)/log(n) + O(n^(3/2)/log(n)^2) (Sahu et al., 1985). - Amiram Eldar, Mar 07 2021

A082997 a(n) = card{ x <= n : omega(x) = 2 }.

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, May 30 2003

Keywords

References

  • G. Tenenbaum, Introduction à la théorie analytique et probabiliste des nombres, p. 203, Publications de l'Institut Cartan, 1990.

Crossrefs

Partial sums of A215480.

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=0, 0,
          a(n-1)+`if`(nops(ifactors(n)[2])=2, 1, 0))
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Aug 23 2021
  • Mathematica
    a[n_] := Count[PrimeNu[Range[n]], 2];
    Array[a, 100] (* Jean-François Alcover, Mar 02 2022 *)
  • PARI
    a(n)=sum(i=1,n,if(omega(i)-2,0,1))
    
  • PARI
    a(n) = my(s = sqrtint(n), p = 2, j = 1, count = 0); while(p <= s, my(r = nextprime(p+1)); my(t = p); while (t <= n, my(w = n\t); if(r > w, break); count += primepi(w) - j; my(r2 = r); while(r2 <= w, my(u = t*r2*r2); if(u > n, break); while (u <= n, count += 1; u *= r2); r2 = nextprime(r2+1)); t *= p); p = r; j += 1); count; \\ Daniel Suteu, Jul 21 2021
    
  • Python
    from sympy import factorint
    from itertools import accumulate
    def cond(n): return int(len(factorint(n))==2)
    def aupto(nn): return list(accumulate(map(cond, range(1, nn+1))))
    print(aupto(77)) # Michael S. Branicky, Jul 21 2021

Formula

a(n) ~ (n/log(n))*log(log(n)).
a(A007774(n)) = n. - Daniel Suteu, Jul 21 2021

A158923 a(1) = 2, a(n) = a(n-1) + round(log(a(n-1))) for n >= 2.

Original entry on oeis.org

2, 3, 4, 5, 7, 9, 11, 13, 16, 19, 22, 25, 28, 31, 34, 38, 42, 46, 50, 54, 58, 62, 66, 70, 74, 78, 82, 86, 90, 94, 99, 104, 109, 114, 119, 124, 129, 134, 139, 144, 149, 154, 159, 164, 169, 174, 179, 184, 189, 194, 199, 204, 209, 214, 219, 224, 229, 234, 239, 244, 249
Offset: 1

Views

Author

Daniel Forgues, Mar 30 2009

Keywords

Comments

Each interval (a(n-1), a(n)] asymptotically contains one prime power on the average.

Crossrefs

Cf. A158924, "Number of prime powers - 1 in interval (A158923(n-1), A158923(n)] expressing the excess or deficit relative to the asymptotic average of 1."
Cf. A158925, "Accumulated excess or deficit of prime powers in (1, A158924(n)]" (Partial sums of A158924).
Cf. A000961, "Prime powers p^k (p prime, k >= 0)."
Cf. A025528, "Number of prime powers <= n with exponents >0."

Programs

  • Mathematica
    NestList[# + Round@ Log[#] &, 2, 60] (* Michael De Vlieger, Nov 05 2020 *)
  • Python
    from math import log
    print(2)
    a_last = n = 2
    while n >= 2:
        a = a_last + int(log(a_last) + 0.5)
        print(a)
        a_last = a
        n += 1 # Ya-Ping Lu, Oct 24 2020

A158924 Number of prime powers - 1 in interval (A158923(n-1), A158923(n)] expressing the excess or deficit relative to the asymptotic average of 1.

Original entry on oeis.org

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

Views

Author

Daniel Forgues, Mar 31 2009

Keywords

Comments

The first interval is assumed to be (1, A158923(1)].

Crossrefs

Cf. A158923: a(1) = 2, a(n) = a(n-1) + round(log(a(n-1))), n >= 2, for which each (a(n-1), a(n)] interval asymptotically contains one prime power on average.
Cf. A158925: Accumulated excess or deficit of prime powers in (1, A158924(n)] (Partial sums of A158924).
Cf. A000961 Prime powers p^k (p prime, k >= 0).
Cf. A025528 Number of prime powers <= n with exponents >0.

Extensions

Corrected and edited by Daniel Forgues, Apr 21 2009
Previous Showing 21-30 of 42 results. Next