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

A333878 a(n) is the number of primes 2^(n-1) <= p < 2^n with minimal Hamming weight A091935(n-1) in this interval.

Original entry on oeis.org

1, 1, 2, 1, 2, 3, 3, 1, 4, 2, 3, 2, 2, 2, 4, 1, 3, 4, 5, 3, 2, 1, 5, 1, 32, 2, 5, 2, 2, 8, 6, 37, 5, 3, 4, 2, 3, 2, 2, 57, 3, 5, 52, 1, 5, 3, 7, 63, 1, 2, 5, 1, 5, 2, 6, 87, 6, 99, 2, 3, 2, 1, 2, 102, 2, 3, 5, 3, 6, 2, 2, 2, 5, 2, 7, 1, 3, 2, 3, 1, 6, 2, 4, 3, 3
Offset: 2

Views

Author

Hugo Pfoertner, Apr 08 2020

Keywords

Crossrefs

Programs

  • Mathematica
    a[2] = 1; a[n_] := Block[{c = 0, nb = 0}, While[c == 0, c = Count[ 2^(n-1) + 1 + Total /@ Subsets[ 2^Range[n - 2], {nb}], x_ /; PrimeQ[x]]; nb++]; c]; Array[a, 90, 2] (* Giovanni Resta, Apr 09 2020 *)

Extensions

Terms a(35) and beyond from Giovanni Resta, Apr 09 2020

A091936 Smallest prime between 2^n and 2^(n+1), having a minimal number of 1's in binary representation.

Original entry on oeis.org

2, 5, 11, 17, 37, 67, 131, 257, 521, 1033, 2053, 4099, 8209, 16417, 32771, 65537, 133121, 262147, 524353, 1048609, 2097169, 4194433, 8388617, 16777729, 33554467, 67239937, 134250497, 268435459, 536903681, 1073741827, 2147483713
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 14 2004

Keywords

Comments

A091935(n) = A000120(a(n)).
So far only a(25) and a(32) possess 4 1's in their binary representation.

Crossrefs

Programs

  • Mathematica
    NextPrim[ n_] := Block[ {k = n + 1}, While[ !PrimeQ[ k], k++ ]; k]; p = 2; Do[ c = Infinity; While[ p < 2^n, b = Count[ IntegerDigits[ p, 2], 1]; If[ c > b, c = b; q = p]; p = NextPrim[ p]; If[ c < 4, p = NextPrim[ 2^n]; Continue[ ]]]; Print[ q], {n, 2, 32}] (* Robert G. Wilson v, Feb 18 2004 *)
    b[ n_ ] := Min[ Select[ FromDigits[ #, 2 ] & /@ (Join[ {1}, #, {1} ] & /@ Permutations[ Join[ {1}, Table[ 0, {n - 2} ] ] ]), PrimeQ[ # ] & ] ]; c[ n_ ] := Min[ Select[ FromDigits[ #, 2 ] & /@ (Join[ {1}, #, {1} ] & /@ Permutations[ Join[ {1, 1}, Table[ 0, {n - 3} ] ] ]), PrimeQ[ # ] & ] ]; f[ n_ ] := If[ PrimeQ[ 2^n + 1 ], 2^n + 1, If[ PrimeQ[ b[ n ] ], b[ n ], c[ n ] ] ]; Table[ f[ n ], {n, 2, 32} ] (* Robert G. Wilson v *)
  • Python
    from sympy import isprime
    from sympy.utilities.iterables import multiset_permutations
    def A091936(n):
        for i in range(n+1):
            q = 2**n
            for d in multiset_permutations('0'*(n-i)+'1'*i):
                p = q+int(''.join(d),2)
                if isprime(p):
                    return p # Chai Wah Wu, Apr 08 2020

Extensions

More terms from Robert G. Wilson v, Feb 18 2004

A091937 Greatest number of 1's in binary representations of primes between 2^n and 2^(n+1).

Original entry on oeis.org

2, 3, 3, 5, 5, 7, 7, 8, 9, 10, 11, 13, 13, 13, 15, 17, 17, 19, 19, 20, 21, 21, 23, 24, 25, 25, 27, 28, 29, 31, 31, 32, 33, 34, 35, 35, 37, 37, 39, 40, 41, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 53, 55, 56, 56, 58, 59, 61, 61, 61, 63, 64, 65, 66, 67, 68, 69, 69, 71, 72
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 14 2004

Keywords

Comments

a(n) = A000120(A091938(n)).

Crossrefs

Cf. A091935.

Programs

  • Mathematica
    Run the second Mathematica line of A091938, then Count[ IntegerDigits[ #, 2], 1] & /@ Table[ f[n], {n, 75}]

Extensions

More terms from Robert G. Wilson v, Feb 20 2004

A092100 Smallest number of 1's in binary representations of primes between 2^n and 2^(n+1) is 4.

Original entry on oeis.org

25, 32, 40, 43, 48, 56, 58, 64, 96, 104, 112, 120, 128, 134, 140, 145, 152, 160, 176, 185, 192, 208, 212, 224, 235, 240, 244, 248, 252, 256, 264, 272, 280, 286, 288, 292, 302, 304, 308, 320, 326, 332, 348, 356, 360, 384, 392, 394, 400
Offset: 1

Views

Author

Robert G. Wilson v, Feb 19 2004

Keywords

Comments

Where 4 appears in A091935.
This sequence differs from multiples of 8 (A008590) very little but significantly; even fewer are odd.
Essentially the same as A081504. - R. J. Mathar, Sep 08 2008

Crossrefs

Programs

  • Mathematica
    Compute the second line of the Mathematica code for A091936, then Do[ If[ Count[ IntegerDigits[ f[n], 2], 1] == 4, Print[n]], {n, 1, 400}] (* Robert G. Wilson v, Feb 19 2004 *)

A092112 Where A092111 equals 2.

Original entry on oeis.org

14, 22, 26, 36, 38, 42, 54, 57, 62, 70, 78, 81, 90, 94, 110, 122, 132, 134, 138, 142, 147, 150, 158, 166, 168, 171, 172, 174, 178, 182, 190, 194, 198, 206, 210, 222, 238, 254, 285, 294, 312, 315, 318, 334, 336, 350, 366, 372, 382, 405, 414, 416, 432, 434, 446, 454
Offset: 1

Views

Author

Robert G. Wilson v, Feb 20 2004, corrected Nov 02 2006

Keywords

Comments

Not as obvious as A092100, this sequence differs from multiples of 8 plus 6 (A017137).

Crossrefs

Programs

  • Mathematica
    Run the second Mathematica line of A091938, then g[n_] := (n + 1 - Count[ IntegerDigits[f[n], 2], 1]); Select[ Range[100], g[ # ] == 2 &]
Showing 1-5 of 5 results.