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-10 of 18 results. Next

A095056 Number of primes with three 1-bits (A081091) in range [2^n,2^(n+1)].

Original entry on oeis.org

0, 1, 2, 1, 2, 3, 3, 0, 4, 2, 3, 2, 2, 2, 4, 1, 3, 4, 5, 3, 2, 1, 5, 1, 0, 2, 5, 2, 2, 8, 6, 0, 5, 3, 4, 2, 3, 2, 2, 0, 3, 5, 0, 1, 5, 3, 7, 0, 1, 2, 5, 1, 5, 2, 6, 0, 6, 0, 2, 3, 2, 1, 2, 0, 2, 3, 5, 3, 6, 2, 2, 2, 5, 2, 7, 1, 3, 2, 3, 1, 6, 2, 4, 3, 3, 2, 6, 1, 1, 5, 7, 2, 4, 2, 5, 0, 3, 4, 3, 1, 2, 1, 3, 0, 5
Offset: 1

Views

Author

Antti Karttunen and Labos Elemer, Jun 01 2004

Keywords

Examples

			From _Michael De Vlieger_, Feb 27 2017: (Start)
a(1) = 0 because there are no primes with three 1s in binary expansion between 2^1 and 2^2.
a(2) = 1 since the only prime between 2^2 and 2^3 with three 1s in binary expansion is 7 = binary 111.
a(3) = 2 since between 2^3 and 2^4 we have 11 and 13 (binary 1011 and 1101, respectively) have three 1s.
(End)
		

Crossrefs

Programs

  • Mathematica
    Table[m = Count[Prime@ Range[PrimePi[2^n] + 1, PrimePi[2^(n + 1) - 1]], k_ /; DigitCount[k, 2, 1] == 3]; Print@ m; m, {n, 24}] (* Michael De Vlieger, Feb 27 2017 *)

Extensions

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

A360448 Indices of primes of the form p = 2^i + 2^j + 1, i > j > 0 (A081091).

Original entry on oeis.org

4, 5, 6, 8, 12, 13, 19, 21, 25, 32, 33, 44, 98, 106, 116, 136, 174, 191, 310, 313, 319, 565, 568, 1029, 1470, 1902, 2111, 3513, 3518, 3521, 4289, 6544, 12426, 13632, 15000, 23001, 23003, 23043, 23673, 43395, 43420, 43465, 45859, 62947, 82029, 82063, 91466, 155612, 155900, 295957, 564164
Offset: 1

Views

Author

M. F. Hasler, Mar 03 2023

Keywords

Crossrefs

Cf. A000720 (prime counting function), A081091 (primes of the form 2^i + 2^j + 1, i > j > 0), A014499 (Hamming weight of the n-th prime), A000040 (the primes), A000120 (Hamming weight).

Programs

Formula

a(n) = A000720(A081091(n)).
This sequence = { n | A000120(A000040(n)) = 3 }.

A014499 Number of 1's in binary representation of n-th prime.

Original entry on oeis.org

1, 2, 2, 3, 3, 3, 2, 3, 4, 4, 5, 3, 3, 4, 5, 4, 5, 5, 3, 4, 3, 5, 4, 4, 3, 4, 5, 5, 5, 4, 7, 3, 3, 4, 4, 5, 5, 4, 5, 5, 5, 5, 7, 3, 4, 5, 5, 7, 5, 5, 5, 7, 5, 7, 2, 4, 4, 5, 4, 4, 5, 4, 5, 6, 5, 6, 5, 4, 6, 6, 4, 6, 7, 6, 7, 8, 4, 5, 4, 5, 5, 5, 7, 5, 7, 7, 4, 5, 6, 7, 6, 8, 7, 7, 7, 8, 8, 3, 4
Offset: 1

Views

Author

Ingemar Assarsjo (ingemar(AT)binomen.se)

Keywords

Comments

a(n) is the rank of prime(n) in the base-2 dominance order on the natural numbers. - Tom Edgar, Mar 25 2014

Examples

			From _M. F. Hasler_, Mar 03 2023: (Start)
