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-39 of 39 results.

A037035 Least k such that 2^n+1+k is a prime.

Original entry on oeis.org

0, 0, 0, 2, 0, 4, 2, 2, 0, 8, 6, 4, 2, 16, 26, 2, 0, 28, 2, 20, 6, 16, 14, 8, 42, 34, 14, 28, 2, 10, 2, 10, 14, 16, 24, 52, 30, 8, 6, 22, 14, 26, 14, 28, 6, 58, 14, 4, 20, 68, 54, 20, 20, 4, 158, 2, 80, 8, 68, 130, 32, 14, 134, 28, 12, 130, 8, 2, 32, 28, 24, 10, 14, 28, 36, 32, 14
Offset: 0

Views

Author

Keywords

Examples

			a(5)=4 because 2^5+1+4=37 that is a prime.
		

Crossrefs

Cf. A016014.
A013597(n) - 1.

Programs

  • PARI
    a(n) = k = 0; while (! isprime(2^n+k+1), k++); k; \\ Michel Marcus, Sep 27 2013

Extensions

More terms from Erich Friedman

A129786 Least k such that 2^(2^n)+k is prime.

Original entry on oeis.org

0, 1, 1, 1, 1, 15, 13, 51, 297, 75, 643, 981, 1761, 897, 2775, 118113, 44061, 5851, 18531, 189093, 69661
Offset: 0

Views

Author

Benoit Cloitre, May 18 2007

Keywords

Comments

It is conjectured that a(n)>=3 for n>=5.
For n>11, 2^(2^n)+a(n) is a probable prime. By a comment in A000215, a(n) is not 2^m+1 for any m > 1. - T. D. Noe, Jul 19 2007

Crossrefs

Cf. A013597 (least k>0 such that 2^n+k is prime).

Programs

  • Mathematica
    a[n_] := Module[{k = 0}, While[! PrimeQ[2^(2^n) + k], k++]; k]; Array[a, 12, 0] (* Amiram Eldar, Jun 11 2022 *)
  • PARI
    a(n)=if(n<0,0,s=0;while(isprime(2^(2^n)+s)==0,s++);s)
    
  • Python
    from sympy import nextprime
    def a(n): m = 2**(2**n); return nextprime(m-1) - m
    print([a(n) for n in range(12)]) # Michael S. Branicky, Jun 12 2022

Extensions

More terms from T. D. Noe, Jul 19 2007
a(18)-a(19) by Makoto Morimoto, added by Boyan Hu, Jul 05 2025
a(20) by Boyan Hu, Jul 05 2025

A329736 Smallest odd prime P such that P*3*2^n - 1 and P*3*2^n + 1 are twin primes.

Original entry on oeis.org

3, 5, 3, 5, 43, 11, 3, 19, 17, 5, 113, 59, 317, 331, 307, 241, 127, 829, 23, 149, 127, 11, 3023, 1091, 787, 971, 1523, 2741, 727, 1051, 227, 211, 727, 89, 1163, 71, 367, 1031, 577, 89, 1213, 1151, 3, 1021, 283, 2699, 4933, 59, 647, 709, 3083, 541, 1483, 2069
Offset: 1

Views

Author

Pierre CAMI, Nov 20 2019

Keywords

Examples

			3*3*2^1 - 1 =  17,  17 and  19 are twin primes so a(1)=3.
5*3*2^2 - 1 =  59,  59 and  61 are twin primes so a(2)=5.
3*3*2^3 - 1 =  71,  71 and  73 are twin primes so a(3)=3.
5*3*2^4 - 1 = 119, 119 and 121 are twin primes so a(4)=5.
		

Crossrefs

