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.

Showing 1-2 of 2 results.

A057775 a(n) is the least prime p such that p-1 is divisible by 2^n and not by 2^(n+1).

Original entry on oeis.org

2, 3, 5, 41, 17, 97, 193, 641, 257, 7681, 13313, 18433, 12289, 40961, 114689, 163841, 65537, 1179649, 786433, 5767169, 7340033, 23068673, 104857601, 377487361, 754974721, 167772161, 469762049, 2013265921, 3489660929, 12348030977, 3221225473, 75161927681
Offset: 0

Views

Author

Labos Elemer, Nov 02 2000

Keywords

Comments

If we drop the requirement that p-1 must not be divisible by 2^(n+1), we get instead A035089, which is a nondecreasing sequence. - Jeppe Stig Nielsen, Aug 09 2015

Examples

			a(13) = 40961 = 1 + 8192*5 where the last term is divisible by the 13th power of 2 and 40961 is the smallest prime with that property.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p;
      for p from 2^n+1 by 2^(n+1) do
        if isprime(p) then return p fi
      od
    end proc:
    map(f, [$0..100]); # Robert Israel, Aug 10 2015
  • Mathematica
    Table[k = 1; While[p = k*2^n + 1; ! PrimeQ[p], k = k + 2]; p, {n, 0, 40}] (* T. D. Noe, Dec 27 2011 *)
  • PARI
    a(n)=forstep(k=1,9e99,2,isprime((k<Jeppe Stig Nielsen, Aug 09 2015

Formula

a(n) = prime(A057776(n+1)). - Amiram Eldar, Mar 16 2025

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Nov 03 2000

A307503 Least prime containing at least n consecutive 1's in its binary representation.

Original entry on oeis.org

2, 2, 3, 7, 31, 31, 127, 127, 1021, 3583, 4093, 6143, 8191, 8191, 81919, 131071, 131071, 131071, 524287, 524287, 4194301, 14680063, 16777213, 67108859, 536870909, 536870909, 536870909, 536870909, 2147483647, 2147483647, 2147483647, 2147483647, 21474836479
Offset: 0

Views

Author

John Mason, Apr 11 2019

Keywords

Comments

For n > 0, a(n) = A000040(m) for the lowest m such that A090000(m) >= n.
a(n) = A087522(n) for n = 0 through 7, and in all other cases when a(n) is a base 2 repunit (Mersenne) prime.

Examples

			a(0) = 2, the smallest prime containing >= 0 1's.
a(1) = 2, the smallest prime containing >= 1 consecutive 1's.
a(2) = 3, the smallest prime containing >= 2 consecutive 1's.
		

Crossrefs

Cf. A090593 (with exactly n consecutive ones).

Programs

  • PARI
    nbo(n)=if (n==0, return (0)); n>>=valuation(n, 2); if(n<2, return(n)); my(e=valuation(n+1, 2)); max(e, nbo(n>>e)); \\ A038374
    a(n) = my(p=2); while(nbo(p) < n, p=nextprime(p+1)); p; \\ Michel Marcus, Apr 14 2019

Formula

a(n) <= A201914(n). - Rémy Sigrist, Apr 11 2019
a(n) = min_{k>=n} A090593(k). - Chai Wah Wu, Apr 26 2019

Extensions

a(28)-a(32) from Chai Wah Wu, Apr 26 2019
Showing 1-2 of 2 results.