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 17 results. Next

A031013 Position of n-th 5 in A031007.

Original entry on oeis.org

5, 17, 31, 45, 59, 64, 66, 68, 70, 72, 73, 74, 76, 87, 106, 127, 148, 169, 190, 197, 200, 203, 206, 209, 211, 212, 215, 232, 253, 274, 295, 316, 337, 344, 347, 350, 353, 356, 358, 359, 362, 379, 400, 421, 442, 463, 484, 491, 494
Offset: 1

Views

Author

Keywords

Programs

  • Mathematica
    Flatten[Position[Flatten[Table[Reverse[IntegerDigits[n,7]],{n,0,200}]],5]]-1 (* Harvey P. Dale, Feb 25 2014 *)

A031008 Position of n-th 0 in A031007.

Original entry on oeis.org

0, 7, 21, 35, 49, 63, 77, 91, 92, 95, 98, 101, 104, 107, 110, 112, 133, 154, 175, 196, 217, 238, 239, 242, 245, 248, 251, 254, 257, 259, 280, 301, 322, 343, 364, 385, 386, 389, 392, 395, 398, 401, 404, 406, 427, 448, 469, 490, 511
Offset: 1

Views

Author

Keywords

Programs

  • Mathematica
    Rest[Flatten[Position[Flatten[Table[Reverse[IntegerDigits[n,7]],{n,0,200}]],0]]]-1 (* Harvey P. Dale, Jun 08 2017 *)

Extensions

Missing a(1)=0 inserted by Sean A. Irvine, Apr 10 2020

A031009 Position of n-th 1 in A031007.

Original entry on oeis.org

1, 8, 9, 10, 12, 14, 16, 18, 20, 23, 37, 51, 65, 79, 93, 94, 96, 99, 102, 105, 108, 111, 113, 114, 115, 116, 117, 119, 120, 122, 123, 125, 126, 128, 129, 131, 132, 135, 136, 138, 141, 144, 147, 150, 153, 156, 157, 159, 162, 165, 168
Offset: 1

Views

Author

Keywords

A031010 Position of n-th 2 in A031007.

Original entry on oeis.org

2, 11, 22, 24, 25, 26, 28, 30, 32, 34, 39, 53, 67, 81, 97, 118, 134, 137, 139, 140, 143, 146, 149, 152, 160, 181, 202, 223, 240, 243, 244, 246, 249, 252, 255, 258, 261, 264, 265, 267, 270, 273, 276, 279, 281, 282, 284, 285, 286
Offset: 1

Views

Author

Keywords

A031011 Position of n-th 3 in A031007.

Original entry on oeis.org

3, 13, 27, 36, 38, 40, 41, 42, 44, 46, 48, 55, 69, 83, 100, 121, 142, 155, 158, 161, 163, 164, 167, 170, 173, 184, 205, 226, 247, 268, 289, 302, 305, 308, 310, 311, 314, 317, 320, 331, 352, 373, 387, 390, 393, 394, 396, 399, 402
Offset: 1

Views

Author

Keywords

