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

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

Views

Author

Gus Wiseman, May 31 2024

Keywords

Comments

Sum of k such that 2^n+1 <= prime(k) <= 2^(n+1).

Examples

			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
		

Crossrefs

For indices of primes between powers of 2:
- sum A373124 (this sequence)
- length A036378
- min A372684 (except initial terms), delta A092131
- max A007053
For primes between powers of 2:
- sum A293697
- length A036378
- min A104080 or A014210
- max A014234, delta A013603
For squarefree numbers between powers of 2:
- sum A373123
- length A077643, run-lengths of A372475
- min A372683, delta A373125, indices A372540
- max A372889, delta A373126, indices A143658

Programs

  • Mathematica
    Table[Total[PrimePi/@Select[Range[2^(n-1)+1,2^n],PrimeQ]],{n,10}]
  • PARI
    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

Views

Author

Gus Wiseman, Nov 30 2024

Keywords

Comments

Prime powers are listed by A246655.
Conjecture: All terms except 9 are prime. Hence this is the same as A014210 after 9. Confirmed up to n = 1000.

Crossrefs

Subtracting 2^n appears to give A013597 except at term 3.
For prime we have A014210.
For previous we have A014234.
For perfect power we have A357751.
For squarefree we have A372683.
A000015 gives the least prime power >= n.
A000040 lists the primes, differences A001223.
A000961 and A246655 list the prime powers, differences A057820.
A024619 and A361102 list the non prime powers, diffs A375708 and A375735.
A031218 gives the greatest prime power <= n.
A244508 counts prime powers between powers of 2.
Prime powers between primes are counted by A080101 and A366833.

Programs

  • Mathematica
    Table[NestWhile[#+1&,2^n+1,!PrimePowerQ[#]&],{n,0,20}]
  • PARI
    a(n) = my(x=2^n+1); while (!isprimepower(x), x++); x; \\ Michel Marcus, Dec 03 2024
  • Python
    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

Views

Author

Jorge Coveiro, Apr 05 2004

Keywords

Comments

For n=0 we just take a(0)=2, the least prime >= 2^0, as there is no prime <= 2^0. - Robert Israel, Nov 01 2018

Crossrefs

Programs

  • Maple
    [2, seq( (nextprime(2^x-1)+prevprime(2^x+1)),x=1..20)]; # Corrected by Robert Israel, Nov 01 2018
  • Mathematica
    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 *)

Formula

a(n) = A014210(n) + A014234(n) for n >= 2. - Robert Israel, Nov 01 2018

Extensions

More terms from 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

Views

Author

Michael S. Branicky, May 09 2022

Keywords

Comments

A prime ladder (in base b) starts with a prime, ends with a prime, and each step produces a new prime by changing exactly one base-b digit.
A shortest such construct between two given primes is optimal.
Analogous to a word ladder (see Wikipedia link).
Here, n-digit primes do not allow leading 0 digits.
If all n-digit primes are disconnected, a(n) = 1; if there are no n-digit primes, a(n) = 0.

Examples

			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.
		

Crossrefs

Formula

a(n) is the number of vertices of a longest shortest path in the graph G = (V, E), where V = {n-digit base-2 primes} and E = {(v, w) | H_2(v, w) = 1}, where H_b is the Hamming distance in base b.

Extensions

a(23) from Michael S. Branicky, May 21 2022

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

Views

Author

Hartmut F. W. Hoft, Aug 29 2023

Keywords

Comments

Every number a(n) has the form 2^(2*i + 1) * s^2, i>= 0 and s odd, the single middle divisor of a(n) is sqrt(a(n)/2), and sqrt(2*a(n)) - 1 = floor((sqrt(8*n + 1) - 1)/2) = A003056(a(n)).
The least number in the sequence with 3 odd prime divisors is a(126) = 1630818 = 2^1 * 3^2 * 7^2 * 43^2.
Conjecture: Let a(n) = 2^(2i+1) * s^2, i>=0 and s odd, be a number in the sequence.
(1) For any odd prime divisor p of s, number a(n) * p^2 is in the sequence.
(2) For any odd prime p not a divisor of s, number a(n) * p^2 is in the sequence if p satisfies sqrt(2*a(n)) < p < 2*a(n).

Examples

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

Crossrefs

Intersection of A361903 and A361905.
Also subsequence of the following sequences: A001105, A071562, A238443 = A174973, A319796, A320137.
The powers of 2 with an odd index (A004171) form a subsequence.

Programs

  • Mathematica
    (* 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}]

A375235 Records of A112591.

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

Views

Author

Bill McEachen, Aug 06 2024

Keywords

Comments

Sequence closely parallel to A000295.

Examples

			The first term of A112591 = 1 is a record and is a(1). The next A112591 value > 1 is 6 which is a(2).
		

Crossrefs

Cf. A000295, A014210 (primes where records occur), A014234, A112591.

Programs

  • Mathematica
    a[n_] := BitXor @@ NextPrime[2^n, {-1, 1}]; a[1] = 1; Array[a, 33] (* Amiram Eldar, Aug 08 2024 *)
  • PARI
    a(n)= if(n==1,1,bitxor(precprime(2^n), nextprime(2^n) ))

Formula

a(n) = previous_prime(2^n) XOR next_prime(2^n) = A112591(A014234(n)) for n > 1.

Extensions

More terms from Amiram Eldar, Aug 06 2024

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

Views

Author

Cino Hilliard, Apr 28 2007

Keywords

Comments

A014234(a(n)) is in A001097 (twin primes).

Examples

			For n=5, 31 is the greatest prime < 2^5 and is a member of the twin prime pair 29, 31.
		

Programs

  • Mathematica
    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 *)
  • PARI
    g(n,b)=for(x=1,n,y=precprime(b^x);if(ispseudoprime(y-2),print1(x",")))

Extensions

Edited by and terms a(15)-a(17) from Ray Chandler, May 12 2007
a(18), a(19) Donovan Johnson, Feb 21 2008

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

Views

Author

Michel Marcus, Apr 16 2020

Keywords

Crossrefs

Cf. A175330.
Subsequence of A014234 (largest prime <= 2^n).
Cf. A214415 (exponents of corresponding powers of 2).

Programs

  • Mathematica
    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 *)
  • PARI
    isok(p) = isprime(p) && (bitand(p, nextprime(p+1)) == 1);

Extensions

a(9)-a(10) from Amiram Eldar, Apr 16 2020
a(11)-a(19) from Giovanni Resta, Apr 16 2020
Previous Showing 51-58 of 58 results.