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

A036563 a(n) = 2^n - 3.

Original entry on oeis.org

-2, -1, 1, 5, 13, 29, 61, 125, 253, 509, 1021, 2045, 4093, 8189, 16381, 32765, 65533, 131069, 262141, 524285, 1048573, 2097149, 4194301, 8388605, 16777213, 33554429, 67108861, 134217725, 268435453, 536870909, 1073741821, 2147483645
Offset: 0

Views

Author

Keywords

Comments

a(n+1) is the n-th number with exactly n 1's in binary representation. - Reinhard Zumkeller, Mar 06 2003
Berstein and Onn: "For every m = 3k+1, the Graver complexity of the vertex-edge incidence matrix of the complete bipirtite graph K(3,m) satisfies g(m) >= 2^(k+2)-3." - Jonathan Vos Post, Sep 15 2007
Row sums of triangle A135857. - Gary W. Adamson, Dec 01 2007
a(n) = A164874(n-1,n-2) for n > 2. - Reinhard Zumkeller, Aug 29 2009
Starting (1, 5, 13, ...) = eigensequence of a triangle with A016777: (1, 4, 7, 10, ...) as the left border and the rest 1's. - Gary W. Adamson, Jul 24 2010
An elephant sequence, see A175655. For the central square just one A[5] vector, with decimal value 186, leads to this sequence (n >= 2). For the corner squares this vector leads to the companion sequence A123203. - Johannes W. Meijer, Aug 15 2010
First differences of A095264: A095264(n+1) - A095264(n) = a(n+2). - J. M. Bergot, May 13 2013
a(n+2) is given by the sum of n-th row of triangle of powers of 2: 1; 2 1 2; 4 2 1 2 4; 8 4 2 1 2 4 8; ... - Philippe Deléham, Feb 24 2014
Also, the decimal representation of the x-axis, from the left edge to the origin, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 643", based on the 5-celled von Neumann neighborhood, initialized with a single black (ON) cell at stage zero. See A283508. - Robert Price, Mar 09 2017
a(n+3) is the value of the Ackermann function A(3,n) or ack(3,n). - Olivier Gérard, May 11 2018

Examples

			a(2) = 1;
a(3) = 2 + 1 + 2 = 5;
a(4) = 4 + 2 + 1 + 2 + 4 = 13;
a(5) = 8 + 4 + 2 + 1 + 2 + 4 + 8 = 29; etc. - _Philippe Deléham_, Feb 24 2014
		

Crossrefs

Row sums of triangular array A027960. A column of A119725.

Programs

Formula

a(n) = 2*a(n-1) + 3.
The sequence 1, 5, 13, ... has a(n) = 4*2^n-3. These are the partial sums of A151821. - Paul Barry, Aug 25 2003
a(n) = A118654(n-3, 6), for n > 2. - N. J. A. Sloane, Sep 29 2006
Row sums of triangle A130459 starting (1, 5, 13, 29, 61, ...). - Gary W. Adamson, May 26 2007
Row sums of triangle A131112. - Gary W. Adamson, Jun 15 2007
Binomial transform of [1, 4, 4, 4, ...] = (1, 5, 13, 29, 61, ...). - Gary W. Adamson, Sep 20 2007
a(n) = 2*StirlingS2(n,2) - 1, for n > 0. - Ross La Haye, Jul 05 2008
a(n) = A000079(n) - 3. - Omar E. Pol, Dec 21 2008
From Mohammad K. Azarian, Jan 14 2009: (Start)
G.f.: 1/(1-2*x) - 3/(1-x).
E.g.f.: exp(2*x) - 3*exp(x). (End)
For n >= 3, a(n) = 2<+>n, where operation <+> is defined in A206853. - Vladimir Shevelev, Feb 17 2012
a(n) = 3*a(n-1) - 2*a(n-2) for n > 1, a(0)=-2, a(1)=-1. - Philippe Deléham, Dec 23 2013
Sum_{n>=1} 1/a(n) = A331372. - Amiram Eldar, Nov 18 2020

A089633 Numbers having no more than one 0 in their binary representation.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 7, 11, 13, 14, 15, 23, 27, 29, 30, 31, 47, 55, 59, 61, 62, 63, 95, 111, 119, 123, 125, 126, 127, 191, 223, 239, 247, 251, 253, 254, 255, 383, 447, 479, 495, 503, 507, 509, 510, 511, 767, 895, 959, 991, 1007, 1015, 1019, 1021, 1022, 1023
Offset: 0

