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.

A095057 Number of primes with four 1-bits (A095077) in range ]2^n,2^(n+1)].

Original entry on oeis.org

0, 0, 0, 2, 2, 5, 4, 10, 6, 13, 11, 9, 16, 16, 18, 25, 15, 19, 15, 37, 17, 37, 29, 29, 32, 40, 23, 49, 31, 51, 39, 37, 30, 52, 46, 40, 42, 62, 43, 57, 42, 68, 52, 78, 60, 89, 54, 63, 59, 92, 58, 79, 82, 99, 73, 87, 47, 99, 74, 72, 81, 106, 56, 102, 85, 117, 85, 97, 64, 132, 93
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Crossrefs

Extensions

More terms from T. D. Noe, Oct 17 2007

A081091 Primes of the form 2^i + 2^j + 1, i > j > 0.

Original entry on oeis.org

7, 11, 13, 19, 37, 41, 67, 73, 97, 131, 137, 193, 521, 577, 641, 769, 1033, 1153, 2053, 2081, 2113, 4099, 4129, 8209, 12289, 16417, 18433, 32771, 32801, 32833, 40961, 65539, 133121, 147457, 163841, 262147, 262153, 262657, 270337, 524353, 524801
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 05 2003

Keywords

Comments

This is sequence A070739 without the Fermat primes, A000215. Sequence A081504 lists the i for which there are no primes. - T. D. Noe, Jun 22 2007
Primes in A014311. - Reinhard Zumkeller, May 03 2012

Examples

			    7 = 2^2 + 2^1 + 1
   11 = 2^3 + 2^1 + 1
   13 = 2^3 + 2^2 + 1
   19 = 2^4 + 2^1 + 1
   37 = 2^5 + 2^2 + 1
   41 = 2^5 + 2^3 + 1
   67 = 2^6 + 2^1 + 1
   73 = 2^6 + 2^3 + 1
   97 = 2^6 + 2^5 + 1
  131 = 2^7 + 2^1 + 1
  137 = 2^7 + 2^3 + 1
  193 = 2^7 + 2^6 + 1
  521 = 2^9 + 2^3 + 1
		

Crossrefs

Essentially the same as A070739.
Cf. A095077 (primes with four bits set).
A057733 = 2^A057732 + 3 and A039687 = 3*2^A002253 + 1 are subsequences.