Programs

  • Mathematica
    (Position[Flatten[Table[Reverse[IntegerDigits[n,7]],{n,0,200}]],3]//Flatten)-1 (* Harvey P. Dale, Sep 10 2024 *)

A031012 Position of n-th 4 in A031007.

Original entry on oeis.org

4, 15, 29, 43, 50, 52, 54, 56, 57, 58, 60, 62, 71, 85, 103, 124, 145, 166, 176, 179, 182, 185, 187, 188, 191, 194, 208, 229, 250, 271, 292, 313, 323, 326, 329, 332, 334, 335, 338, 341, 355, 376, 397, 418, 439, 460, 470, 473, 476
Offset: 1

Views

Author

Keywords

A031014 Position of n-th 6 in A031007.

Original entry on oeis.org

6, 19, 33, 47, 61, 75, 78, 80, 82, 84, 86, 88, 89, 90, 109, 130, 151, 172, 193, 214, 218, 221, 224, 227, 230, 233, 235, 236, 256, 277, 298, 319, 340, 361, 365, 368, 371, 374, 377, 380, 382, 383, 403, 424, 445, 466, 487, 508, 512
Offset: 1

Views

Author

Keywords

A031015 a(n)=least k such that base 7 representation of n begins at s(k), where s=A031007.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 20, 8, 1, 12, 14, 16, 18, 34, 11, 24, 2, 28, 30, 32, 48, 13, 27, 40, 3, 44, 46, 62, 15, 29, 43, 56, 4, 60, 76, 17, 31, 45, 59, 72, 5, 6, 19, 33, 47, 61, 75, 88, 237, 94, 20, 153, 174, 195, 216, 93, 8, 9, 119, 122, 125, 128, 96
Offset: 1

Views

Author

Keywords

A030308 Triangle T(n, k): Write n in base 2, reverse order of digits, to get the n-th row.

Original entry on oeis.org

0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1
Offset: 0

Views

Author

Keywords

Comments

This is the quite common, so-called "bittest" function, see PARI code. - M. F. Hasler, Jul 21 2013
For a given number m and a digit position k the corresponding sequence index n can be calculated by n(m, k) = m*(1 + floor(log_2(m))) - 2^(1 + floor(log_2(m))) + k + 1. For example: counted from right to left, the second digit of m = 13 (binary 1101) is '0'. Hence the sequence index is n = n(13, 2) = 39. - Hieronymus Fischer, May 05 2007
A070939(n) is the length of n-th row; A000120(n) is the sum of n-th row; A030101(n) is the n-th row seen as binary number; A000035(n) = T(n, 0). - Reinhard Zumkeller, Jun 17 2012

Examples

			Triangle begins :
0
1
0, 1
1, 1
0, 0, 1
1, 0, 1
0, 1, 1
1, 1, 1
0, 0, 0, 1
1, 0, 0, 1 - _Philippe Deléham_, Oct 12 2011
		

Crossrefs

Cf. A030190.
Cf. A030341, A030386, A031235, A030567, A031007, A031045, A031087, A031298 for the base-3 to base-10 analogs.

Programs

  • Haskell
    a030308 n k = a030308_tabf !! n !! k
    a030308_row n = a030308_tabf !! n
    a030308_tabf = iterate bSucc [0] where
       bSucc []       = [1]
       bSucc (0 : bs) = 1 : bs
       bSucc (1 : bs) = 0 : bSucc bs
    -- Reinhard Zumkeller, Jun 17 2012
    
  • Maple
    A030308_row := n -> op(convert(n,base, 2)):
    seq(A030308_row(n), n=0..23); # Peter Luschny, Nov 28 2017
  • Mathematica
    Flatten[Table[Reverse[IntegerDigits[n, 2]], {n, 0, 23}]] (* T. D. Noe, Oct 12 2011 *)
  • PARI
    A030308(n,k)=bittest(n,k) \\ Assuming that columns are numbered starting with k=0, as suggested by the formula from R. Zumkeller. - M. F. Hasler, Jul 21 2013
    
  • Python
    for n in range(20): print([int(z) for z in str(bin(n)[2:])[::-1]]) # Indranil Ghosh, Mar 31 2017
    
  • Sage
    A030308_row = lambda n: n.bits() if n > 0 else [0]
    for n in (0..23): print(A030308_row(n)) # Peter Luschny, Nov 28 2017
    
  • Scala
    (0 to 31).map(Integer.toString(, 2).reverse).mkString.split("").map(Integer.parseInt()).toList // Alonso del Arte, Feb 10 2020

Formula

a(n) = floor(m/2^(k - 1)) mod 2, where m = max(j|A001855(j) < n) and k = n - A001855(m). - Hieronymus Fischer, May 05 2007, Sep 10 2007
T(n, k) = (n // 2^k) mod 2, for 0 <= k <= log[2](n) and n > 0; T(0, 0) = 0. ('//' denotes integer division). - Peter Luschny, Apr 20 2023

Extensions

Initial 0 and better name by Philippe Deléham, Oct 12 2011

A030341 Triangle T(n,k): write n in base 3, reverse order of digits.

Original entry on oeis.org

0, 1, 2, 0, 1, 1, 1, 2, 1, 0, 2, 1, 2, 2, 2, 0, 0, 1, 1, 0, 1, 2, 0, 1, 0, 1, 1, 1, 1, 1, 2, 1, 1, 0, 2, 1, 1, 2, 1, 2, 2, 1, 0, 0, 2, 1, 0, 2, 2, 0, 2, 0, 1, 2, 1, 1, 2, 2, 1, 2, 0, 2, 2, 1, 2, 2, 2, 2, 2, 0, 0, 0, 1, 1, 0, 0, 1, 2, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 2, 1, 0, 1
Offset: 0

Views

Author

Keywords

Examples

			Triangle begins :
0
1
2
0, 1
1, 1
2, 1
0, 2
1, 2
2, 2
0, 0, 1
1, 0, 1
2, 0, 1
0, 1, 1
1, 1, 1
2, 1, 1 ...
		

Crossrefs

Cf. A081604 (row lengths), A053735 (row sums), A007089, A003137.
Cf. A030308, A030386, A031235, A030567, A031007, A031045, A031087, A031298 for the base-2 to base-10 analogs.

Programs

  • Haskell
    a030341 n k = a030341_tabf !! n !! k
    a030341_row n = a030341_tabf !! n
    a030341_tabf = iterate succ [0] where
       succ []     = [1]
       succ (2:ts) = 0 : succ ts
       succ (t:ts) = (t + 1) : ts
    -- Reinhard Zumkeller, Feb 21 2013
    
  • Maple
    A030341_row := n -> op(convert(n, base, 3)):
    seq(A030341_row(n), n=0..32); # Peter Luschny, Nov 28 2017
  • Mathematica
    Flatten[Table[Reverse[IntegerDigits[n,3]],{n,0,40}]] (* Harvey P. Dale, Oct 20 2014 *)
  • PARI
    A030341(n, k=-1)=/*k<0&&error("Flattened sequence not yet implemented.")*/n\3^k%3 \\ Assuming that columns are numbered starting with k=0 as in A030308, A030567 and others. - M. F. Hasler, Jul 21 2013

Extensions

Initial 0 and better name by Philippe Deléham, Oct 20 2011
Showing 1-10 of 17 results. Next