a(n) = 1 only for p(n = 1) = 2, the only prime equal to a power of 2.
a(n) = 2 for n in A159611 = A000720(A019434) = {2, 3, 7, 55, 6543} (probably complete), the Fermat primes F[k] = 2^2^k + 1 with k = 0, 1, 2, 3, 4. (On the graph one can distinctly see a(6543) = 2 corresponding to F[4] = 65537.)
a(n) = 3 for n in A000720(A081091) = (4, 5, 6, 8, 12, 13, 19, 21, 25, 32, 33, 44, 98, 106, 116, 136, 174, 191, 310, 313, 319, 565, 568, ...). (End)
		

Crossrefs

Cf. A180024. - Reinhard Zumkeller, Aug 08 2010
Cf. A072084.
Cf. A159611 (indices of 2s), A000720(A081091) (indices of 3s). - M. F. Hasler, Mar 03 2023

Programs

  • Haskell
    a014499 = a000120 . a000040  -- Reinhard Zumkeller, Feb 10 2013
    
  • Magma
    [&+Intseq(NthPrime(n), 2): n in [1..100] ]; // Vincenzo Librandi, Mar 25 2014
    
  • Mathematica
    Table[Plus @@ IntegerDigits[Prime[n], 2], {n, 1, 100}] (* Vincenzo Librandi, Mar 25 2014 *)
  • PARI
    A014499(n)=hammingweight(prime(n)) \\ M. F. Hasler, Nov 20 2009, updated Mar 03 2023
    
  • Python
    from sympy import prime
    def A014499(n): return prime(n).bit_count() # Chai Wah Wu, Mar 22 2023
  • Sage
    [sum(i.digits(base=2)) for i in primes_first_n(200)] # Tom Edgar, Mar 25 2014
    

Formula

a(n) = A000120(A000040(n)).
a(A049084(A061712(n))) = n. - Reinhard Zumkeller, Feb 10 2013
a(n) = [x^prime(n)] (1/(1 - x))*Sum_{k>=0} x^(2^k)/(1 + x^(2^k)). - Ilya Gutkovskiy, Mar 27 2018

A014311 Numbers with exactly 3 ones in binary expansion.

Original entry on oeis.org

7, 11, 13, 14, 19, 21, 22, 25, 26, 28, 35, 37, 38, 41, 42, 44, 49, 50, 52, 56, 67, 69, 70, 73, 74, 76, 81, 82, 84, 88, 97, 98, 100, 104, 112, 131, 133, 134, 137, 138, 140, 145, 146, 148, 152, 161, 162, 164, 168, 176, 193, 194, 196, 200, 208, 224, 259, 261, 262, 265, 266, 268, 273, 274, 276, 280, 289, 290, 292, 296, 304
Offset: 1

Views

Author

Al Black (gblack(AT)nol.net)

Keywords

Comments

Equivalently, sums of three distinct powers of 2.
Appears to give all n such that 64 is the highest power of 2 dividing A005148(n). - Benoit Cloitre, Jun 22 2002
From Gus Wiseman, Oct 05 2020: (Start)
These are numbers k such that the k-th composition in standard order has length 3. The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions. The sequence together with the corresponding standard compositions begins:
7: (1,1,1) 44: (2,1,3) 97: (1,5,1)
11: (2,1,1) 49: (1,4,1) 98: (1,4,2)
13: (1,2,1) 50: (1,3,2) 100: (1,3,3)
14: (1,1,2) 52: (1,2,3) 104: (1,2,4)
19: (3,1,1) 56: (1,1,4) 112: (1,1,5)
21: (2,2,1) 67: (5,1,1) 131: (6,1,1)
22: (2,1,2) 69: (4,2,1) 133: (5,2,1)
25: (1,3,1) 70: (4,1,2) 134: (5,1,2)
26: (1,2,2) 73: (3,3,1) 137: (4,3,1)
28: (1,1,3) 74: (3,2,2) 138: (4,2,2)
35: (4,1,1) 76: (3,1,3) 140: (4,1,3)
37: (3,2,1) 81: (2,4,1) 145: (3,4,1)
38: (3,1,2) 82: (2,3,2) 146: (3,3,2)
41: (2,3,1) 84: (2,2,3) 148: (3,2,3)
42: (2,2,2) 88: (2,1,4) 152: (3,1,4)
(End)

Crossrefs

