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 31-40 of 118 results. Next

A120041 Number of 10-almost primes k such that 2^n < k <= 2^(n+1).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 5, 8, 22, 47, 103, 233, 487, 1072, 2246, 4803, 10202, 21440, 45115, 94434, 197891, 412010, 858846, 1783610, 3700698, 7665755, 15853990, 32750248, 67564405, 139238488, 286625278, 589472979, 1211146741, 2486322304
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    AlmostPrimePi[k_Integer, n_] := Module[{a, i}, a[0] = 1; If[k == 1, PrimePi[n], Sum[PrimePi[n/Times @@ Prime[Array[a, k - 1]]] - a[k - 1] + 1, Evaluate[ Sequence @@ Table[{a[i], a[i - 1], PrimePi[(n/Times @@ Prime[Array[a, i - 1]])^(1/(k - i + 1))]}, {i, k - 1}]]]]]; (* Eric W. Weisstein, Feb 07 2006 *)
    t = Table[AlmostPrimePi[10, 2^n], {n, 0, 39}]; Rest@t - Most@t
  • Python
    from math import isqrt, prod
    from sympy import primerange, integer_nthroot, primepi
    def A120041(n):
        def g(x,a,b,c,m): yield from (((d,) for d in enumerate(primerange(b,isqrt(x//c)+1),a)) if m==2 else (((a2,b2),)+d for a2,b2 in enumerate(primerange(b,integer_nthroot(x//c,m)[0]+1),a) for d in g(x,a2,b2,c*b2,m-1)))
        def almostprimepi(n,k): return int(sum(primepi(n//prod(c[1] for c in a))-a[-1][0] for a in g(n,0,1,1,k)) if k>1 else primepi(n))
        return -almostprimepi(m:=1<Chai Wah Wu, Aug 31 2024

Formula

a(n) ~ 2^n log^9 n/(725760 n log 2). [Charles R Greathouse IV, Dec 28 2011]

A120042 Number of 11-almost primes 11ap such that 2^n < 11ap <= 2^(n+1).

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 5, 8, 22, 47, 103, 234, 490, 1078, 2261, 4844, 10294, 21659, 45609, 95580, 200422, 417715, 871452, 1811412, 3761623, 7798409, 16142081, 33373093, 68906782, 142120436, 292797806, 602653984, 1239225631
Offset: 0

Views

Author

Keywords

Comments

The partial sum equals the number of Pi_11(2^n).

Examples

			(2^11, 2^12] there is one semiprime, namely 3072. 2048 was counted in the previous entry.
		

Crossrefs

Programs

  • Mathematica
    AlmostPrimePi[k_Integer, n_] := Module[{a, i}, a[0] = 1; If[k == 1, PrimePi[n], Sum[PrimePi[n/Times @@ Prime[Array[a, k - 1]]] - a[k - 1] + 1, Evaluate[ Sequence @@ Table[{a[i], a[i - 1], PrimePi[(n/Times @@ Prime[Array[a, i - 1]])^(1/(k - i + 1))]}, {i, k - 1}]]]]]; (* Eric W. Weisstein, Feb 07 2006 *)
    t = Table[AlmostPrimePi[11, 2^n], {n, 0, 30}]; Rest@t - Most@t
  • Python
    from math import isqrt, prod
    from sympy import primerange, integer_nthroot, primepi
    def A120042(n):
        def g(x, a, b, c, m): yield from (((d, ) for d in enumerate(primerange(b, isqrt(x//c)+1), a)) if m==2 else (((a2, b2), )+d for a2, b2 in enumerate(primerange(b, integer_nthroot(x//c, m)[0]+1), a) for d in g(x, a2, b2, c*b2, m-1)))
        def almostprimepi(n, k): return int(sum(primepi(n//prod(c[1] for c in a))-a[-1][0] for a in g(n, 0, 1, 1, k)) if k>1 else primepi(n))
        return -almostprimepi(m:=1<Chai Wah Wu, Jun 17 2025

A095298 Sum of 1-bits between the most and least significant bits summed for all primes in range ]2^n,2^(n+1)].

Original entry on oeis.org

0, 1, 2, 8, 15, 30, 67, 154, 302, 611, 1280, 2546, 5207, 10447, 21123, 42783, 85726, 173102, 347243, 698544, 1401784, 2813930, 5644165, 11328192, 22712057, 45538473, 91288241, 182965151, 366691833, 734702678, 1471976078, 2948741819
Offset: 1

Views

Author

Antti Karttunen, Jun 04 2004

Keywords

Comments

Ratio a(n)/A036378(n) (i.e. average number of 1-bits in range ]most significant bit,least significant bit[ of primes p which 2^n < p < 2^(n+1)) grows as: 0, 0.5, 1, 1.6, 2.142857, 2.307692, 2.913043, 3.581395, 4.026667, 4.459854, 5.019608, 5.487069, 5.97133, 6.480769, 6.971287, 7.493957, 7.975254, 8.489554, 8.987783, 9.492893, 9.98877, 10.491283, 10.987107, 11.49116, 11.990823, 12.490859, 12.990533, 13.491108, 13.991985, 14.491881, 14.992221, 15.492331, 15.992713.
Ratio of that average compared to (n-1)/2 (the expected value of that same sum computed for all odd numbers in the same range) converges as: 1, 1, 1, 1.066667, 1.071429, 0.923077, 0.971014, 1.023256, 1.006667, 0.991079, 1.003922, 0.997649, 0.995222, 0.997041, 0.995898, 0.999194, 0.996907, 0.998771, 0.998643, 0.999252, 0.998877, 0.99917, 0.998828, 0.999231, 0.999235, 0.999269, 0.999272, 0.999341, 0.999427, 0.99944, 0.999481, 0.999505, 0.999545.

Examples

			a(1)=0, as only prime in range ]2,4] is 3, 11 in binary which has no space between its most and least significant bits. a(2)=1, as in that range there are two primes 5 (101 in binary) and 7 (111 in binary) and summing their middle bits we get 1. a(3)=2, as there are again two primes, 11 (1011 in binary) and 13 (1101 in binary) and summing the bits in the middle we get total 2.
		

Crossrefs

A095297, A095334. Cf. also A095353 (similar sums and ratios computed in Fibonacci number system).

A036382 Odd split numbers: have a nontrivial factorization n=ab with a and b coprime, so that L(a) + L(b) <= L(n), where L(x) = A029837(x) = ceiling(log_2(x)).

Original entry on oeis.org

21, 33, 35, 39, 65, 69, 75, 77, 87, 91, 93, 105, 129, 133, 135, 141, 143, 145, 147, 155, 159, 161, 165, 175, 177, 183, 189, 195, 203, 217, 259, 261, 265, 267, 273, 275, 279, 285, 287, 291, 295, 297, 299, 301, 303, 305, 309, 315, 319, 321, 325, 327, 329, 339
Offset: 1

Views

Author

Keywords

Comments

All even numbers are split numbers, except that prime powers -- here powers of 2 -- are by definition excluded.
The gaps g(n) = a(n+1) - a(n) are growing up to some local maximum before suddenly dropping down to a very small value and starting a new cycle of growth. The local maxima, distinctly seen as kinks in the graph, are g(1) = 12, g(4) = 26, g(12) = 24, g(30) = 42, g(70) = 48, g(157) = 110, g(348) = 96, g(748) = 160, g(1603) = 192, g(3379) = 446, g(7076) = 384, ... They occur at indices slightly larger than twice the preceding one; every other is of size 6*2^k, k = 1,2,3,... while those in between don't seem to follow a simple pattern and are sometimes larger than the subsequent gap of size 6*2^k. - M. F. Hasler, Apr 15 2017

Examples

			s = 39 is a split number since s = 39 = 3*13, gcd(3,13)=1 and L(3) + L(13) = 2 + 4 = L(39).
		

Crossrefs

Programs

  • Mathematica
    Select[Range[1, 340, 2], Function[n, Total@ Boole@ Map[And[Total@ Ceiling@ Log2@ # <= Ceiling@ Log2@ n, CoprimeQ @@ #] &, Map[{#, n/#} &, Rest@ Take[#, Ceiling[Length[#]/2]]]] > 0 &@ Divisors@ n]] (* Michael De Vlieger, Mar 03 2017 *)

Extensions

Name corrected by Michael De Vlieger, Mar 03 2017

A095005 Number of odious primes (A027697) in range ]2^n,2^(n+1)].

Original entry on oeis.org

0, 1, 2, 2, 5, 8, 19, 20, 48, 75, 160, 242, 505, 835, 1761, 2799, 5890, 10250, 20921, 36872, 74316, 134816, 267749, 492286, 977207, 1823657, 3598657, 6779899, 13336543, 25358424, 49763462, 95140695, 186504600, 358630024, 702300885, 1356118149, 2654709953, 5142968571
Offset: 1

Views

Author

Antti Karttunen and Labos Elemer, Jun 01 2004

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Count[Prime@ Range[PrimePi[2^n] + 1, PrimePi[2^(n + 1) - 1]], k_ /; OddQ@ First@ DigitCount[k, 2]], {n, 24}] (* Michael De Vlieger, Feb 25 2017 *)
  • PARI
    a(n) = #select(x->((hammingweight(x)%2)==1),primes([2^n+1,2^(n+1)])); \\ Michel Marcus, Feb 26 2017

Formula

a(n) = A036378(n) - A095006(n).

Extensions

a(34)-a(38) from Amiram Eldar, Jun 20 2024

A095006 Number of evil primes (A027699) in range ]2^n,2^(n+1)].

Original entry on oeis.org

1, 1, 0, 3, 2, 5, 4, 23, 27, 62, 95, 222, 367, 777, 1269, 2910, 4859, 10140, 17714, 36714, 66020, 133400, 245959, 493532, 916913, 1822087, 3428633, 6782008, 12870735, 25339113, 48419194, 95194890, 182818705, 358637144, 691891351, 1355985684, 2625053871, 5142673207
Offset: 1

Views

Author

Antti Karttunen and Labos Elemer, Jun 01 2004

Keywords

Examples

			From _Michael De Vlieger_, Feb 27 2017: (Start)
a(2) = 1 since between 2^2 and 2^3 only the prime 5 (binary 11) has an even number of 1s.
a(3) = 0 since none of the primes between 2^3 and 2^4 have an even number of 1s in their binary expansions.
a(4) = 3 since the primes 17, 23, and 29 have an even number of 1s in their binary expansions (i.e., 10001, 10111, 11101). (End)
		

Crossrefs

Programs

  • Mathematica
    Table[m = Count[Prime@ Range[PrimePi[2^n] + 1, PrimePi[2^(n + 1) - 1]], k_ /; EvenQ@ DigitCount[k, 2, 1]]; Print@ m; m, {n, 24}] (* Michael De Vlieger, Feb 27 2017 *)

Formula

a(n) = A036378(n) - A095005(n).

Extensions

a(34)-a(38) from Amiram Eldar, Jun 20 2024

A095060 Number of fibeven primes (A095080) in range ]2^n,2^(n+1)].

Original entry on oeis.org

1, 2, 2, 3, 3, 9, 16, 25, 50, 83, 150, 286, 540, 975, 1865, 3515, 6588, 12620, 23835, 45486, 86811, 165822, 317770, 608517, 1170182, 2254124, 4342530, 8383468, 16197159, 31335332, 60680818, 117633364, 228260489, 443281943, 861677274
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Crossrefs

Formula

a(n) = A036378(n) - A095061(n) = A095062(n) + A095067(n).

Extensions

a(34)-a(35) from Amiram Eldar, Jun 13 2024

A095061 Number of fibodd primes (A095081) in range [2^n,2^(n+1)].

Original entry on oeis.org

0, 0, 0, 2, 4, 4, 7, 18, 25, 54, 105, 178, 332, 637, 1165, 2194, 4161, 7770, 14800, 28100, 53525, 102394, 195938, 377301, 723938, 1391620, 2684760, 5178439, 10010119, 19362205, 37501838, 72702221, 141062816, 273985225, 532514962
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Crossrefs

Formula

a(n) = A036378(n) - A095060(n) = A095066(n) + A095069(n).

Extensions

a(34)-a(35) from Amiram Eldar, Jun 13 2024

A095297 Number of A095287-primes in range ]2^n,2^(n+1)].

Original entry on oeis.org

0, 1, 0, 2, 2, 8, 7, 22, 27, 68, 80, 235, 343, 844, 1180, 2849, 4473, 10138, 15387, 37023, 58714, 134477, 213397, 494625, 802311, 1829183, 2965114, 6789809, 11185644, 25412867, 42048314, 95440507, 159433693
Offset: 1

Views

Author

Antti Karttunen, Jun 04 2004

Keywords

Comments

Ratios a(n)/A036378(n) converge as: 0, 0.5, 0, 0.4, 0.285714, 0.615385, 0.304348, 0.511628, 0.36, 0.49635, 0.313725, 0.506466, 0.393349, 0.523573, 0.389439, 0.499037, 0.416132, 0.497205, 0.398266, 0.503126, 0.418382, 0.501376, 0.415405, 0.501741, 0.42358, 0.501731, 0.421943, 0.500653, 0.426814, 0.501264, 0.428266, 0.501433, 0.431691
Ratios a(n)/A095334(n) converge as: 1, 1, 1, 0.666667, 0.666667, 1.6, 1.75, 1.047619, 0.84375, 0.985507, 0.833333, 1.026201,1.023881, 1.098958, 1.057348, 0.996154, 1.023336, 0.98888, 0.993351,1.012581, 1.011595, 1.005518, 1.016781, 1.006987, 1.008436, 1.006948,1.004514, 1.002615, 1.003668, 1.00507, 1.006392, 1.005748, 1.004982

Crossrefs

a(n) = A036378(n)-A095296(n). Cf. A095298.

A095741 Number of base-2 palindromic primes (A016041) in range [2^2n,2^(2n+1)].

Original entry on oeis.org

2, 2, 3, 3, 7, 12, 23, 40, 94, 142, 271, 480, 856, 1721, 3099, 5572, 10799, 20782, 39468, 72672, 139867, 274480, 520376, 986318, 1914097, 3726617, 7107443, 13682325, 26430797, 51412565, 99204128, 190457946, 372035117, 727434192, 1407026351, 2724590109, 5315491839
Offset: 1

Views

Author

Antti Karttunen, Jun 12 2004

Keywords

Comments

Note that there are no such primes in any range ]2^(2n-1),2^2n], as all even-length binary palindromes are divisible by 3 (cf. A048702).
The ratio a(n)/A036378(2n) converges as follows: 1, 0.4, 0.230769, 0.069767, 0.051095, 0.025862, 0.014268, 0.007006, 0.00461, 0.00193, 0.00101, 0.000487, 0.000235, 0.000127, 0.000061, 0.000029

Crossrefs

Bisection of the first diagonal of triangle A095759.

Programs

  • Mathematica
    palindromicQ[n_, b_:10] := TrueQ[IntegerDigits[n, b] == Reverse[IntegerDigits[n, b]]]; Table[Length[Select[Range[2^(2n), 2^(2n + 1)], palindromicQ[#, 2] && PrimeQ[#] &]], {n, 10}] (* Alonso del Arte, Jan 13 2012 *)
  • PARI
    m=vector(65536);u=vector(#m);u[1]=1;for(b=1,#m-1,c=b;e=2^floor(log(b+.5)/log(2));d=0;u[b+1]=e;while(c>0,d=d+e*(c%2);c=floor(c/2);e=e/2);m[b+1]=d);for(x=0,31,h=0;y=2^x;for(w=y,2*y-1,if(x<16,v1=4*y*w+m[w+1];v2=v1+2*y,w1=floor(w/65536);w2=w-65536*w1;v1=262144*y*w1+4*y*w2+65536*u[w1+1]/u[w2+1]*m[w2+1]+m[w1+1];v2=v1+2*y);if(isprime(v1),h++);if(isprime(v2),h++));print(2*x+3" bits: "h)) \\ Martin Raab, Jan 13 2012

Formula

a(n) = A117773(2*n+1). - Chai Wah Wu, Jul 05 2019

Extensions

a(27)-a(32) from Martin Raab, Oct 20 2015
a(33)-a(35) from Chai Wah Wu, Jul 05 2019
a(36)-a(37) from Chai Wah Wu, Jul 11 2019
Previous Showing 31-40 of 118 results. Next