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

A002275 Repunits: (10^n - 1)/9. Often denoted by R_n.

Original entry on oeis.org

0, 1, 11, 111, 1111, 11111, 111111, 1111111, 11111111, 111111111, 1111111111, 11111111111, 111111111111, 1111111111111, 11111111111111, 111111111111111, 1111111111111111, 11111111111111111, 111111111111111111, 1111111111111111111, 11111111111111111111
Offset: 0

Views

Author

Keywords

Comments

R_n is a string of n 1's.
Base-4 representation of Jacobsthal bisection sequence A002450. E.g., a(4)= 1111 because A002450(4)= 85 (in base 10) = 64 + 16 + 4 + 1 = 1*(4^3) + 1*(4^2) + 1*(4^1) + 1. - Paul Barry, Mar 12 2004
Except for the first two terms, these numbers cannot be perfect squares, because x^2 != 11 (mod 100). - Zak Seidov, Dec 05 2008
For n >= 0: a(n) = (A000225(n) written in base 2). - Jaroslav Krizek, Jul 27 2009, edited by M. F. Hasler, Jul 03 2020
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=1, A[i,i]:=10, (i>1), A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n>=1, a(n)=det(A). - Milan Janjic, Feb 21 2010
Except 0, 1 and 11, all these integers are Brazilian numbers, A125134. - Bernard Schott, Dec 24 2012
Numbers n such that 11...111 = R_n = (10^n - 1)/9 is prime are in A004023. - Bernard Schott, Dec 24 2012
The terms 0 and 1 are the only squares in this sequence, as a(n) == 3 (mod 4) for n>=2. - Nehul Yadav, Sep 26 2013
For n>=2 the multiplicative order of 10 modulo the a(n) is n. - Robert G. Wilson v, Aug 20 2014
The above is a special case of the statement that the order of z modulo (z^n-1)/(z-1) is n, here for z=10. - Joerg Arndt, Aug 21 2014
From Peter Bala, Sep 20 2015: (Start)
Let d be a divisor of a(n). Let m*d be any multiple of d. Split the decimal expansion of m*d into 2 blocks of contiguous digits a and b, so we have m*d = 10^k*a + b for some k, where 0 <= k < number of decimal digits of m*d. Then d divides a^n - (-b)^n (see McGough). For example, 271 divides a(5) and we find 2^5 + 71^5 = 11*73*271*8291 and 27^5 + 1^5 = 2^2*7*31*61*271 are both divisible by 271. Similarly, 4*271 = 1084 and 10^5 + 84^5 = 2^5*31*47*271*331 while 108^5 + 4^5 = 2^12*7*31*61*271 are again both divisible by 271. (End)
Starting with the second term this sequence is the binary representation of the n-th iteration of the Rule 220 and 252 elementary cellular automaton starting with a single ON (black) cell. - Robert Price, Feb 21 2016
If p > 5 is a prime, then p divides a(p-1). - Thomas Ordowski, Apr 10 2016
0, 1 and 11 are only terms that are of the form x^2 + y^2 + z^2 where x, y, z are integers. In other words, a(n) is a member of A004215 for all n > 2. - Altug Alkan, May 08 2016
Except for the initial terms, the binary 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 737", based on the 5-celled von Neumann neighborhood, initialized with a single black (ON) cell at stage zero. - Robert Price, Mar 17 2017
The term "repunit" was coined by Albert H. Beiler in 1964. - Amiram Eldar, Nov 13 2020
q-integers for q = 10. - John Keith, Apr 12 2021
Binomial transform of A001019 with leading zero. - Jules Beauchamp, Jan 04 2022

References

  • Albert H. Beiler, Recreations in the Theory of Numbers: The Queen of Mathematics Entertains, New York: Dover Publications, 1964, chapter XI, p. 83.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 235-237.
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers, Penguin Books, 1987, pp. 197-198.
  • Samuel Yates, Peculiar Properties of Repunits, J. Recr. Math. 2, 139-146, 1969.
  • Samuel Yates, Prime Divisors of Repunits, J. Recr. Math. 8, 33-38, 1975.

