A373124
Sum of indices of primes between powers of 2.
Original entry on oeis.org
1, 2, 7, 11, 45, 105, 325, 989, 3268, 10125, 33017, 111435, 369576, 1277044, 4362878, 15233325, 53647473, 189461874, 676856245, 2422723580, 8743378141, 31684991912, 115347765988, 421763257890, 1548503690949, 5702720842940, 21074884894536, 78123777847065
Offset: 0
Row-sums of the sequence of all positive integers as a triangle with row-lengths A036378:
1
2
3 4
5 6
7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25 26 27 28 29 30 31
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
For indices of primes between powers of 2:
For primes between powers of 2:
For squarefree numbers between powers of 2:
Cf.
A000040,
A000120,
A014499,
A029837,
A029931,
A035100,
A069010,
A070939,
A112925,
A112926,
A211997.
-
Table[Total[PrimePi/@Select[Range[2^(n-1)+1,2^n],PrimeQ]],{n,10}]
-
ip(n) = primepi(1<A007053
t(n) = n*(n+1)/2; \\ A000217
a(n) = t(ip(n+1)) - t(ip(n)); \\ Michel Marcus, May 31 2024
A378252
Least prime power > 2^n.
Original entry on oeis.org
2, 3, 5, 9, 17, 37, 67, 131, 257, 521, 1031, 2053, 4099, 8209, 16411, 32771, 65537, 131101, 262147, 524309, 1048583, 2097169, 4194319, 8388617, 16777259, 33554467, 67108879, 134217757, 268435459, 536870923, 1073741827, 2147483659, 4294967311, 8589934609
Offset: 0
Subtracting 2^n appears to give
A013597 except at term 3.
A000015 gives the least prime power >= n.
A031218 gives the greatest prime power <= n.
A244508 counts prime powers between powers of 2.
Cf.
A007918,
A037035,
A053707,
A059305,
A065514,
A069584,
A151800,
A304521,
A377051,
A377282,
A377283,
A377289,
A377432,
A378249.
-
Table[NestWhile[#+1&,2^n+1,!PrimePowerQ[#]&],{n,0,20}]
-
a(n) = my(x=2^n+1); while (!isprimepower(x), x++); x; \\ Michel Marcus, Dec 03 2024
-
from itertools import count
from sympy import primefactors
def A378252(n): return next(i for i in count(1+(1<Chai Wah Wu, Dec 02 2024
A092507
(Smallest prime >= 2^n) + (largest prime <= 2^n).
Original entry on oeis.org
2, 4, 8, 18, 30, 68, 128, 258, 508, 1030, 2052, 4092, 8192, 16400, 32792, 65520, 131058, 262172, 524286, 1048596, 2097156, 4194312, 8388620, 16777210, 33554472, 67108860, 134217738, 268435446, 536870858, 1073741832, 2147483616
Offset: 0
-
[2, seq( (nextprime(2^x-1)+prevprime(2^x+1)),x=1..20)]; # Corrected by Robert Israel, Nov 01 2018
-
PrevPrim[n_] := Block[{k = n - 1}, While[ !PrimeQ[k], k-- ]; k]; NextPrim[n_] := Block[{k = n + 1}, While[ !PrimeQ[k], k++ ]; k]; Table[PrevPrim[2^n+1] + NextPrim[2^n-1], {n, 31}] (* Robert G. Wilson v, Apr 14 2004 *)
A353738
Length of longest n-digit optimal prime ladder (base 2).
Original entry on oeis.org
0, 2, 2, 1, 5, 3, 7, 5, 15, 15, 19, 24, 39, 48, 35, 64, 57, 51, 59, 61, 67, 61, 61
Offset: 1
There are no 1-digit primes in base 2, so a(1) = 0.
The 2-digit optimal prime ladder 10 - 11 is tied for the longest amongst 2-digit primes in binary, so a(2) = 2.
The 3-digit optimal prime ladder 101 - 111 is tied for the longest amongst 3-digit primes in binary, so a(3) = 2.
The only 4-digit primes in binary, 1011 and 1101, are disconnected, so a(3) = 1.
The 5-digit optimal prime ladder 10001 - 10011 - 10111 - 11111 - 11101 is tied for the longest amongst 5-digit primes in binary, so a(5) = 5.
A365265
Numbers k for which sqrt(k/2) divides k and the symmetric representation of sigma(k) consists of a single part and its width at the diagonal equals 1.
Original entry on oeis.org
2, 8, 18, 32, 128, 162, 200, 392, 512, 882, 968, 1352, 1458, 2048, 2178, 3042, 3872, 5000, 5202, 5408, 6498, 8192, 9248, 9522, 11552, 13122, 15138, 16928, 17298, 19208, 26912, 30752, 32768, 36992, 43218, 43808, 46208, 53792, 58482, 59168, 67712, 70688
Offset: 1
a(5) = 128 = 2^7 has 2^3 as its single middle divisor, and its symmetric representation of sigma consists of one part of width 1.
a(10) = 882 = 2 * 3^2 * 7^2 has 3 * 7 as its single middle divisor, its symmetric representation of sigma is the smallest in this sequence of maximum width 3, consists of one part, and has width 1 at the diagonal.
A table of ranges for the single odd prime factor p for numbers k in the sequence having the form 2^(2i+1) * p^(2j), i>=0 and j>0, indexed by exponent 2i+1 of 2 in number k. The lower bound is A014210(i+1) and the upper bound is A014234(2(i+1)) = A104089(i+1):
---------------------
2i+1 /---- p ----/
---------------------
1 3 .. 3
3 5 .. 13
5 11 .. 61
7 17 .. 251
9 37 .. 1021
...
The powers of 2 with an odd index (
A004171) form a subsequence.
Cf.
A003056,
A014210,
A014234,
A104089,
A235791,
A237048,
A237270,
A237271,
A237593,
A249223,
A250068.
-
(* a2[ ] and its support functions are defined in A249223 *)
a365265Q[n_] := Module[{list=If[Divisible[n, Sqrt[n/2]], a2[n], {0}]}, Last[list]==1&&AllTrue[list, #>0&]]
a365265[{m_, n_}] := Select[Range[m, n], a365265Q]
a365265[{1,75000}]
Original entry on oeis.org
1, 6, 12, 28, 58, 126, 252, 506, 1012, 2042, 4082, 8190, 16366, 32742, 65518, 131056, 262114, 524280, 1048554, 2097146, 4194278, 8388594, 16777208, 33554390, 67108858, 134217716, 268435396, 536870852, 1073741814, 2147483614, 4294967284, 8589934580, 17179869158
Offset: 1
The first term of A112591 = 1 is a record and is a(1). The next A112591 value > 1 is 6 which is a(2).
-
a[n_] := BitXor @@ NextPrime[2^n, {-1, 1}]; a[1] = 1; Array[a, 33] (* Amiram Eldar, Aug 08 2024 *)
-
a(n)= if(n==1,1,bitxor(precprime(2^n), nextprime(2^n) ))
A128945
Numbers n such that the greatest prime < 2^n is a twin prime member.
Original entry on oeis.org
2, 3, 4, 5, 6, 10, 12, 16, 20, 149, 150, 476, 594, 788, 1574, 1664, 1691, 6117, 6242
Offset: 1
For n=5, 31 is the greatest prime < 2^5 and is a member of the twin prime pair 29, 31.
-
Select[Range[1700],AnyTrue[NextPrime[2^#,-1]+{2,-2},PrimeQ]&] (* The program generates the first 17 terms of the sequence. *) (* Harvey P. Dale, Mar 26 2025 *)
-
g(n,b)=for(x=1,n,y=precprime(b^x);if(ispseudoprime(y-2),print1(x",")))
Edited by and terms a(15)-a(17) from
Ray Chandler, May 12 2007
A334150
Primes p such that p AND q = 1, where q is the next prime after p and AND is the bitwise operation.
Original entry on oeis.org
3, 13, 61, 251, 4093, 32749, 65521, 8388593, 33554393, 1073741789, 137438953447, 9007199254740881, 36028797018963913, 144115188075855859, 147573952589676412909, 37778931862957161709471, 75557863725914323419121, 2417851639229258349412301, 4835703278458516698824647
Offset: 1
Subsequence of
A014234 (largest prime <= 2^n).
Cf.
A214415 (exponents of corresponding powers of 2).
-
s = {}; p = 2; Do[q = NextPrime[p]; If[BitAnd[p, q] == 1, AppendTo[s, p]]; p = q, {10^5}]; s (* Amiram Eldar, Apr 16 2020 *)
Select[ NextPrime[ 2^Range[82], -1], BitAnd[#, NextPrime@ #] == 1 &] (* Giovanni Resta, Apr 16 2020 *)
-
isok(p) = isprime(p) && (bitand(p, nextprime(p+1)) == 1);
Comments