Views

Author

Reinhard Zumkeller, Jan 01 2004

Keywords

Comments

Complement of A158582. - Reinhard Zumkeller, Apr 16 2009
Also union of A168604 and A030130. - Douglas Latimer, Jul 19 2012
Numbers of the form 2^t - 2^k - 1, 0 <= k < t.
n is in the sequence if and only if 2*n+1 is in the sequence. - Robert Israel, Dec 14 2018
Also the least binary rank of a strict integer partition of n, where the binary rank of a partition y is given by Sum_i 2^(y_i-1). - Gus Wiseman, May 24 2024

Examples

			From _Tilman Piesk_, May 09 2012: (Start)
This may also be viewed as a triangle:             In binary:
                  0                                         0
               1     2                                 01       10
             3    5    6                          011      101      110
           7   11   13   14                  0111     1011     1101     1110
        15   23   27   29   30          01111    10111    11011    11101    11110
      31  47   55   59   61   62
   63   95  111  119  123  125  126
Left three diagonals are A000225,  A055010, A086224. Right diagonal is A000918. Central column is A129868. Numbers in row n (counted from 0) have n binary 1s. (End)
From _Gus Wiseman_, May 24 2024: (Start)
The terms together with their binary expansions and binary indices begin:
   0:      0 ~ {}
   1:      1 ~ {1}
   2:     10 ~ {2}
   3:     11 ~ {1,2}
   5:    101 ~ {1,3}
   6:    110 ~ {2,3}
   7:    111 ~ {1,2,3}
  11:   1011 ~ {1,2,4}
  13:   1101 ~ {1,3,4}
  14:   1110 ~ {2,3,4}
  15:   1111 ~ {1,2,3,4}
  23:  10111 ~ {1,2,3,5}
  27:  11011 ~ {1,2,4,5}
  29:  11101 ~ {1,3,4,5}
  30:  11110 ~ {2,3,4,5}
  31:  11111 ~ {1,2,3,4,5}
  47: 101111 ~ {1,2,3,4,6}
  55: 110111 ~ {1,2,3,5,6}
  59: 111011 ~ {1,2,4,5,6}
  61: 111101 ~ {1,3,4,5,6}
  62: 111110 ~ {2,3,4,5,6}
(End)
		

Crossrefs

Cf. A181741 (primes), union of A081118 and A000918, apart from initial -1.
For least binary index (instead of rank) we have A001511.
Applying A019565 (Heinz number of binary indices) gives A077011.
For greatest binary index we have A029837 or A070939, opposite A070940.
Row minima of A118462 (binary ranks of strict partitions).
For sum instead of minimum we have A372888, non-strict A372890.
A000009 counts strict partitions, ranks A005117.
A048675 gives binary rank of prime indices, distinct A087207.
A048793 lists binary indices, product A096111, reverse A272020.
A277905 groups all positive integers by binary rank of prime indices.