Programs

  • Mathematica
    Array[Block[{p = 3}, While[! AllTrue[3 p*2^# + {-1, 1}, PrimeQ], p = NextPrime@ p]; p] &, 54] (* Michael De Vlieger, Nov 21 2019 *)
  • PARI
    for(n=1,54,my(m=3*2^n);forprime(k=3,oo,my(j=k*m);if(ispseudoprime(j-1)&&ispseudoprime(j+1),print1(k,", ");break))) \\ Hugo Pfoertner, Nov 21 2019
    
  • PARI
    a(n) = my(p=3, q); while (!isprime(q=p*3*2^n - 1) || !isprime(q+2), p = nextprime(p+1)); p; \\ Michel Marcus, May 06 2020

A360080 Smallest k such that 2^(2^n) + k is a safe prime.

Original entry on oeis.org

1, 7, 7, 7, 91, 3103, 12451, 230191, 286867, 1657867, 10029811, 29761351, 22410151, 98402791, 167137543
Offset: 1

Views

Author

Mark Andreas, Jan 25 2023

Keywords

Comments

a(n) == 3 (mod 4) for n > 1. - Chai Wah Wu, Jan 27 2023

Examples

			a(3) = 7 because 2^(2^3) + 7 = 263 is the smallest safe prime greater than 256.
		

Crossrefs

Programs

  • PARI
    a(n) = {my(k=1); pow2 = 2^(2^n);   while (!(isprime(pow2 + k) && isprime((pow2 + k - 1)/2)), k+=2); k;} \\
    
  • Python
    from sympy import isprime, nextprime
    def A360080(n):
        if n <= 1: return 1
        m = 1<<(1<Chai Wah Wu, Jan 27 2023

Formula

a(n) = A350696(2^n).

A360081 Smallest k such that 2^(3*2^n) + k is a safe prime.

Original entry on oeis.org

3, 19, 31, 691, 907, 2887, 15943, 69283, 216127, 1108831, 8344423, 10976347, 166965391, 385465771, 26580643
Offset: 0

Views

Author

Mark Andreas, Jan 25 2023

Keywords

Comments

a(n) == 3 (mod 4). - Chai Wah Wu, Jan 27 2023

Examples

			a(1) = 19 because 2^(3*2^1)+19 = 2^6+19 = 83 is the smallest safe prime greater than 64.
		

Crossrefs

Programs

  • PARI
    a(n) = {my(k=1); pow2 = 2^(3*2^n); while (!(isprime(pow2 + k) && isprime((pow2 + k - 1)/2)), k+=2); k;} \\
    
  • Python
    from sympy import isprime, nextprime
    def A360081(n):
        m = 1<<3*(1<Chai Wah Wu, Jan 27 2023

Formula

a(n) = A350696(3*2^n).

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
    

A074717 Least k such that floor(2^n/k) is prime.

Original entry on oeis.org

1, 2, 3, 3, 6, 9, 11, 11, 7, 9, 5, 10, 19, 11, 5, 10, 9, 11, 22, 35, 39, 9, 5, 10, 20, 27, 11, 19, 9, 18, 36, 25, 29, 27, 5, 10, 20, 40, 61, 13, 21, 42, 29, 27, 39, 9, 17, 29, 58, 49, 27, 25, 50, 11, 22, 44, 39, 11, 22, 44, 29, 58, 116, 53, 19, 38, 76, 152, 237, 139, 5, 10, 20
Offset: 1

Views

Author

Benoit Cloitre, Sep 04 2002

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{k = 1}, While[! PrimeQ @ Floor[2^n/k], k++]; k]; Array[a, 100] (* Amiram Eldar, Aug 31 2020 *)
  • PARI
    a(n)=if(n<0,0,k=1; while(isprime(floor(2^n/k)) == 0,k++); k)

Formula

There is probably a constant c such that Sum_{i=1..n} a(i) is asymptotic to c*n^2 (0 < c < 1/2).

A173854 Smallest positive integer k such that 2^n + k^2 is a prime number.

Original entry on oeis.org

1, 1, 1, 3, 1, 3, 3, 3, 1, 3, 3, 9, 9, 9, 7, 15, 1, 15, 3, 9, 5, 21, 5, 3, 11, 57, 7, 21, 9, 33, 3, 27, 9, 15, 5, 39, 25, 3, 35, 57, 25, 9, 15, 33, 39, 99, 27, 3, 25, 63, 67, 9, 105, 51, 145, 33, 9, 3, 15, 57, 15, 243, 13, 111, 9, 15, 3, 81, 71, 21, 5, 21, 19, 33, 57, 81, 141, 51, 17, 33, 125
Offset: 0

Views

Author

Ulrich Krug (leuchtfeuer37(AT)gmx.de), Feb 26 2010

Keywords

Comments

The list of associated primes 2^n + k^2 is 2, 3, 5, 17, 17, 41, 73, 137, 257, 521, 1033, ...
All terms are odd. - Harvey P. Dale, Dec 19 2014

Examples

			2^0 + 1^2 = 2 = A000040(1) => a(0) = k = 1
2^1 + 1^2 = 3 = A000040(2) => a(1) = k = 1
2^2 + 1^2 = 5 = A000040(3) => a(2) = k = 1
2^3 + 3^2 = 17 = A000040(7) => a(3) = k = 3
2^61 + 243^2 = A000040(tbd) => a(61) = k = 243.
		

References

  • Leonard E. Dickson: History of the Theory of numbers, vol. I, Dover Publications 2005
  • Louis J. Mordell: Diophantine equations, Academic Press Inc., 1969
  • Wolfgang M. Schmidt, Diophantine approximations and Diophantine equations, Lecture Notes in Mathematics vol. 785, Springer-Verlag, 2000

Crossrefs

Programs

  • Maple
    A173854 := proc(n) local twon,k ; twon := 2^n ; for k from 1 do if isprime(twon+k^2) then return k ; end if; end do ; end proc:
    seq(A173854(n),n=0..90) ; # R. J. Mathar, Mar 05 2010
  • Mathematica
    spi[n_]:=Module[{t=2^n,k=1},While[!PrimeQ[t+k^2],k=k+2];k]; Array[spi,90,0] (* Harvey P. Dale, Dec 19 2014 *)

Extensions

Extended by R. J. Mathar, Mar 05 2010

A097519 Prime differences between nextprime(2^n) and 2^n.

Original entry on oeis.org

3, 5, 3, 3, 7, 5, 3, 17, 3, 29, 3, 7, 17, 43, 29, 3, 11, 3, 11, 17, 53, 31, 7, 23, 29, 7, 59, 5, 5, 3, 131, 29, 13, 131, 3, 29, 11, 29, 37, 11, 7, 23, 13, 17, 3, 7, 29, 59, 61, 7, 277, 281, 43, 71, 29, 41, 277, 67, 7, 29, 17, 67, 37, 5, 5, 97, 7, 107, 19, 83, 7, 5, 107, 101
Offset: 1

Views

Author

Cino Hilliard, Aug 27 2004

Keywords

Comments

Primes in A013597. - Bill McEachen, Oct 27 2021

Crossrefs

Programs

  • Mathematica
    Select[Table[NextPrime[2^n]-2^n, {n,200}], PrimeQ] (* Harvey P. Dale, Dec 13 2011 *)
    Select[NextPrime[#]-#&/@(2^Range[200]),PrimeQ] (* Harvey P. Dale, Jan 05 2024 *)

Extensions

Definition corrected by Harvey P. Dale, Dec 13 2011
Previous Showing 31-39 of 39 results.