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 41-50 of 140 results. Next

A060967 Number of squared primes <= 2^n.

Original entry on oeis.org

0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 11, 14, 18, 24, 31, 42, 54, 72, 97, 128, 172, 229, 309, 418, 564, 760, 1028, 1393, 1900, 2585, 3512, 4792, 6542, 8952, 12251, 16777, 23000, 31579, 43390, 59631, 82025, 112957, 155611, 214516, 295947, 408493, 564163, 779638
Offset: 0

Views

Author

Labos Elemer, May 09 2001

Keywords

Examples

			For n = 8, the squared primes not exceeding 2^8 = 256 are 4, 9, 25, 49, 121, 169, so a(8) = 6.
		

Crossrefs

Programs

  • Mathematica
    Table[ PrimePi[ Floor[ 2^(g/2)//N ] ], {g, 1, 75} ]
  • PARI
    a(n) = { primepi(sqrtint(2^n)) } \\ Harry J. Smith, Jul 15 2009

Formula

a(2*n) = A007053(n). - Amiram Eldar, Jul 10 2024
a(n) = A000720(A017910(n)). - Amiram Eldar, Mar 22 2025

Extensions

a(0) prepended by Harry J. Smith, Jul 15 2009

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

A373406 Sum of the n-th maximal run of odd primes differing by two.

Original entry on oeis.org

15, 24, 36, 23, 60, 37, 84, 47, 53, 120, 67, 144, 79, 83, 89, 97, 204, 216, 113, 127, 131, 276, 300, 157, 163, 167, 173, 360, 384, 396, 211, 223, 456, 233, 480, 251, 257, 263, 540, 277, 564, 293, 307, 624, 317, 331, 337, 696, 353, 359, 367, 373, 379, 383
Offset: 1

Views

Author

Gus Wiseman, Jun 05 2024

Keywords

Comments

The length of this run is given by A251092.
For this sequence we define a run to be an interval of positions at which consecutive terms differ by two. Normally, a run has consecutive terms differing by one, but odd prime numbers already differ by at least two.
Contains A054735 (sums of twin prime pairs) without its first two terms and A007510 (non-twin primes) as subsequences. - R. J. Mathar, Jun 07 2024

Examples

			Row-sums of:
   3   5   7
  11  13
  17  19
  23
  29  31
  37
  41  43
  47
  53
  59  61
  67
  71  73
  79
  83
  89
  97
		

Crossrefs

The partial sums are a subset of A071148 (partial sums of odd primes).
Functional neighbors: A025584, A054265, A067774, A251092 (or A175632), A373405, A373413, A373414.
A000040 lists the primes, differences A001223.
A046933 counts composite numbers between primes.
A065855 counts composite numbers up to n.

Programs

  • Mathematica
    Total/@Split[Select[Range[3,100],PrimeQ],#1+2==#2&]//Most

A373669 Least k such that the k-th maximal run of non-prime-powers has length n. Position of first appearance of n in A110969, and the sequence ends if there is none.

Original entry on oeis.org

1, 5, 7, 12, 18, 190, 28, 109, 40, 28195574, 53
Offset: 1

Views

Author

Gus Wiseman, Jun 14 2024

Keywords

Comments

A run of a sequence (in this case A361102) is an interval of positions at which consecutive terms differ by one.
Are there only 9 terms?
From David A. Corneth, Jun 14 2024: (Start)
No. a(10) exists.
Between the prime 144115188075855859 and 144115188075855872 = 2^57 there are 12 non-prime-powers so a(12) exists. (End)

Examples

			The maximal runs of non-prime-powers begin:
   1
   6
  10
  12
  14  15
  18
  20  21  22
  24
  26
  28
  30
  33  34  35  36
  38  39  40
  42
  44  45  46
  48
  50  51  52
  54  55  56  57  58
  60
		

Crossrefs

For composite runs we have A073051, sorted A373400, firsts of A176246.
For squarefree runs we have firsts of A120992.
For prime-powers runs we have firsts of A174965.
For prime runs we have firsts of A251092 or A175632.
For squarefree antiruns we have A373128, firsts of A373127.
For nonsquarefree runs we have A373199, firsts of A053797.
The sorted version is A373670.
For antiruns we have firsts of A373672.
For runs of non-prime-powers:
- length A110969
- min A373676
- max A373677
- sum A373678
A000961 lists the powers of primes (including 1).
A005117 lists the squarefree numbers, first differences A076259.
A013929 lists the nonsquarefree numbers, first differences A078147.
A057820 gives first differences of consecutive prime-powers, gaps A093555.
A112798 lists prime indices, reverse A296150, length A001222, sum A056239.
A361102 lists the non-prime-powers, without 1 A024619.

Programs

  • Mathematica
    q=Length/@Split[Select[Range[10000],!PrimePowerQ[#]&],#1+1==#2&]//Most;
    spna[y_]:=Max@@Select[Range[Length[y]],SubsetQ[y,Range[#1]]&];
    Table[Position[q,k][[1,1]],{k,spna[q]}]

A055729 Number of primes <= 3^n.

Original entry on oeis.org

0, 2, 4, 9, 22, 53, 129, 327, 847, 2227, 5968, 16097, 43934, 120739, 334349, 931260, 2607165, 7332159, 20700806, 58648288, 166677978, 475023803, 1357200840, 3886548158, 11152818693, 32064929886, 92349038518, 266398236486, 769616513836, 2226457080707, 6449247674296, 18703411700669, 54301968156067, 157820174545456
Offset: 0

Views

Author

Robert G. Wilson v, Jun 09 2000

Keywords

Crossrefs

Cf. A006880 and A007053.

Programs

  • Mathematica
    Table[PrimePi[3^n], {n, 0, 29}]
  • PARI
    a(n) = primepi(3^n); \\ Michel Marcus, Aug 25 2014

Formula

a(n) = A000720(A000244(n)). - Michel Marcus, Aug 25 2014

Extensions

a(28)-a(40) from Henri Lifchitz, Nov 11 2012

A036386 Number of prime powers (p^2, p^3, ...) <= 2^n.

Original entry on oeis.org

0, 1, 2, 4, 7, 9, 13, 16, 20, 26, 31, 40, 50, 61, 78, 93, 119, 150, 189, 242, 310, 400, 525, 684, 900, 1190, 1581, 2117, 2836, 3807, 5136, 6948, 9425, 12811, 17437, 23788, 32517, 44512, 60971, 83640, 114899, 157948, 217336, 299360, 412635, 569193, 785753, 1085319, 1500140, 2074794, 2870849, 3974425, 5504966
Offset: 1

Views

Author

Keywords

Examples

			For n = 6, there are 9 prime powers not exceeding 2^6 = 64: 4, 8, 9, 16, 25, 27, 32, 49, 64, so a(6) = 9.
For n = 25, a(25) = 900, pi(5792) + pi(322) + pi(76) + pi(32) + pi(17) + pi(11) + pi(8) + pi(6) + pi(5) + pi(4) + pi(4) + pi(3) + pi(3) + pi(3) + pi(2) + pi(2) + pi(2) + pi(2) + pi(2) + pi(2) + pi(2) + pi(2) + pi(2) + pi(2) + pi(1) = 760 + 66 + 21 + 11 + 7 + 5 + 4 + 3 + 3 + 2 + 2 + 2 + 2 + 2 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 = 900.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Length@ Union@ Flatten@ Table[ Prime[j]^k, {k, 2, n + 1}, {j, PrimePi[2^(n/k)]}]; Array[f, 46] (* Robert G. Wilson v, Jul 08 2011 *)
  • Python
    from sympy import primepi, integer_nthroot
    def A036386(n):
        m = 1<Chai Wah Wu, Jan 23 2025

Formula

a(n) = Sum_{j=2..n+1} pi(floor(2^(n/j))). The summation starts with squares (j=2); for arbitrary range (=y), the y^(1/j) argument has to be used.

Extensions

More terms from Labos Elemer, May 07 2001
Terms a(47) and beyond from Hiroaki Yamanouchi, Nov 15 2016

A065843 Let u be any string of n digits from {0,1}; let f(u) = number of distinct primes, not beginning with 0, formed by permuting the digits of u to a base-2 number; then a(n) = max_u f(u).

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 5, 12, 11, 24, 34, 79, 105, 194, 362, 734, 1143, 2045, 3872, 7758, 13001, 23902, 45539, 90436, 159510, 296210, 563833, 1110387, 2030754, 3876871, 7333827, 14353074, 26730538, 51246344, 97529176, 190928828, 358117285, 694240090, 1324674524, 2587693929, 4903604087, 9547001123
Offset: 1

Views

Author

Sascha Kurz, Nov 24 2001

Keywords

Examples

			a(4)=2 because 1011 and 1101 in base-2 notation are primes (11 and 13) and there is no set of three or more 4-digit primes with a common number of ones.
		

Crossrefs

Programs

  • Maple
    A065843 := proc(n)
        local b,u,udgs,uperm,a;
        b :=2 ;
        a := 0 ;
        for u from b^(n-1) to b^n-1 do
            udgs := convert(u,base,b) ;
            prs := {} ;
            for uperm in combinat[permute](udgs) do
                if op(-1,uperm) <> 0 then
                    p := add( op(i,uperm)*b^(i-1),i=1..nops(uperm)) ;
                    if isprime(p) then
                        prs := prs union {p} ;
                    end if;
                end if;
            end do:
            a := max(a,nops(prs)) ;
        end do:
        a ;
    end proc:
    for n from 1 do
        print(n,A065843(n)) ;
    end do: # R. J. Mathar, Apr 23 2016
  • Mathematica
    c[x_] := Module[{},
       Length[Select[Permutations[x],
         First[#] != 0 && PrimeQ[FromDigits[#, 2]] &]]];
    A065843[n_] := Module[{i},
       Return[Max[Map[c, DeleteDuplicatesBy[Tuples[Range[0, 1], n],
           Table[Count[#, i], {i, 0, 1}] &]]]]];
    Table[A065843[n], {n, 1, 19}] (* Robert Price, Mar 30 2019 *)
  • PARI
    lista(n) = {my(m = matrix(n,n),c); forprime(i=2,2^n, b = binary(i); m[#b,hammingweight(b)]++);vector(n,i,vecmax(m[i,]))} \\ David A. Corneth, Apr 23 2016
    
  • Python
    from sympy import isprime
    from itertools import combinations_with_replacement as mc
    from sympy.utilities.iterables import multiset_permutations as mp
    def a(n): return n-1 if n < 3 else max(sum(1 for p in mp(c) if isprime(int("1"+"".join(p)+"1", 2))) for c in mc("01", n-2))
    print([a(n) for n in range(1, 21)]) # Michael S. Branicky, Oct 09 2022

Extensions

6 more terms from Sean A. Irvine, Sep 06 2009
a(37)-a(39) from Michael S. Branicky, May 30 2024
a(40)-a(42) from Michael S. Branicky, Jun 14 2024

A145592 a(n)=number of numbers removed in each step of Eratosthenes's sieve for 2^14.

Original entry on oeis.org

8191, 2730, 1091, 623, 340, 260, 182, 154, 121, 94, 89, 74, 66, 62, 55, 48, 43, 39, 35, 31, 28, 25, 23, 19, 15, 12, 11, 9, 7, 5, 1
Offset: 1

Views

Author

Artur Jasinski with assistance from Bob Hanlon (hanlonr(AT)cox.net), Oct 14 2008

Keywords

Comments

Number of steps in Eratosthenes's sieve for 2^n is A060967(n).
Number of primes less than 2^14 is equal to 2^14 - (sum all of numbers in this sequence) - 1 = A007053(14).

Crossrefs

Programs

  • Mathematica
    f3[k_Integer?Positive, i_Integer?Positive] := Module[{f, m, r, p}, p = Transpose[{r = Range[2, i], Prime[r]}];f[x_] := Catch[Fold[If[Mod[x, #2[[2]]] == 0, Throw[m[ #2[[1]]] = m[ #2[[1]]] + 1], #1] &, If[Mod[x, 2] == 0, Throw[m[1] = m[1] + 1]], p]]; Table[m[n] = -1, {n, i}]; f /@ Range[k]; Table[m[n], {n, i}]];nn = 14; kk = PrimePi[Sqrt[2^nn]]; t3 = f3[2^nn, kk] (* Bob Hanlon (hanlonr(AT)cox.net) *)

A125527 Number of semiprimes <= 2^n.

Original entry on oeis.org

0, 1, 2, 6, 10, 22, 42, 82, 157, 304, 589, 1124, 2186, 4192, 8110, 15658, 30253, 58546, 113307, 219759, 426180, 827702, 1608668, 3129211, 6091437, 11868599, 23140878, 45150717, 88157689, 172235073, 336717854, 658662065, 1289149627, 2524532330
Offset: 1

Views

Author

Robert G. Wilson v, Dec 29 2006

Keywords

Crossrefs

Programs

  • Mathematica
    SemiPrimePi[n_] := Sum[ PrimePi[ n/Prime@i] - i + 1, {i, PrimePi@ Sqrt@n}]; Table[ SemiPrimePi[2^n], {n, 47}]
  • PARI
    a(n)=my(s,i,N=2^n); forprime(p=2, sqrtint(N), s+=primepi(N\p); i++); s - i * (i-1)/2 \\ Charles R Greathouse IV, May 12 2013
    
  • Perl
    use ntheory ":all"; print "$ ",semiprime_count(1 << $),"\n" for 1..48; # Dana Jacobsen, Sep 10 2018

Formula

a(n) = A072000(2^n). - R. J. Mathar, Aug 26 2011

A040014 Number of primes < e^n.

Original entry on oeis.org

0, 1, 4, 8, 16, 34, 79, 183, 429, 1019, 2466, 6048, 14912, 37128, 93117, 234855, 595341, 1516233, 3877186, 9950346, 25614562, 66124777, 171141897, 443963543, 1154106844, 3005936865, 7842921261, 20496470801, 53645077679, 140599114669, 368973074565, 969455391690, 2550043255883
Offset: 0

Views

Author

Keywords

Comments

a(n) = A000720(A000149(n)). - Reinhard Zumkeller, Mar 17 2015

Crossrefs

Programs

  • Haskell
    a040014 = a000720 . a000149  -- Reinhard Zumkeller, Mar 17 2015
  • Mathematica
    Table[PrimePi[Exp[n]], {n, 0, 33}]

Extensions

a(27)-a(29) from Robert G. Wilson v, Jun 09 2000
a(30)-a(32) from Seiichi Manyama, May 04 2016
Previous Showing 41-50 of 140 results. Next