Programs

  • Haskell
    a081091 n = a081091_list !! (n-1)
    a081091_list = filter ((== 1) . a010051') a014311_list
    -- Reinhard Zumkeller, May 03 2012
    
  • Maple
    N:= 20: # to get all terms < 2^N
    select(isprime, [seq(seq(2^i+2^j+1,j=1..i-1),i=1..N-1)]); # Robert Israel, May 17 2016
  • Mathematica
    Select[Flatten[Table[2^i + 2^j + 1, {i, 21}, {j, i-1}]], PrimeQ] (* Alonso del Arte, Jan 11 2011 *)
  • PARI
    do(mx)=my(v=List(),t); for(i=2,mx,for(j=1,i-1,if(ispseudoprime(t=2^i+2^j+1), listput(v,t)))); Vec(v) \\ Charles R Greathouse IV, Jan 02 2014
    
  • PARI
    is(n)=hammingweight(n)==3 && isprime(n) \\ Charles R Greathouse IV, Aug 28 2017
    
  • PARI
    A81091=[7]; next_A081091(p, i=exponent(p), j=exponent(p-2^i))=!until(isprime(2^i+2^j+1), j++>=i && i++ && j=1)+2^i+2^j
    A081091(n)={for(k=#A81091, n-1, A81091=concat(A81091, next_A081091(A81091[k]))); A81091[n]} \\ M. F. Hasler, Mar 03 2023
    
  • Python
    from itertools import count, islice
    from sympy import isprime
    from sympy.utilities.iterables import multiset_permutations
    def A081091_gen(): # generator of terms
        return filter(isprime,map(lambda s:int('1'+''.join(s)+'1',2),(s for l in count(1) for s in multiset_permutations('0'*(l-1)+'1'))))
    A081091_list = list(islice(A081091_gen(),30)) # Chai Wah Wu, Jul 19 2022

Formula

A000120(a(n)) = 3.

A255564 Primes having in binary representation a nonprime number of 1's.

Original entry on oeis.org

2, 23, 29, 43, 53, 71, 83, 89, 101, 113, 139, 149, 163, 197, 263, 269, 277, 281, 293, 311, 317, 337, 347, 349, 353, 359, 373, 383, 389, 401, 449, 461, 467, 479, 503, 509, 523, 547, 571, 593, 599, 619, 643, 673, 683, 691, 739, 751, 773, 797, 811, 821, 839, 853, 857, 863, 881, 887, 907, 937, 977, 983, 991, 1013, 1019, 1021, 1031, 1049, 1061
Offset: 1

Views

Author

Antti Karttunen, May 14 2015

Keywords

Comments

Equally: 2 followed by all primes with their hamming weight a composite number.

Examples

			2, which in binary (A007088) is "10", has just one 1-bit, and 1 is not a prime, thus 2 is included in the sequence.
23, which in binary is "10111", has four 1-bits, and 4 is not a prime, thus 23 is included in the sequence.
		

Crossrefs

Complement among primes: A081092.
Intersection of A000040 and A084345.
Subsequences: A027699 \ A019434, A085448, A095077, A255569.
Cf. A000120.

Programs

  • PARI
    i = 0; forprime(n=2, 2^31, if(!isprime(hammingweight(n)), i++; write("b255564.txt", i, " ", n); if(i>=10000,return(n))));
    
  • Scheme
    ;; With Antti Karttunen's IntSeq-library
    (define A255564 (MATCHING-POS 1 1 (lambda (n) (and (prime? n) (not (prime? (A000120 n)))))))

A264908 Primes of the form 2^i + 2^j + 2^k - 1, i > j > k > 0.

Original entry on oeis.org

13, 37, 41, 43, 73, 83, 97, 103, 137, 139, 151, 163, 167, 193, 199, 223, 521, 523, 547, 577, 607, 641, 643, 647, 769, 1033, 1063, 1091, 1103, 1153, 1283, 1543, 1567, 1663, 2053, 2081, 2083, 2087, 2113, 2143, 2179, 2207, 2239, 2311, 2591, 2687, 3079, 3583, 4129, 4231, 4639
Offset: 1

Views

Author

Robert G. Wilson v, Nov 28 2015

Keywords

Crossrefs

Programs

  • Mathematica
    Select[ Flatten[ Table[2^i + 2^j + 2^k - 1, {i, 3, 10}, {j, 2, i - 1}, {k, j - 1}]], PrimeQ]

A362979 Square array, read by descending antidiagonals: row n lists the primes whose base-2 representation has exactly n ones, starting from n=3.

Original entry on oeis.org

7, 11, 23, 13, 29, 31, 19, 43, 47, 311
Offset: 3

Views

Author

Clark Kimberling, May 11 2023

Keywords

Examples

			Corner:
  n=3:    7    11    13    19    37   41     67    73    97
  n=4:   23    29    43    53    71   83     89   101   113
  n=5:   31    47    59    61    79   103   107   109   151
  n=6:  311   317   347   349   359   373   461   467   571
The first four primes in row n=3 have these base-2 representations, respectively: 111, 1011, 1101, 10011.
		

Crossrefs

Cf. A019434 (row 2), A061712 (column 1), A081091 (row 3), A095077 (row 4).

Programs

  • Mathematica
    t[n_] := Count[IntegerDigits[Prime[n], 2], 1]  (* A014499 *)
    u = Table[t[n], {n, 1, 200}];
    p[n_] := Flatten[Position[u, n]]
    w = TableForm[Table[Prime[p[n]], {n, 3, 16}]]

Extensions

New offset and edited by Michel Marcus, Jan 19 2024
Showing 1-5 of 5 results.