Cf. A038465 (base 3), A038471 (base 4), A038475 (base 5).
Cf. A081091 (primes), A212190 (squares), A212192 (triangular numbers), A173589 (Fibbinary).
Cf. A057168.
Cf. A000079, A018900, A014311, A014312, A014313, A023688, A023689, A023690, A023691 (Hammingweight = 1, 2, ..., 9).
A000217(n-2) counts compositions into three parts.
A001399(n-3) = A069905(n) = A211540(n+2) counts the unordered case.
A001399(n-6) = A069905(n-3) = A211540(n-1) counts the unordered strict case.
A001399(n-6)*6 = A069905(n-3)*6 = A211540(n-1)*6 counts the strict case.
A014612 is an unordered version, with strict case A007304.
A337453 is the strict case.
A337461 counts the coprime case.
A033992 lists numbers divisible by exactly three different primes.
A323024 lists numbers with exactly three different prime multiplicities.

Programs

  • C
    unsigned hakmem175(unsigned x) {
        unsigned s, o, r;
        s = x & -x;  r = x + s;
        o = r ^ x;  o = (o >> 2) / s;
        return r | o;
    }
    unsigned A014311(int n) {
        if (n == 1) return 7;
        return hakmem175(A014311(n - 1));
    }  // Peter Luschny, Jan 01 2014
    
  • Haskell
    a014311 n = a014311_list !! (n-1)
    a014311_list = [2^x + 2^y + 2^z |
                    x <- [2..], y <- [1..x-1], z <- [0..y-1]]
    -- Reinhard Zumkeller, May 03 2012
    
  • Mathematica
    Select[Range[200], (Count[IntegerDigits[#, 2], 1] == 3)&]
    nn = 8; Flatten[Table[2^i + 2^j + 2^k, {i, 2, nn}, {j, 1, i - 1}, {k, 0, j - 1}]] (* T. D. Noe, Nov 05 2013 *)
  • PARI
    for(n=0,10^3,if(hammingweight(n)==3,print1(n,", "))); \\ Joerg Arndt, Mar 04 2014
    
  • PARI
    print1(t=7);for(i=2,50,print1(","t=A057168(t))) \\ M. F. Hasler, Aug 27 2014
    
  • Python
    A014311_list = [2**a+2**b+2**c for a in range(2,6) for b in range(1,a) for c in range(b)] # Chai Wah Wu, Jan 24 2021
    
  • Python
    from itertools import islice
    def A014311_gen(): # generator of terms
        yield (n:=7)
        while True: yield (n:=n^((a:=-n&n+1)|(a>>1)) if n&1 else ((n&~(b:=n+(a:=n&-n)))>>a.bit_length())^b)
    A014311_list = list(islice(A014311_gen(),20)) # Chai Wah Wu, Mar 10 2025
    
  • Python
    from math import isqrt, comb
    from sympy import integer_nthroot
    def A014311(n): return (1<<(r:=n-1-comb((m:=integer_nthroot(6*n,3)[0])+(t:=(n>comb(m+2,3)))+1,3))-comb((k:=isqrt(b:=r+1<<1))+(b>k*(k+1)),2))+(1<<(a:=isqrt(s:=n-comb(m-(t^1)+2,3)<<1))+((s<<2)>(a<<2)*(a+1)+1))+(1<Chai Wah Wu, Mar 10 2025

Formula

A000120(a(n)) = 3. - Reinhard Zumkeller, May 03 2012
Start with A084468. If n is in sequence, then 2n is too. - Ralf Stephan, Aug 16 2013
a(n+1) = A057168(a(n)). - M. F. Hasler, Aug 27 2014
a(n) = 2^A056558(n-1) + 2^A194848(n-1) + 2^A194847(n-1). - Ridouane Oudra, Sep 06 2020
Sum_{n>=1} 1/a(n) = A367110 = 1.428591545852638123996854844400537952781688750906133068397189529775365950039... (calculated using Baillie's irwinSums.m, see Links). - Amiram Eldar, Feb 14 2022

Extensions

Extension and program by Olivier Gérard

A039687 Primes of the form 3*2^k + 1.

Original entry on oeis.org

7, 13, 97, 193, 769, 12289, 786433, 3221225473, 206158430209, 6597069766657, 221360928884514619393, 2353913150770005286438421033702874906038383291674012942337
Offset: 1

Views

Author

Keywords

Comments

Primes of the form 6m+1 (A002476) of A074781. - Bernard Schott, Dec 14 2020

Crossrefs

For more terms see A002253. These are the primes in A004119 (or A181565).
Subsequence of A081091.

Programs

Formula

a(n) = 3*2^A002253(n) + 1. - M. F. Hasler, Mar 03 2023

A081092 Primes having a prime number of 1's in their binary representation.

Original entry on oeis.org

3, 5, 7, 11, 13, 17, 19, 31, 37, 41, 47, 59, 61, 67, 73, 79, 97, 103, 107, 109, 127, 131, 137, 151, 157, 167, 173, 179, 181, 191, 193, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 271, 283, 307, 313, 331, 367, 379, 397, 409, 419, 421, 431, 433, 439, 443
Offset: 1

Views

Author

Reinhard Zumkeller, Mar 05 2003

Keywords

Comments

Same as primes with prime binary digit sum.
Primes with prime decimal digit sum are A046704.
Sum_{a(n) < x} 1/a(n) is asymptotic to log(log(log(x))) as x -> infinity; see Harman (2012). Thus the sequence is infinite. - Jonathan Sondow, Jun 09 2012
A049084(A000120(a(n))) > 0; A081091, A000215 and A081093 are subsequences.

Examples

			15th prime = 47 = '101111' with five 1's, therefore 47 is in the sequence.
		

Crossrefs

Subsequence of A052294.

Programs

  • Haskell
    a081092 n = a081092_list !! (n-1)
    a081092_list = filter ((== 1) . a010051') a052294_list
    -- Reinhard Zumkeller, Nov 16 2012
    
  • Maple
    q:= n-> isprime(n) and isprime(add(i,i=Bits[Split](n))):
    select(q, [$1..500])[];  # Alois P. Heinz, Sep 28 2023
  • Mathematica
    Clear[BinSumOddQ];BinSumPrimeQ[a_]:=Module[{i,s=0},s=0;For[i=1,i<=Length[IntegerDigits[a,2]],s+=Extract[IntegerDigits[a,2],i];i++ ];PrimeQ[s]]; lst={};Do[p=Prime[n];If[BinSumPrimeQ[p],AppendTo[lst,p]],{n,4!}];lst (* Vladimir Joseph Stephan Orlovsky, Apr 06 2009 *)
    Select[Prime[Range[100]], PrimeQ[Apply[Plus, IntegerDigits[#, 2]]] &] (* Jonathan Sondow, Jun 09 2012 *)
  • PARI
    lista(nn) = {forprime(p=2, nn, if (isprime(hammingweight(p)), print1(p, ", ")););} \\ Michel Marcus, Jan 16 2015
    
  • Python
    from sympy import isprime
    def ok(n): return isprime(n.bit_count()) and isprime(n)
    print([k for k in range(444) if ok(k)]) # Michael S. Branicky, Dec 27 2023

A239712 Primes of the form m = 2^i + 2^j - 1, where i > j >= 0.

Original entry on oeis.org

2, 5, 11, 17, 19, 23, 47, 67, 71, 79, 131, 191, 257, 263, 271, 383, 1031, 1039, 1087, 1151, 1279, 2063, 2111, 4099, 4111, 4127, 4159, 5119, 6143, 8447, 16447, 20479, 32771, 32783, 32831, 33023, 33791, 65537, 65539, 65543, 65551, 65599, 66047, 73727, 81919, 262147, 262151, 262271, 262399, 263167
Offset: 1

Views

Author

Hieronymus Fischer, Mar 28 2014 and Apr 22 2014

Keywords

Comments

Numbers m such that b = 2 is the only base such that the base-b digital sum of m + 1 is equal to b.
Example: 5 + 1 = 110_2 which implies ds_2(5 + 1) = 2 = b, where ds_b = digital sum in base-b. However, ds_3(6) = 2 <> 3, ds_4(6) = 3 <> 4, ds_5(6) = 2 <> 5, ds_6(6) = 1 <> 6. For all other bases > 6 we have ds_b(6) = 6 <> b. It follows that b = 2 is the only such base.
The base-2 representation of a term 2^i + 2^j - 1 has a base-2 digital sum of 1 + j.
In base-2 representation the first terms are 10, 101, 1011, 10001, 10011, 10111, 101111, 1000011, 1000111, 1001111, 10000011, 10111111, 100000001, 100000111, 100001111, 101111111, 10000000111, 10000001111, 10000111111, 10001111111, ...
Numbers m = 2^i + 2^j - 1 with odd i and j are not terms. Example: 10239 = 2^13 + 2^11 - 1 is not a prime.

Examples

			a(1) = 2, since 2 = 2^1 + 2^0 - 1 is prime.
a(5) = 19, since 19 = 2^4 + 2^2 - 1 is prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Union[Total/@(2^#&/@Subsets[Range[0,20],{2}])-1],PrimeQ] (* Harvey P. Dale, Aug 08 2014 *)
  • Smalltalk
    A239712
    "Answers the n-th term of A239712.
      Usage: n A239712
      Answer: a(n)"
      | a b i k m p q terms |
      terms := OrderedCollection new.
      b := 2.
      p := 1.
      k := 0.
      m := 0.
      [k < self] whileTrue:
             [m := m + 1.
             p := b * p.
             q := 1.
             i := 0.
             [i < m and: [k < self]] whileTrue:
                       [i := i + 1.
                       a := p + q - 1.
                       a isPrime
                            ifTrue:
                                [k := k + 1.
                                terms add: a].
                       q := b * q]].
      ^terms at: self
    [by Hieronymus Fischer, Apr 22 2014]
    -----------
    
  • Smalltalk
    floorPrimesWhichAreDistinctPowersOf: b withOffset: d
      "Answers an array which holds the primes < n that obey b^i + b^j + d, i>j>=0,
      where n is the receiver. b > 1 (here: b = 2, d = -1).
      Uses floorDistinctPowersOf: from A018900
      Usage:
      n floorPrimesWhichAreDistinctPowersOf: b withOffset: d
      Answer: #(2 5 11 17 19 23 ...) [terms < n]"
      ^((self - d floorDistinctPowersOf: b)
      collect: [:i | i + d]) select: [:i | i isPrime]
    [by Hieronymus Fischer, Apr 22 2014]
    ------------
    
  • Smalltalk
    primesWhichAreDistinctPowersOf: b withOffset: d
      "Answers an array which holds the n primes of the form b^i + b^j + d, i>j>=0, where n is the receiver.
      Direct calculation by scanning b^i + b^j + d in increasing order and selecting terms which are prime.
      b > 1; this sequence: b = 2, d = 1.
      Usage:
      n primesWhichAreDistinctPowersOf: b withOffset: d
      Answer: #(2 5 11 17 19 23 ...) [a(1) ... a(n)]"
      | a k p q terms n |
      terms := OrderedCollection new.
      n := self.
      k := 0.
      p := b.
      [k < n] whileTrue:
             [q := 1.
             [q < p and: [k < n]] whileTrue:
                       [a := p + q + d.
                       a isPrime
                            ifTrue:
                                [k := k + 1.
                                terms add: a].
                       q := b * q].
             p := b * p].
      ^terms asArray
    [by Hieronymus Fischer, Apr 22 2014]

Formula

a(n) = A239708(n) - 1.
a(n+1) = min(A018900(k) > a(n)| A018900(k) - 1 is prime, k >= 1) - 1.

Extensions

Examples moved from Maple field to Examples field by Harvey P. Dale, Aug 08 2014

A334092 Primes p of the form of the form q*2^h + 1, where q is one of the Fermat primes; Primes p for which A329697(p) == 2.

Original entry on oeis.org

7, 11, 13, 41, 97, 137, 193, 641, 769, 12289, 40961, 163841, 557057, 786433, 167772161, 2281701377, 3221225473, 206158430209, 2748779069441, 6597069766657, 38280596832649217, 180143985094819841, 221360928884514619393, 188894659314785808547841, 193428131138340667952988161
Offset: 1

Views

Author

Antti Karttunen, Apr 14 2020

Keywords

Comments

Primes p such that p-1 is not a power of two, but for which A171462(p-1) = (p-1-A052126(p-1)) is [a power of 2].
Primes of the form ((2^(2^k))+1)*2^h + 1, where ((2^(2^k))+1) is one of the Fermat primes, A019434, 3, 5, 17, 257, ..., .

Crossrefs

Primes in A334102.
Intersection of A081091 and A147545.
Subsequences: A039687, A050526, A300407.

Programs

  • PARI
    isA334092(n) = (isprime(n)&&2==A329697(n));
    
  • PARI
    A052126(n) = if(1==n,n,n/vecmax(factor(n)[, 1]));
    A209229(n) = (n && !bitand(n,n-1));
    isA334092(n) = (isprime(n)&&(!A209229(n-1))&&A209229(n-1-A052126(n-1)));
    
  • PARI
    list(lim)=if(exponent(lim\=1)>=2^33, error("Verify composite character of more Fermat primes before checking this high")); my(v=List(),t); for(e=0,4, t=2^2^e+1; while((t<<=1)Charles R Greathouse IV, Apr 14 2020

Extensions

More terms from Giovanni Resta, Apr 14 2020

A081504 Numbers n such that there are no primes of the form 2^n+2^i+1 for 0

Original entry on oeis.org

8, 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, 416, 418, 432, 448
Offset: 1

Views

Author

Ralf Stephan, Apr 21 2003

Keywords

Comments

There seem to be no such numbers (bit sizes) such that any 4-bit or 5-bit number is composite, up to n around 200.

Crossrefs

Programs

  • PARI
    for(n=2, 1000, f=0; for(i=1, n-1, t=2^n+2^i+1;  if(isprime(t), f=1; break)); if(!f, print1(n", ")))

A095077 Primes with four 1-bits in their binary expansion.

Original entry on oeis.org

23, 29, 43, 53, 71, 83, 89, 101, 113, 139, 149, 163, 197, 263, 269, 277, 281, 293, 337, 353, 389, 401, 449, 523, 547, 593, 643, 673, 773, 1031, 1049, 1061, 1091, 1093, 1097, 1217, 1283, 1289, 1297, 1409, 1553, 1601, 2069, 2083, 2089, 2129
Offset: 1

Views

Author

Antti Karttunen, Jun 01 2004

Keywords

Crossrefs

Subsequence of A027699. First differs from A085448 at n = 19, where a(n)=337, while A085448 continues from there with 311, whose binary expansion has six 1-bits, not four. Cf. A095057.
Cf. A000215 (primes having two bits set), A081091 (three bits set).
Cf. A264908.

Programs

  • Mathematica
    Select[Prime[Range[320]], Plus@@IntegerDigits[#, 2] == 4 &] (* Alonso del Arte, Jan 11 2011 *)
    Select[ Flatten[ Table[2^i + 2^j + 2^k + 1, {i, 3, 11}, {j, 2, i - 1}, {k, j - 1}]], PrimeQ] (* Robert G. Wilson v, Jul 30 2016 *)
  • PARI
    bits1_4(x) = { nB = floor(log(x)/log(2)); z = 0;
    for(i=0,nB,if(bittest(x,i),z++;if(z>4,return(0););););
    if(z == 4, return(1);, return(0););};
    forprime(x=17,2129,if(bits1_4(x),print1(x, ", ");););
    \\ Washington Bomfim, Jan 11 2011
    
  • PARI
    is(n)=isprime(n) && hammingweight(n)==4 \\ Charles R Greathouse IV, Jul 30 2016
    
  • PARI
    list(lim)=my(v=List(),t); for(a=3,logint(lim\=1,2), for(b=2,a-1, for(c=1,b-1, t=1<lim, return(Vec(v))); if(isprime(t), listput(v,t))))); Vec(v) \\ Charles R Greathouse IV, Jul 30 2016
    
  • Python
    from itertools import count, islice
    from sympy import isprime
    from sympy.utilities.iterables import multiset_permutations
    def A095077_gen(): # generator of terms
        return filter(isprime,map(lambda s:int('1'+''.join(s)+'1',2),(s for l in count(2) for s in multiset_permutations('0'*(l-2)+'11'))))
    A095077_list = list(islice(A095077_gen(),30)) # Chai Wah Wu, Jul 19 2022
Showing 1-10 of 18 results. Next