Crossrefs

Programs

  • Haskell
    a002275 = (`div` 9) . subtract 1 . (10 ^)
    a002275_list = iterate ((+ 1) . (* 10)) 0
    -- Reinhard Zumkeller, Jul 05 2013, Feb 05 2012
    
  • Magma
    [(10^n-1)/9: n in [0..25]]; // Vincenzo Librandi, Nov 06 2014
    
  • Maple
    seq((10^k - 1)/9, k=0..30); # Wesley Ivan Hurt, Sep 28 2013
  • Mathematica
    Table[(10^n - 1)/9, {n, 0, 19}] (* Alonso del Arte, Nov 15 2011 *)
    Join[{0},Table[FromDigits[PadRight[{},n,1]],{n,20}]] (* Harvey P. Dale, Mar 04 2012 *)
  • Maxima
    a[0]:0$
    a[1]:1$
    a[n]:=11*a[n-1]-10*a[n-2]$
    A002275(n):=a[n]$
    makelist(A002275(n),n,0,30); /* Martin Ettl, Nov 05 2012 */
    
  • PARI
    a(n)=(10^n-1)/9; \\ Michael B. Porter, Oct 26 2009
    
  • PARI
    my(x='x+O('x^30)); concat(0, Vec(x/((1-10*x)*(1-x)))) \\ Altug Alkan, Apr 10 2016
    
  • Python
    print([(10**n-1)//9 for n in range(100)]) # Michael S. Branicky, Apr 30 2022
  • Sage
    [lucas_number1(n, 11, 10) for n in range(21)]  # Zerinvary Lajos, Apr 27 2009
    

Formula

a(n) = 10*a(n-1) + 1, a(0)=0.
a(n) = A000042(n) for n >= 1.
Second binomial transform of Jacobsthal trisection A001045(3n)/3 (A015565). - Paul Barry, Mar 24 2004
G.f.: x/((1-10*x)*(1-x)). Regarded as base b numbers, g.f. x/((1-b*x)*(1-x)). - Franklin T. Adams-Watters, Jun 15 2006
a(n) = 11*a(n-1) - 10*a(n-2), a(0)=0, a(1)=1. - Lekraj Beedassy, Jun 07 2006
a(n) = A125118(n,9) for n>8. - Reinhard Zumkeller, Nov 21 2006
a(n) = A075412(n)/A002283(n). - Reinhard Zumkeller, May 31 2010
a(n) = a(n-1) + 10^(n-1) with a(0)=0. - Vincenzo Librandi, Jul 22 2010
a(n) = A242614(n,A242622(n)). - Reinhard Zumkeller, Jul 17 2014
E.g.f.: (exp(9*x) - 1)*exp(x)/9. - Ilya Gutkovskiy, May 11 2016
a(n) = Sum_{k=0..n-1} 10^k. - Torlach Rush, Nov 03 2020
Sum_{n>=1} 1/a(n) = A065444. - Amiram Eldar, Nov 13 2020
From Elmo R. Oliveira, Aug 02 2025: (Start)
a(n) = A002283(n)/9 = A105279(n)/10.
a(n) = A010785(A017173(n-1)) for n >= 1. (End)

A228275 A(n,k) = Sum_{i=1..k} n^i; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 0, 3, 6, 3, 0, 0, 4, 14, 12, 4, 0, 0, 5, 30, 39, 20, 5, 0, 0, 6, 62, 120, 84, 30, 6, 0, 0, 7, 126, 363, 340, 155, 42, 7, 0, 0, 8, 254, 1092, 1364, 780, 258, 56, 8, 0, 0, 9, 510, 3279, 5460, 3905, 1554, 399, 72, 9, 0
Offset: 0

Views

Author

Alois P. Heinz, Aug 19 2013

Keywords

Comments

A(n,k) is the total sum of lengths of longest ending contiguous subsequences with the same value over all s in {1,...,n}^k:
A(4,1) = 4 = 1+1+1+1: [1], [2], [3], [4].
A(1,4) = 4: [1,1,1,1].
A(3,2) = 12 = 2+1+1+1+2+1+1+1+2: [1,1], [1,2], [1,3], [2,1], [2,2], [2,3], [3,1], [3,2], [3,3].
A(2,3) = 14 = 3+1+1+2+2+1+1+3: [1,1,1], [1,1,2], [1,2,1], [1,2,2], [2,1,1], [2,1,2], [2,2,1], [2,2,2].

Examples

			Square array A(n,k) begins:
  0, 0,  0,   0,    0,     0,      0,      0, ...
  0, 1,  2,   3,    4,     5,      6,      7, ...
  0, 2,  6,  14,   30,    62,    126,    254, ...
  0, 3, 12,  39,  120,   363,   1092,   3279, ...
  0, 4, 20,  84,  340,  1364,   5460,  21844, ...
  0, 5, 30, 155,  780,  3905,  19530,  97655, ...
  0, 6, 42, 258, 1554,  9330,  55986, 335922, ...
  0, 7, 56, 399, 2800, 19607, 137256, 960799, ...
		

Crossrefs

Rows n=0-11 give: A000004, A001477, A000918(k+1), A029858(k+1), A080674, A104891, A105281, A104896, A052379(k-1), A052386, A105279, A105280.
Main diagonal gives A031972.
Lower diagonal gives A226238.
Cf. A228250.

Programs

  • Maple
    A:= (n, k)-> `if`(n=1, k, (n/(n-1))*(n^k-1)):
    seq(seq(A(n, d-n), n=0..d), d=0..12);
  • Mathematica
    a[0, 0] = 0; a[1, k_] := k; a[n_, k_] := n*(n^k-1)/(n-1); Table[a[n-k, k], {n, 0, 12}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Dec 16 2013 *)

Formula

A(1,k) = k, else A(n,k) = n/(n-1)*(n^k-1).
A(n,k) = Sum_{i=1..k} n^i.
A(n,k) = Sum_{i=1..k+1} binomial(k+1,i)*A(n-i,k)*(-1)^(i+1) for n>k, given values A(0,k), A(1,k),..., A(k,k). - Yosu Yurramendi, Sep 03 2013

A281150 Elias delta code for n.

Original entry on oeis.org

1, 1000, 1001, 10100, 10101, 10110, 10111, 11000000, 11000001, 11000010, 11000011, 11000100, 11000101, 11000110, 11000111, 110010000, 110010001, 110010010, 110010011, 110010100, 110010101, 110010110, 110010111, 110011000, 110011001, 110011010
Offset: 1

Views

Author

Indranil Ghosh, Jan 16 2017

Keywords

Comments

The number of bits in a(n) is equal to A140341(n).
a(n) is the prefix-free encoding of n-1 defined on pages 180-181 of Shallit (2008). - N. J. A. Sloane, Mar 18 2019

Examples

			For n = 9, the first part is "11000" and the second part is "001". So a(9) = 11000001.
		

References

  • Shallit, Jeffrey. A second course in formal languages and automata theory. Cambridge University Press, 2008. See E(m) on page 181. - N. J. A. Sloane, Mar 18 2019

Crossrefs

Unary(n) = A105279(n-1).

Programs

  • Python
    import math
    def unary(n):
        return "1"*(n-1)+"0"
    def elias_gamma(n):
        if n==1:
            return "1"
        k=int(math.log(n, 2))
        fp=unary(1+k)    #fp is the first part
        sp=n-2**(k)      #sp is the second part
        nb=k             #nb is the number of bits used to store sp in binary
        sp=bin(sp)[2:]
        if len(sp)
    				

Formula

For a given integer n, a(n) is composed of two parts. The first part equals 1+floor(log_2 n) and the second part equals n-2^(floor(log_2 n)). The first part is stored in Elias Gamma Code and the second part is stored in a binary using floor(log_2 n) bits. The first and the second parts are concatenated to give a(n).

A281149 Elias gamma code (EGC) for n.

Original entry on oeis.org

1, 100, 101, 11000, 11001, 11010, 11011, 1110000, 1110001, 1110010, 1110011, 1110100, 1110101, 1110110, 1110111, 111100000, 111100001, 111100010, 111100011, 111100100, 111100101, 111100110, 111100111, 111101000, 111101001, 111101010, 111101011, 111101100, 111101101, 111101110
Offset: 1

Views

Author

Indranil Ghosh, Jan 16 2017

Keywords

Comments

This sequence is the binary equivalent of A171885 for n>=1 and is also mentioned in the example section of the same.
The number of bits of a(n) is equal to A129972(n).
Unary(n) = A105279(n-1).

Examples

			For n = 9, first part is "1110" and the second part is "001". So, a(9) = 1110001.
		

Crossrefs

Cf. A105279 (unary code for n), A129972, A171885.

Programs

  • Python
    def unary(n):
        return "1"*(n-1)+"0"
    def elias_gamma(n):
        if n ==1:
            return "1"
        k=int(math.log(n,2))
        fp=unary(1+k)    #fp is the first part
        sp=n-2**(k)      #sp is the second part
        nb=k             #nb is the number of bits used to store sp in binary
        sp=bin(sp)[2:]
        if len(sp)
    				

Formula

For a given integer n, it is stored in two parts. The first part equals 1+floor(log_2 n) and the second part equals n-2^(floor(log_2 n)). The first part is stored in unary and the second part is stored in binary using floor(log_2 n) bits. Now the first and the second parts are concatenated to give the answer.

A124166 a(n) = 100*(10^n - 1)/9.

Original entry on oeis.org

0, 100, 1100, 11100, 111100, 1111100, 11111100, 111111100, 1111111100, 11111111100, 111111111100, 1111111111100, 11111111111100, 111111111111100, 1111111111111100, 11111111111111100, 111111111111111100, 1111111111111111100, 11111111111111111100, 111111111111111111100
Offset: 0

Views

Author

Zerinvary Lajos, Dec 02 2006

Keywords

Crossrefs

Programs

  • Maple
    a:=n->sum (10^(n-j+2),j=0..n): seq(a(n),n=0..28);
  • Mathematica
    Table[FromDigits[PadLeft[{0,0},n,1]],{n,2,20}] (* Harvey P. Dale, Jul 24 2012 *)
  • PARI
    concat(0, Vec(100*x/((1-x)*(1-10*x)) + O(x^20))) \\ Elmo R. Oliveira, Jun 18 2025

Formula

From Elmo R. Oliveira, Jun 18 2025: (Start)
G.f.: 100*x/((10*x-1)*(x-1)).
E.g.f.: 100*exp(x)*(exp(9*x) - 1)/9.
a(n) = 100*A002275(n) = 10*A105279(n).
a(n) = A161770(n)/10 for n >= 1.
a(n) = 11*a(n-1) - 10*a(n-2). (End)

Extensions

More terms from Elmo R. Oliveira, Jun 18 2025

A161770 n 1's followed by three 0's.

Original entry on oeis.org

1000, 11000, 111000, 1111000, 11111000, 111111000, 1111111000, 11111111000, 111111111000, 1111111111000, 11111111111000, 111111111111000, 1111111111111000, 11111111111111000, 111111111111111000, 1111111111111111000, 11111111111111111000, 111111111111111111000
Offset: 1

Views

Author

Jaroslav Krizek, Jun 18 2009

Keywords

Comments

Sequence A159741 written in base 2.

Crossrefs

Programs

  • Mathematica
    Table[FromDigits[PadLeft[{0,0,0},n,1]],{n,4,20}] (* Harvey P. Dale, Aug 07 2023 *)

Formula

a(n) = 1000*(10^n - 1)/9 = 1000*A002275(n).
G.f.: 1000*x/((10*x-1)*(x-1)).
From Elmo R. Oliveira, Jun 18 2025: (Start)
E.g.f.: 1000*exp(x)*(exp(9*x) - 1)/9.
a(n) = 100*A105279(n) = 10*A124166(n).
a(n) = 11*a(n-1) - 10*a(n-2) for n > 2. (End)

Extensions

Edited by Charles R Greathouse IV, Oct 12 2009

A365644 Array read by ascending antidiagonals: A(n, k) = k*(10^n - 1)/9 with k >= 0.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 11, 2, 0, 0, 111, 22, 3, 0, 0, 1111, 222, 33, 4, 0, 0, 11111, 2222, 333, 44, 5, 0, 0, 111111, 22222, 3333, 444, 55, 6, 0, 0, 1111111, 222222, 33333, 4444, 555, 66, 7, 0, 0, 11111111, 2222222, 333333, 44444, 5555, 666, 77, 8, 0
Offset: 0

Views

Author

Stefano Spezia, Sep 14 2023

Keywords

Examples

			The array begins:
  0,     0,     0,     0,     0,     0, ...
  0,     1,     2,     3,     4,     5, ...
  0,    11,    22,    33,    44,    55, ...
  0,   111,   222,   333,   444,   555, ...
  0,  1111,  2222,  3333,  4444,  5555, ...
  0, 11111, 22222, 33333, 44444, 55555, ...
  ...
		

Crossrefs

Cf. A000004 (n=0 or k=0), A001477 (n=1), A002275 (k=1), A002276 (k=2), A002277 (k=3), A002278 (k=4), A002279 (k=5), A002280 (k=6), A002281 (k=7), A002282 (k=8), A002283 (k=9), A008593 (n=2), A053422 (main diagonal), A105279 (k=10), A132583, A177769 (n=3), A365645 (antidiagonal sums), A365646.

Programs

  • Mathematica
    A[n_,k_]:=k(10^n-1)/9; Table[A[n-k,k],{n,0,9},{k,0,n}]//Flatten

Formula

O.g.f.: x*y/((1 - x)*(1 - 10*x)*(1 - y)^2).
E.g.f.: y*exp(x+y)*(exp(9*x) - 1)/9.
A(n, 11) = A132583(n-1) for n > 0.
A(n, 12) = A073551(n+1) for n > 0.

A213087 Concatenate the binary representations of the nonnegative integers and form successive terms by inserting a comma after each zero.

Original entry on oeis.org

0, 110, 1110, 0, 10, 1110, 11110, 0, 0, 10, 0, 110, 10, 10, 11110, 0, 110, 11110, 111110, 0, 0, 0, 10, 0, 0, 110, 0, 10, 10, 0, 1110, 10, 0, 10, 10, 110, 110, 10, 111110, 0, 0, 110, 0, 1110, 10, 110, 111110, 0, 1110, 111110, 1111110, 0, 0, 0, 0, 10, 0, 0
Offset: 1

Views

Author

Rick L. Shepherd, Jun 07 2012

Keywords

Comments

This sequence has the same property as A209355, namely, each term in this sequence occurs infinitely often in runs of every finite length >= 1. This sequence, however, contains an infinite number of distinct terms, the same digit strings as occur uniquely and sorted in A105279.

Examples

			The binary representations of 0, 1, 2, 3, 4 are 0, 1, 10, 11, 100, so concatenation gives 011011100, which, when commas are inserted after each zero, produces 0, 110, 1110, 0, terms a(1) through a(4).
		

Crossrefs

Programs

  • Haskell
    a213087 n = a213087_list !! (n-1)
    a213087_list = f a030190_list where
       f xs = foldl1 (\v d -> 10 * v + d) (ys ++ [0]) : f zs where
              (ys, _:zs) = span (/= 0) xs
    -- Reinhard Zumkeller, Jun 30 2012
  • PARI
    /* Calculate terms_wanted terms starting with n: Binary values*/
    /* of n, n + 1, n + 2, ..., are concatenated and each term is */
    /* the string of all bits up to and including the next zero.  */
    /* (Note: Behavior of PARI binary function is such that if    */
    /* n < 0 is used, binary values of |n|, |n+1|, |n+2|, ...,    */
    /* are concatenated here.)                                    */
    /*                                                            */
    {a(n, terms_wanted) =
    local(v = vector(terms_wanted), term = 0, s = "", b, m, p);
    while(termA213087 = a(0, 100000);
    for(n=1, 100000, write("b213087.txt", n, " ", A213087[n]))
    
Showing 1-8 of 8 results.