Programs

  • Haskell
    a089633 n = a089633_list !! (n-1)
    a089633_list = [2 ^ t - 2 ^ k - 1 | t <- [1..], k <- [t-1,t-2..0]]
    -- Reinhard Zumkeller, Feb 23 2012
    
  • Maple
    seq(seq(2^a-1-2^b,b=a-1..0,-1),a=1..11); # Robert Israel, Dec 14 2018
  • Mathematica
    fQ[n_] := DigitCount[n, 2, 0] < 2; Select[ Range[0, 2^10], fQ] (* Robert G. Wilson v, Aug 02 2012 *)
  • PARI
    {insq(n) = local(dd, hf, v); v=binary(n);hf=length(v);dd=sum(i=1,hf,v[i]);if(dd<=hf-2,-1,1)}
    {for(w=0,1536,if(insq(w)>=0,print1(w,", ")))}
    \\ Douglas Latimer, May 07 2013
    
  • PARI
    isoka(n) = #select(x->(x==0), binary(n)) <= 1; \\ Michel Marcus, Dec 14 2018
    
  • Python
    from itertools import count, islice
    def A089633_gen(): # generator of terms
        return ((1<A089633_list = list(islice(A089633_gen(),30)) # Chai Wah Wu, Feb 10 2023
    
  • Python
    from math import isqrt, comb
    def A089633(n): return (1<<(a:=(isqrt((n<<3)+1)-1>>1)+1))-(1<Chai Wah Wu, Dec 19 2024

Formula

A023416(a(n)) <= 1; A023416(a(n)) = A023532(n-2) for n>1;
A000120(a(u)) <= A000120(a(v)) for uA000120(a(n)) = A003056(n).
a(0)=0, n>0: a(n+1) = Min{m>n: BinOnes(a(n))<=BinOnes(m)} with BinOnes=A000120.
If m = floor((sqrt(8*n+1) - 1) / 2), then a(n) = 2^(m+1) - 2^(m*(m+3)/2 - n) - 1. - Carl R. White, Feb 10 2009
A029931(a(n)) = n and A029931(m) != n for m < a(n). - Reinhard Zumkeller, Feb 28 2014
A265705(a(n),k) = A265705(a(n),a(n)-k), k = 0 .. a(n). - Reinhard Zumkeller, Dec 15 2015
a(A014132(n)-1) = 2*a(n-1)+1 for n >= 1. - Robert Israel, Dec 14 2018
Sum_{n>=1} 1/a(n) = A065442 + A160502 = 3.069285887459... . - Amiram Eldar, Jan 09 2024
A019565(a(n)) = A077011(n). - Gus Wiseman, May 24 2024

A208083 Number of primes of the form 2^n - 2^k - 1, 1 <= k < n.

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Feb 23 2012

Keywords

Comments

Number of primes in (n-1)-st row of the triangle in A081118;
a(A138290(n)+1) = 0;
for n >= 0: a(A208091(n)) = n and a(m) <> n for m < A208091(n).

Examples

			n _ A208083(n) ________________ (n-1)-st row of A081118 _________
5   #{23,29} = 2                [15,23,27,29]
6   #{31,47,59,61} = 4          [31,47,55,59,61]
7   #{} = 0                     [63,95,111,119,123,125]
8   #{127,191,223,239,251} = 5  [127,191,223,239,247,251,253]
9   #{383,479,503,509} = 4      [255,383,447,479,495,503,507,509]
		

Crossrefs

Programs

  • Haskell
    a208083 = sum . map a010051 . a081118_row
    
  • Maple
    f:= n -> nops(select(k -> isprime(2^n-2^k-1),[$1..n-1])):
    map(f, [$1..100]); # Robert Israel, Jun 12 2018
  • Mathematica
    a[n_] := Module[{m = 2^n - 1, cnt = 0}, For[ k = 1, k < n, k++, If[PrimeQ[m - 2^k], cnt++]]; cnt]; Table[a[n], {n, 2, 86}] (* Jean-François Alcover, Sep 12 2013 *)
  • PARI
    a(n)=sum(k=1,n-1,ispseudoprime(2^n-2^k-1)) \\ Charles R Greathouse IV, Sep 12 2013

Formula

a(n) = Sum_{k=1..n-1} A010051(A081118(n-1,k)).

A138290 Numbers m such that 2^(m+1) - 2^k - 1 is composite for all 0 <= k < m.

Original entry on oeis.org

6, 14, 22, 26, 30, 36, 38, 42, 54, 57, 62, 70, 78, 81, 90, 94, 110, 122, 126, 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
Offset: 1

Views

Author

T. D. Noe, Mar 13 2008

Keywords

Comments

The binary representation of 2^(m+1) - 2^k - 1 has m 1-bits and one 0-bit. Note that prime m are very rare: 577 is the first and 5569 is the second.
A208083(a(n)+1) = 0 (cf. A081118). - Reinhard Zumkeller, Feb 23 2012 [Corrected by Thomas Ordowski, Feb 19 2024]
Conjecture: 2^j - 2 are terms for j > 2. - Chai Wah Wu, Sep 07 2021
The proof of this conjecture is in A369375. - Thomas Ordowski, Mar 20 2024

Examples

			6 is here because 95, 111, 119, 123, 125 and 126 are all composite.
		

Crossrefs

Many common terms with A092112.

Programs

  • Haskell
    import Data.List (elemIndices)
    a138290 n = a138290_list !! (n-1)
    a138290_list = map (+ 1) $ tail $ elemIndices 0 a208083_list
    -- Reinhard Zumkeller, Feb 23 2012
    
  • Mathematica
    t={}; Do[num=2^(n+1)-1; k=0; While[kHarvey P. Dale, Apr 09 2022 *)
  • PARI
    isok(m) = my(nb=0); for (k=0, m-1, if (!ispseudoprime(2^(m+1) - 2^k - 1), nb++, break)); nb==m; \\ Michel Marcus, Sep 13 2021
  • Python
    from sympy import isprime
    A138290_list = []
    for n in range(1,10**3):
        k2, n2 = 1, 2**(n+1)
        for k in range(n):
            if isprime(n2-k2-1):
                    break
            k2 *= 2
        else:
            A138290_list.append(n) # Chai Wah Wu, Sep 07 2021
    

Formula

For these m, A095058(m) = 0 and A110700(m) > 1.
For n > 0, a(n) = A369375(n+1) - 1. - Thomas Ordowski, Mar 20 2024

A181741 Primes of the form 2^t-2^k-1, k>=1.

Original entry on oeis.org

3, 5, 7, 11, 13, 23, 29, 31, 47, 59, 61, 127, 191, 223, 239, 251, 383, 479, 503, 509, 991, 1019, 1021, 2039, 3583, 3967, 4079, 4091, 4093, 6143, 8191, 15359, 16127, 16319, 16381, 63487, 65407, 65519, 129023, 131063, 131071, 245759, 253951, 261631, 261887, 262079, 262111, 262127, 262139
Offset: 1

Views

Author

Vladimir Shevelev, Nov 08 2010

Keywords

Comments

All Mersenne primes A000668(i) are in the sequence, parametrized by t=A000043(i)+1 and k=A000043(i).
If p is in the sequence, then the exponents t and k are unique.
For given k, the smallest value of t defines sequence A181692.
Every term p=2^t-2^k-1 in this sequence here generates an entry 2^(t-1)*p in A181595 (cf. A181701).

Crossrefs

Cf. A010051, primes in A081118, see also A208083.

Programs

  • Haskell
    a181741 n = a181741_list !! (n-1)
    a181741_list = filter ((== 1) . a010051) a081118_list
    -- Reinhard Zumkeller, Feb 23 2012
    
  • Maple
    isA000079 := proc(n) if n = 1 then true; elif type(n,'odd') then false; else if nops( numtheory[factorset](n) ) = 1 then  true;  else
    false; end if; end if; end proc:
    isA181741 := proc(p) if isprime(p) then k := A007814(p+1) ; (p+1)/2^k+1 ; return ( isA000079(%) and k >=1 ) ; else
    false;  end if; end proc:
    for i from 1 to 1000 do p := ithprime(i) ; if isA181741(p) then printf("%d,",p) ; end if; end do: # R. J. Mathar, Nov 18 2010
  • Mathematica
    Select[Table[2^t-2^k-1, {t, 1, 20}, {k, 1, t-1}] // Flatten // Union, PrimeQ] (* Jean-François Alcover, Nov 16 2017 *)
  • PARI
    lista(nn) = {for (n=3, nn, forstep(k=n-1, 1, -1, if (isprime(p=2^n-2^k-1), print1(p, ", "));););} \\ Michel Marcus, Dec 17 2018
    
  • Python
    from itertools import count, islice
    from sympy import isprime
    def A181741_gen(): # generator of terms
        m = 2
        for t in count(1):
            r=1<>=1
            m<<=1
    A181741_list = list(islice(A181741_gen(),30)) # Chai Wah Wu, Jul 08 2022

Formula

Conjecture: equals the intersection of A000040 and A081118 or the intersection of A000040 and A089633. [R. J. Mathar, Nov 18 2010]

Extensions

Corrected (251 and 1019 inserted) and extended by R. J. Mathar, Nov 18 2010

A224195 Ordered sequence of numbers of form (2^n - 1)*2^m + 1 where n >= 1, m >= 1.

Original entry on oeis.org

3, 5, 7, 9, 13, 15, 17, 25, 29, 31, 33, 49, 57, 61, 63, 65, 97, 113, 121, 125, 127, 129, 193, 225, 241, 249, 253, 255, 257, 385, 449, 481, 497, 505, 509, 511, 513, 769, 897, 961, 993, 1009, 1017, 1021, 1023, 1025, 1537, 1793, 1921, 1985, 2017, 2033, 2041, 2045, 2047
Offset: 1

Views

Author

Brad Clardy, Apr 01 2013

Keywords

Comments

The table is constructed so that row labels are 2^n - 1, and column labels are 2^n. The body of the table is the row*col + 1. A MAGMA program is provided that generates the numbers in a table format. The sequence is read along the antidiagonals starting from the top left corner.
All of these numbers have the following property:
let m be a member of A(n),
if a sequence B(n) = all i such that i XOR (m - 1) = i - (m - 1), then
the differences between successive members of B(n) is a repeating series
of 1's with the last difference in the pattern m. The number of ones in
the pattern is 2^j - 1, where j is the column index.
As an example consider A(4) which is 9,
the sequence B(n) where i XOR 8 = i - 8 starts as:
8, 9, 10, 11, 12, 13, 14, 15, 24... (A115419)
with successive differences of:
1, 1, 1, 1, 1, 1, 1, 9.
The main diagonal is the 6th cyclotomic polynomial evaluated at powers of two (A020515).
The formula for diagonals above the main diagonal
2^(2*n+1) - 2^(n + (a+1)/2) + 1 n>=(a+1)/2 a=odd number above diagonal
2^(2*n) - 2^(n + (b/2)) + 1 n>=(b/2)+1 b=even number above diagonal
The formulas for diagonals below the main diagonal
2^(2*n+1) - 2^(n + 1 -(a+1)/2) + 1 n>=(a+1)/2 a=odd number below diagonal
2^(2*n) - 2^(n - (b/2)) + 1 n>=(b/2)+1 b=even number below diagonal
Primes of this sequence are in A152449.

Examples

			Using the lexicographic ordering of A057555 the sequence is:
A(n) = Table(i,j) with (i,j)=(1,1),(1,2),(2,1),(1,3),(2,2),(3,1)...
  +1  |    2    4     8    16    32     64    128    256     512    1024 ...
  ----|-----------------------------------------------------------------
  1   |    3    5     9    17    33     65    129    257     513    1025
  3   |    7   13    25    49    97    193    385    769    1537    3073
  7   |   15   29    57   113   225    449    897   1793    3585    7169
  15  |   31   61   121   241   481    961   1921   3841    7681   15361
  31  |   63  125   249   497   993   1985   3969   7937   15873   31745
  63  |  127  253   505  1009  2017   4033   8065  16129   32257   64513
  127 |  255  509  1017  2033  4065   8129  16257  32513   65025  130049
  255 |  511 1021  2041  4081  8161  16321  32641  65281  130561  261121
  511 | 1023 2045  4089  8177 16353  32705  65409 130817  261633  523265
  1023| 2047 4093  8185 16369 32737  65473 130945 261889  523777 1047553
  ...
		

Crossrefs

Cf. A081118, A152449 (primes), A057555 (lexicographic ordering), A115419 (example).
Rows: A000051(i=1), A181565(2), A083686(3), A195744(4), A206371(5), A196657(6).
Cols: A000225(j=1), A036563(2), A048490(3), A176303 (7 offset of 8).
Diagonals: A020515 (main), A092440, A060867 (above), A134169 (below).

Programs

  • Magma
    //program generates values in a table form
    for i:=1 to 10 do
        m:=2^i - 1;
        m,[ m*2^n +1 : n in [1..10]];
    end for;
    //program generates sequence in lexicographic ordering of A057555, read
    //along antidiagonals from top. Primes in the sequence are marked with *.
    for i:=2 to 18 do
        for j:=1 to i-1 do
           m:=2^j -1;
           k:=m*2^(i-j) + 1;
           if IsPrime(k) then k,"*";
              else k;
           end if;;
        end for;
    end for;
  • Mathematica
    Table[(2^j-1)*2^(i-j+1) + 1, {i, 10}, {j, i}] (* Paolo Xausa, Apr 02 2024 *)

Formula

a(n) = (2^(A057555(2*n-1)) - 1)*2^(A057555(2*n)) + 1 for n>=1. [corrected by Jason Yuen, Feb 22 2025]
a(n) = A081118(n)+2; a(n)=(2^i-1)*2^j+1, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor((-1+sqrt(8*n-7))/2). - Boris Putievskiy, Apr 04 2013

A131094 Triangle where n-th row contains the smallest n positive integers (listed in order) with exactly n nonleading 0's in their binary representations.

Original entry on oeis.org

2, 4, 9, 8, 17, 18, 16, 33, 34, 36, 32, 65, 66, 68, 72, 64, 129, 130, 132, 136, 144, 128, 257, 258, 260, 264, 272, 288, 256, 513, 514, 516, 520, 528, 544, 576, 512, 1025, 1026, 1028, 1032, 1040, 1056, 1088, 1152, 1024, 2049, 2050, 2052, 2056, 2064, 2080, 2112
Offset: 1

Views

Author

Leroy Quet, Jun 14 2007

Keywords

Examples

			Binary representations of the terms in the first few rows:
10
100, 1001
1000, 10001, 10010
10000, 100001, 100010, 100100
		

Crossrefs

Programs

  • Haskell
    import Data.List (sort, nub)
    a131094 n k = a131094_tabl !! (n-1) !! (k-1)
    a131094_row n = a131094_tabl !! (n-1)
    a131094_tabl = [2] : f 2 [2] where
       f v ws = ys : f (v + 1) ys where
                ys = take v $ nub $ sort $ concatMap h ws
       h z = [2 * z, 4 * z + 1, 4 * z' + b] where (z', b) = divMod z 2
    -- Reinhard Zumkeller, Feb 11 2015
  • Maple
    A080791 := proc(n) local bdigs ; bdigs := convert(n,base,2) ; nops(bdigs)-add(i,i=bdigs) ; end: A131094 := proc(n) local a,i; a := [] ; i := 2^n ; while nops(a) < n do while A080791(i) <> n do i := i+1 ; od: a := [op(a),i] ; i := i+1 ; od: RETURN(a) ; end: seq(op(A131094(n)),n=1..10) ; # R. J. Mathar, Oct 17 2007

Extensions

More terms from R. J. Mathar, Oct 17 2007

A131095 Triangle where n-th row contains the smallest n positive integers (listed in order) with exactly n nonleading 0's in their binary representations and where the smallest term in the n-th row is > that the largest term in the (n-1)th row.

Original entry on oeis.org

2, 4, 9, 17, 18, 20, 33, 34, 36, 40, 65, 66, 68, 72, 80, 129, 130, 132, 136, 144, 160, 257, 258, 260, 264, 272, 288, 320, 513, 514, 516, 520, 528, 544, 576, 640, 1025, 1026, 1028, 1032, 1040, 1056, 1088, 1152, 1280, 2049, 2050, 2052, 2056, 2064, 2080, 2112, 2176
Offset: 1

Views

Author

Leroy Quet, Jun 14 2007

Keywords

Examples

			Binary representations of the terms in the first few rows:
10
100, 1001
10001, 10010, 10100
100001, 100010, 100100, 101000
		

Crossrefs

Programs

  • Haskell
    import Data.List (sort, nub)
    a131095 n k = a131095_tabl !! (n-1) !! (k-1)
    a131095_row n = a131095_tabl !! (n-1)
    a131095_tabl = [2] : [4, 9] : [17, 18, 20] : f 4 [17, 18, 20] where
       f v ws = ys : f (v + 1) ys where
         ys = take v $ dropWhile (<= last ws) $ nub $ sort $ concatMap h ws
       h z = [2 * z, 4 * z + 1, 4 * z' + b] where (z', b) = divMod z 2
    -- Reinhard Zumkeller, Feb 11 2015
  • Maple
    A023416 := proc(n) local brep,i ; brep := convert(n,base,2) ; add( 1-op(i,brep),i=1..nops(brep)) ; end: A131095 := proc(rowmax) local a,r,c ; a := 2 ; for r from 1 to rowmax do c := 1 ; while c <= r do if A023416(a) = r then printf("%d, ",a) ; c := c+1 ; fi ; a := a+1 ; od ; od ; end: A131095(10) ; # R. J. Mathar, Jun 15 2007

Extensions

More terms from R. J. Mathar, Jun 15 2007

A368214 Primes with a single 0-bit in binary expansion such that changing the position of the 0-bit always gives a nonprime (including the one with a leading zero).

Original entry on oeis.org

2, 2039, 6143, 522239, 33546239, 260046847, 16911433727, 32212254719, 2196875771903, 140735340871679, 2251799813685119, 9005000231485439, 576460752169205759, 36893488147410714623, 147573811852188057599, 9444732965739282038783, 154742504910672534362390399
Offset: 1

Views

Author

Ya-Ping Lu, Dec 23 2023

Keywords

Comments

It seems that most of the terms end with '9', followed by those ending with '3', '7', and '1'.

Examples

			2 is a term because 2 is a prime with one '0' in binary form ('10') and '01' is not a prime. 2039 is a term because 2039 is a prime with one '0' in binary form ('11111110111') and changing the position of the '0', for example, '11111111011' = 2043 and '01111111111' = 1023, always results in a composite.
		

Crossrefs

Subsequence of A095078.

Programs

  • Python
    from sympy import isprime
    for n in range(1,100):
        s = n*'1'; c = 0
        for j in range(n+1):
            num = int(s[:j]+'0'+s[j:], 2)
            if isprime(num):
                c += 1
                if c == 1: r = num
                if c == 2: break
        if c == 1: print(r, end = ', ')
Showing 1-9 of 9 results.