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

A082554 Primes whose base-2 representation is a block of 1's, followed by a block of 0's, followed by a block of 1's.

Original entry on oeis.org

5, 11, 13, 17, 19, 23, 29, 47, 59, 61, 67, 71, 79, 97, 103, 113, 131, 191, 193, 199, 223, 227, 239, 241, 251, 257, 263, 271, 383, 449, 463, 479, 487, 499, 503, 509, 769, 911, 967, 991, 1009, 1019, 1021, 1031, 1039, 1087, 1151, 1279, 1543, 1567, 1663, 1823
Offset: 1

Views

Author

Randy L. Ekl, May 03 2003

Keywords

Comments

The n-th prime is a term iff A100714(n) = 3. - Joseph Biberstine (jrbibers(AT)indiana.edu), Dec 11 2004
A019434 \{3} is a subsequence, since the base-2 representation of a Fermat prime 2^(2^k)+1 > 3 is a single 1, followed by a block of 2^k-1 0's, followed by a last single 1. - Bernard Schott, Mar 07 2023

Examples

			1987 = 11111000011_2, which is a block of 5 1's, followed by a block of 4 0's, followed by a block of 2 1's, so 1987 is a term.
a(3)=17 is a term because it is the 3rd prime whose binary representation splits into exactly three runs: 17_10 = 10001_2 splits into {{1}, {0,0,0}, {1}}.
		

Crossrefs

Cf. A100714, A000040. Primes in A043570.
Cf. A019434.

Programs

  • Mathematica
    Select[Table[Prime[k], {k, 1, 500}], Length[Split[IntegerDigits[ #, 2]]] == 3 &]
  • PARI
    decomp(s)=if(s%2==0,return(1),); k=1; while(k==1,k=s%2; s=floor(s/2)); if(s==0,return(1),); while(k==0,k=s%2; s=floor(s/2)); while(k==1,k=s%2; s=floor(s/2)); return(s)
    forprime(i=1,2000,if(decomp(i)==0,print1(i,", ")))
    
  • Python
    from sympy import isprime
    from itertools import count, islice
    def agen(): yield from filter(isprime, ((1<Michael S. Branicky, Feb 25 2023

A341694 Square array T(n, k) read by antidiagonals upwards, n, k > 0: T(n, k) = A227736(n, k) for k = 1..A005811(n), and T(n, k) = T(n, k - A005811(n)) + ... + T(n, k-1) for k > A005811(n).

Original entry on oeis.org

1, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1, 1, 2, 3, 1, 1, 1, 3, 2, 5, 1, 3, 2, 1, 4, 2, 8, 1, 3, 3, 3, 3, 7, 2, 13, 1, 1, 1, 3, 5, 5, 11, 2, 21, 1, 1, 2, 4, 3, 8, 9, 18, 2, 34, 1, 2, 1, 1, 5, 3, 13, 17, 29, 2, 55, 1, 2, 1, 1, 4, 9, 3, 21, 31, 47, 2, 89, 1
Offset: 1

Views

Author

Rémy Sigrist, Feb 17 2021

Keywords

Comments

This table contains all Fibonacci sequences of order m > 0 with positive terms:
- order 1 corresponds to constant sequences (n in A126646),
- order 2 corresponds to Fibonacci-like sequences (n in A043569),
- order 3 corresponds to tribonacci-like sequences (n in A043570),
- order 4 corresponds to tetranacci-like sequences (n in A043571).
For any n > 0, the row A341746(n) corresponds to the n-th row from which the first term has been removed.

Examples

			Array T(n, k) begins:
  n\k|  1  2  3  4  5   6   7   8   9   10   11   12   13    14
  ---+---------------------------------------------------------
    1|  1  1  1  1  1   1   1   1   1    1    1    1    1     1 --> A000012
    2|  1  1  2  3  5   8  13  21  34   55   89  144  233   377 --> A000045
    3|  2  2  2  2  2   2   2   2   2    2    2    2    2     2 --> A007395
    4|  2  1  3  4  7  11  18  29  47   76  123  199  322   521 --> A000032
    5|  1  1  1  3  5   9  17  31  57  105  193  355  653  1201 --> A000213
    6|  1  2  3  5  8  13  21  34  55   89  144  233  377   610 --> A000045
    7|  3  3  3  3  3   3   3   3   3    3    3    3    3     3 --> A010701
    8|  3  1  4  5  9  14  23  37  60   97  157  254  411   665 --> A104449
    9|  1  2  1  4  7  12  23  42  77  142  261  480  883  1624 --> A275778
   10|  1  1  1  1  4   7  13  25  49   94  181  349  673  1297 --> A000288
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

T(A341746(n), k) = T(n, k+1).
T(n, 1) = A136480(n).

A370698 Rectangular array, read by antidiagonals: row n consists of the numbers m whose binary representation has exactly n runs.

Original entry on oeis.org

1, 3, 2, 7, 4, 5, 15, 6, 9, 10, 31, 8, 11, 18, 21, 63, 12, 13, 20, 37, 42, 127, 14, 17, 22, 41, 74, 85, 255, 16, 19, 26, 43, 82, 149, 170, 511, 24, 23, 34, 45, 84, 165, 298, 341, 1023, 28, 25, 36, 53, 86, 169, 330, 597, 682, 2047, 30, 27, 38, 69, 90, 171
Offset: 1

Views

Author

Clark Kimberling, Mar 11 2024

Keywords

Comments

Every positive integer occurs exactly once, and for every n, the numbers in row n have the parity of n.

Examples

			Corner:
    1    3    7   15   31   63  127  255
    2    4    6    8   12   14   16   24
    5    9   11   13   17   19   23   25
   10   18   20   22   26   34   36   38
   21   37   41   43   45   53   69   73
   42   74   82   84   86   90  106  138
   85  149  165  169  171  173  181  213
  170  298  330  338  340  342  346  362
  341  597  661  677  681  683  685  693
The binary representation of 22 is 10110, which has 4 runs: 1, 0, 11, 0.
		

Crossrefs

Cf. A007089, A005811 (# runs in binary n), A000225 (row 1), A043569 (row 2), A043570 (row 3), A000975 (column 1), A370893 (ternary).

Programs

  • Mathematica
    a[n_] := a[n] = Select[Range[8000], Length[Split[IntegerDigits[#, 2]]] == n &];
    t[n_, k_] := a[n][[k]];
    Grid[Table[t[n, k], {n, 1, 12}, {k, 1, 12}]] (* array *)
    Table[t[n - k + 1, k], {n, 12}, {k, n, 1, -1}] // Flatten (* sequence *)
Showing 1-3 of 3 results.