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

A054636 Partial sums of A054634.

Original entry on oeis.org

0, 1, 3, 6, 10, 15, 21, 28, 29, 29, 30, 31, 32, 34, 35, 38, 39, 43, 44, 49, 50, 56, 57, 64, 66, 66, 68, 69, 71, 73, 75, 78, 80, 84, 86, 91, 93, 99, 101, 108, 111, 111, 114, 115, 118, 120, 123, 126, 129, 133, 136, 141, 144, 150, 153, 160, 164, 164
Offset: 0

Views

Author

N. J. A. Sloane, Apr 16 2000

Keywords

Crossrefs

Programs

  • Mathematica
    Accumulate@ Flatten[IntegerDigits[Range[0, 32], 8]] (* Michael De Vlieger, Mar 09 2022 *)

A033307 Decimal expansion of Champernowne constant (or Mahler's number), formed by concatenating the positive integers.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

This number is known to be normal in base 10.
Named after David Gawen Champernowne (July 9, 1912 - August 19, 2000). - Robert G. Wilson v, Jun 29 2014

Examples

			0.12345678910111213141516171819202122232425262728293031323334353637383940414243...
		

References

  • Steven R. Finch, Mathematical Constants, Encyclopedia of Mathematics and its Applications, vol. 94, Cambridge University Press, 2003, Section 6.9, p. 442.
  • G. Harman, One hundred years of normal numbers, in M. A. Bennett et al., eds., Number Theory for the Millennium, II (Urbana, IL, 2000), 149-166, A K Peters, Natick, MA, 2002.
  • C. A. Pickover, The Math Book, Sterling, NY, 2009; see p. 364.
  • H. M. Stark, An Introduction to Number Theory. Markham, Chicago, 1970, p. 172.

Crossrefs

See A030167 for the continued fraction expansion of this number.
A007376 is the same sequence but with a different interpretation.
Cf. A007908, A000027, A001191 (concatenate squares).
Tables in which the n-th row lists the base b digits of n: A030190 and A030302 (b = 2), A003137 and A054635 (b = 3), A030373 (b = 4), A031219 (b = 5), A030548 (b = 6), A030998 (b = 7), A031035 and A054634 (b = 8), A031076 (b = 9), A007376 and this sequence (b = 10). - Jason Kimberley, Dec 06 2012
Cf. A065648.
Cf. A365237 (reciprocal).

Programs

  • Haskell
    a033307 n = a033307_list !! n
    a033307_list = concatMap (map (read . return) . show) [1..] :: [Int]
    -- Reinhard Zumkeller, Aug 27 2013, Mar 28 2011
    
  • Magma
    &cat[Reverse(IntegerToSequence(n)):n in[1..50]]; // Jason Kimberley, Dec 07 2012
    
  • Mathematica
    Flatten[IntegerDigits/@Range[0, 57]] (* Or *)
    almostNatural[n_, b_] := Block[{m = 0, d = n, i = 1, l, p}, While[m <= d, l = m; m = (b - 1) i*b^(i - 1) + l; i++]; i--; p = Mod[d - l, i]; q = Floor[(d - l)/i] + b^(i - 1); If[p != 0, IntegerDigits[q, b][[p]], Mod[q - 1, b]]]; Array[ almostNatural[#, 10] &, 105] (* Robert G. Wilson v, Jul 23 2012 and modified Jul 04 2014 *)
    intermediate[n_] := Ceiling[FullSimplify[ProductLog[Log[10]/10^(1/9) (n - 1/9)] / Log[10] + 1/9]]; champerDigit[n_] := Mod[Floor[10^(Mod[n + (10^intermediate[n] - 10)/9, intermediate[n]] - intermediate[n] + 1) Ceiling[(9n + 10^intermediate[n] - 1)/(9intermediate[n]) - 1]], 10]; (* David W. Cantrell, Feb 18 2007 *)
    First[RealDigits[ChampernowneNumber[], 10, 100]] (* Paolo Xausa, May 02 2024 *)
  • PARI
    { default(realprecision, 20080); x=0; y=1; d=10.0; e=1.0; n=0; while (y!=x, y=x; n++; if (n==d, d=d*10); e=e*d; x=x+n/e; ); d=0; for (n=0, 20000, x=(x-d)*10; d=floor(x); write("b033307.txt", n, " ", d)); } \\ Harry J. Smith, Apr 20 2009
    
  • Python
    from itertools import count
    def agen():
        for k in count(1): yield from list(map(int, str(k)))
    a = agen()
    print([next(a) for i in range(104)]) # Michael S. Branicky, Sep 13 2021
  • Scala
    val numerStr = (1 to 100).map(Integer.toString()).toList.reduce( + _)
    numerStr.split("").map(Integer.parseInt()).toList // _Alonso del Arte, Nov 04 2019
    

Formula

Let "index" i = ceiling( W(log(10)/10^(1/9) (n - 1/9))/log(10) + 1/9 ) where W denotes the principal branch of the Lambert W function. Then a(n) = (10^((n + (10^i - 10)/9) mod i - i + 1) * ceiling((9n + 10^i - 1)/(9i) - 1)) mod 10. See also Mathematica code. - David W. Cantrell, Feb 18 2007

A007376 The almost-natural numbers: write n in base 10 and juxtapose digits.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

Also called the Barbier infinite word.
This is an example of a non-morphic sequence.
a(n) = A162711(n,1); A136414(n) = 10*a(n) + a(n+1). - Reinhard Zumkeller, Jul 11 2009
a(A031287(n)) = 0, a(A031288(n)) = 1, a(A031289(n)) = 2, a(A031290(n)) = 3, a(A031291(n)) = 4, a(A031292(n)) = 5, a(A031293(n)) = 6, a(A031294(n)) = 7, a(A031295(n)) = 8, a(A031296(n)) = 9. - Reinhard Zumkeller, Jul 28 2011
May be regarded as an irregular table in which the n-th row lists the digits of n. - Jason Kimberley, Dec 07 2012
The digits of the integer n start at index A117804(n). The digit a(n) at index n belongs to the number A100470(n). - M. F. Hasler, Oct 23 2019
See also the Copeland-Erdős constant A033308, equivalent using primes instead of all numbers. - M. F. Hasler, Oct 24 2019
Decimal expansion of Sum_{k>=1} k/10^(A058183(k) + 1). - Stefano Spezia, Nov 30 2022

References

  • J.-P. Allouche and J. Shallit, Automatic Sequences, Cambridge Univ. Press, 2003, pp. 114, 336.
  • R. Honsberger, Mathematical Chestnuts from Around the World, MAA, 2001; see p. 163.
  • M. Kraitchik, Mathematical Recreations. Dover, NY, 2nd ed., 1953, p. 49.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • David Wells, The Penguin Dictionary of Curious and Interesting Numbers. Penguin Books, NY, 1986, Revised edition 1987, p. 26.

Crossrefs

Considered as a sequence of digits, this is the same as the decimal expansion of the Champernowne constant, A033307. See that entry for a formula for a(n), further references, etc.
Cf. A054632 (partial sums), A023103.
Cf. A193428, A256100, A001477 (the nonnegative integers), A117804, A100470.
Tables in which the n-th row lists the base b digits of n: A030190 and A030302 (b=2), A003137 and A054635 (b=3), A030373 (b=4), A031219 (b=5), A030548 (b=6), A030998 (b=7), A031035 and A054634 (b=8), A031076 (b=9), this sequence and A033307 (b=10). - Jason Kimberley, Dec 06 2012
Row lengths in A055642.
For primes here see A071620. See A007908 for a very similar sequence.

Programs

  • Haskell
    a007376 n = a007376_list !! (n-1)
    a007376_list = concatMap (map (read . return) . show) [0..] :: [Int]
    -- Reinhard Zumkeller, Nov 11 2013, Dec 17 2011, Mar 28 2011
    
  • Magma
    &cat[Reverse(IntegerToSequence(n)):n in[0..31]]; // Jason Kimberley, Dec 07 2012
    
  • Maple
    c:=proc(x,y) local s: s:=proc(m) nops(convert(m,base,10)) end: if y=0 then 10*x else x*10^s(y)+y: fi end: b:=proc(n) local nn: nn:=convert(n,base,10):[seq(nn[nops(nn)+1-i],i=1..nops(nn))] end: A:=0: for n from 1 to 75 do A:=c(A,n) od: b(A); # c concatenates 2 numbers while b converts a number to the sequence of its digits - Emeric Deutsch, Jul 27 2006
    #alternative
    A007376 := proc(n) option remember ; local aprev, dOld,N ; if n <=9 then RETURN([n,n,1]) ; else aprev := A007376(n-1) ; dOld := op(3,aprev) ; N := op(2,aprev) ; if dOld < A055642(N) then RETURN([op(-dOld-1,convert(N,base,10)),N,dOld+1]) ; else RETURN([op(-1,convert(N+1,base,10)),N+1,1]) ; fi ; fi ; end: # R. J. Mathar, Jan 21 2008
  • Mathematica
    Flatten[ IntegerDigits /@ Range@ 57] (* Or *)
    almostNatural[n_, b_] := Block[{m = 0, d = n, i = 1, l, p}, While[m <= d, l = m; m = (b - 1) i*b^(i - 1) + l; i++]; i--; p = Mod[d - l, i]; q = Floor[(d - l)/i] + b^(i - 1); If[p != 0, IntegerDigits[q, b][[p]], Mod[q - 1, b]]]; Array[ almostNatural[#, 10] &, 105] (* updated Jun 29 2014 *)
    With[{nn=120},RealDigits[N[ChampernowneNumber[],nn],10,nn]][[1]] (* Harvey P. Dale, Mar 13 2018 *)
  • PARI
    for(n=0,90,v=digits(n);for(i=1,#v,print1(v[i]", "))) \\ Charles R Greathouse IV, Nov 20 2012
    
  • PARI
    apply( A007376(n)={for(k=1,n, k*10^k>n&& return(digits(n\k)[n%k+1]); n+=10^k)}, [0..200]) \\ M. F. Hasler, Nov 03 2019
    
  • Python
    A007376_list = [int(d) for n in range(10**2) for d in str(n)] # Chai Wah Wu, Feb 04 2015

Extensions

Extended to a(0) = 0 by M. F. Hasler, Oct 23 2019

A030190 Binary Champernowne sequence (or word): write the numbers 0,1,2,3,4,... in base 2 and juxtapose.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

a(A003607(n)) = 0 and for n > 0: a(A030303(n)) = 1. - Reinhard Zumkeller, Dec 11 2011
An irregular table in which the n-th row lists the bits of n (see the example section). - Jason Kimberley, Dec 07 2012
The binary Champernowne constant: it is normal in base 2. - Jason Kimberley, Dec 07 2012
This is the characteristic function of A030303, which gives the indices of 1's in this sequence and has first differences given by A066099. - M. F. Hasler, Oct 12 2020

Examples

			As an array, this begins:
0,
1,
1, 0,
1, 1,
1, 0, 0,
1, 0, 1,
1, 1, 0,
1, 1, 1,
1, 0, 0, 0,
1, 0, 0, 1,
1, 0, 1, 0,
1, 0, 1, 1,
1, 1, 0, 0,
1, 1, 0, 1,
1, 1, 1, 0,
1, 1, 1, 1,
1, 0, 0, 0, 0,
1, 0, 0, 0, 1,
...
		

References

  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.

Crossrefs

Cf. A007376, A003137, A030308. Same as and more fundamental than A030302, but I have left A030302 in the OEIS because there are several sequences that are based on it (A030303 etc.). - N. J. A. Sloane.
a(n) = T(A030530(n), A083652(A030530(n))-n-1), T as defined in A083651, a(A083652(k))=1.
Tables in which the n-th row lists the base b digits of n: this sequence and A030302 (b=2), A003137 and A054635 (b=3), A030373 (b=4), A031219 (b=5), A030548 (b=6), A030998 (b=7), A031035 and A054634 (b=8), A031076 (b=9), A007376 and A033307 (b=10). - Jason Kimberley, Dec 06 2012
A076478 is a similar sequence.
For run lengths see A056062; see also A318924.
See also A066099 for (run lengths of 0s) + 1 = first difference of positions of 1s given by A030303.

Programs

  • Haskell
    import Data.List (unfoldr)
    a030190 n = a030190_list !! n
    a030190_list = concatMap reverse a030308_tabf
    -- Reinhard Zumkeller, Jun 16 2012, Dec 11 2011
    
  • Magma
    [0]cat &cat[Reverse(IntegerToSequence(n,2)):n in[1..31]]; // Jason Kimberley, Dec 07 2012
    
  • Mathematica
    Flatten[ Table[ IntegerDigits[n, 2], {n, 0, 26}]] (* Robert G. Wilson v, Mar 08 2005 *)
    First[RealDigits[ChampernowneNumber[2], 2, 100, 0]] (* Paolo Xausa, Jun 16 2024 *)
  • PARI
    A030190_row(n)=if(n,binary(n),[0]) \\ M. F. Hasler, Oct 12 2020
    
  • Python
    from itertools import count, islice
    def A030190_gen(): return (int(d) for m in count(0) for d in bin(m)[2:])
    A030190_list = list(islice(A030190_gen(),30)) # Chai Wah Wu, Jan 07 2022

A030302 Write n in base 2 and juxtapose; irregular table in which row n lists the binary expansion of n.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The binary Champernowne constant: it is normal in base 2. - Jason Kimberley, Dec 07 2012
A word that is recurrent, but neither morphic nor uniformly recurrent. - N. J. A. Sloane, Jul 14 2018
See A030303 for the indices of 1's (so this is the characteristic function of A030303), with first differences (i.e., run lengths of 0's, increased by 1, with two consecutive 1's delimiting a run of zero 0's) given by A066099. - M. F. Hasler, Oct 12 2020

References

  • Michel Rigo, Formal Languages, Automata and Numeration Systems, 2 vols., Wiley, 2014. Mentions this sequence - see "List of Sequences" in Vol. 2.

Crossrefs

Essentially the same as A007088 and A030190. Cf. A030303, A007088.
Tables in which the n-th row lists the base b digits of n: A030190 and this sequence (b=2), A003137 and A054635 (b=3), A030373 (b=4), A031219 (b=5), A030548 (b=6), A030998 (b=7), A031035 and A054634 (b=8), A031076 (b=9), A007376 and A033307 (b=10). [Jason Kimberley, Dec 06 2012]
Sequences mentioned in the Allouche et al. "Taxonomy" paper, listed by example number: 1: A003849, 2: A010060, 3: A010056, 4: A020985 and A020987, 5: A191818, 6: A316340 and A273129, 18: A316341, 19: A030302, 20: A063438, 21: A316342, 22: A316343, 23: A003849 minus its first term, 24: A316344, 25: A316345 and A316824, 26: A020985 and A020987, 27: A316825, 28: A159689, 29: A049320, 30: A003849, 31: A316826, 32: A316827, 33: A316828, 34: A316344, 35: A043529, 36: A316829, 37: A010060.

Programs

  • Magma
    &cat[Reverse(IntegerToSequence(n,2)): n in [1..31]]; // Jason Kimberley, Mar 02 2012
    
  • Maple
    A030302 := proc(n) local i,t1,t2; t1:=convert(n,base,2); t2:=nops(t1); [seq(t1[t2+1-i],i=1..t2)]; end; # N. J. A. Sloane, Apr 08 2021
  • Mathematica
    i[n_] := Ceiling[FullSimplify[ProductLog[Log[2]/2 (n - 1)]/Log[2] + 1]]; a[n_] := Mod[Floor[2^(Mod[n + 2^i[n] - 2, i[n]] - i[n] + 1) Ceiling[(n + 2^i[n] - 1)/i[n] - 1]], 2]; (* David W. Cantrell (DWCantrell(AT)sigmaxi.net), Feb 19 2007 *)
    Join @@ Table[ IntegerDigits[i, 2], {i, 1, 40}] (* Olivier Gérard, Mar 28 2011 *)
    Flatten@ IntegerDigits[ Range@ 25, 2] (* or *)
    almostNatural[n_, b_] := Block[{m = 0, d = n, i = 1, l, p}, While[m <= d, l = m; m = (b - 1) i*b^(i - 1) + l; i++]; i--; p = Mod[d - l, i]; q = Floor[(d - l)/i] + b^(i - 1); If[p != 0, IntegerDigits[q, b][[p]], Mod[q - 1, b]]]; Array[ almostNatural[#, 2] &, 105] (* Robert G. Wilson v, Jun 29 2014 *)
  • Python
    from itertools import count, islice
    def A030302_gen(): # generator of terms
        return (int(d) for n in count(1) for d in bin(n)[2:])
    A030302_list = list(islice(A030302_gen(),30)) # Chai Wah Wu, Feb 18 2022

Formula

a(n) = (floor(2^(((n + 2^i - 2) mod i) - i + 1) * ceiling((n + 2^i - 1)/i - 1))) mod 2 where i = ceiling( W(log(2)/2 (n - 1))/log(2) + 1 ) and W denotes the principal branch of the Lambert W function. See also Mathematica code. - David W. Cantrell (DWCantrell(AT)sigmaxi.net), Feb 19 2007

A030548 Write n in base 6 and juxtapose.

Original entry on oeis.org

1, 2, 3, 4, 5, 1, 0, 1, 1, 1, 2, 1, 3, 1, 4, 1, 5, 2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 2, 5, 3, 0, 3, 1, 3, 2, 3, 3, 3, 4, 3, 5, 4, 0, 4, 1, 4, 2, 4, 3, 4, 4, 4, 5, 5, 0, 5, 1, 5, 2, 5, 3, 5, 4, 5, 5, 1, 0, 0, 1, 0, 1, 1, 0, 2, 1, 0, 3, 1, 0, 4, 1, 0, 5, 1, 1, 0, 1, 1, 1, 1
Offset: 1

Views

Author

Keywords

Comments

Base-6 analog of what in base 7 is A030998, in base 10 is A007376. In general, the Barbier infinite word base n (in this case, 6). - Jonathan Vos Post, May 13 2007
An irregular table in which the n-th row lists the base-6 digits of n. - Jason Kimberley, Dec 07 2012
The base-6 Champernowne constant: It is normal in base 6. - Jason Kimberley, Dec 07 2012

Crossrefs

Tables in which the n-th row lists the base b digits of n: A030190 and A030302 (b=2), A003137 and A054635 (b=3), A030373 (b=4), A031219 (b=5), this sequence (b=6), A030998 (b=7), A031035 and A054634 (b=8), A031076 (b=9), A007376 and A033307 (b=10). - Jason Kimberley, Dec 06 2012
Cf. A030567 for the same table with reversed rows.

Programs

  • Magma
    &cat[Reverse(IntegerToSequence(n,6)):n in[1..31]]; // Jason Kimberley, Dec 07 2012
    
  • Mathematica
    Flatten@ IntegerDigits[ Range@ 50, 6] (* or *)
    almostNatural[n_, b_] := Block[{m = 0, d = n, i = 1, l, p}, While[m <= d, l = m; m = (b - 1) i*b^(i - 1) + l; i++]; i--; p = Mod[d - l, i]; q = Floor[(d - l)/i] + b^(i - 1); If[p != 0, IntegerDigits[q, b][[p]], Mod[q - 1, b]]]; Array[ a[#, 6] &, 105] (* Robert G. Wilson v, Jul 01 2014 *)
  • Python
    from itertools import count, chain, islice
    from sympy.ntheory.factor_ import digits
    def A030548_gen(): return chain.from_iterable(digits(m, 6)[1:] for m in count(1))
    A030548_list = list(islice(A030548_gen(), 30)) # Chai Wah Wu, Jan 07 2022

Extensions

Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, Aug 23 2007

A031219 Write n in base 5 and juxtapose.

Original entry on oeis.org

1, 2, 3, 4, 1, 0, 1, 1, 1, 2, 1, 3, 1, 4, 2, 0, 2, 1, 2, 2, 2, 3, 2, 4, 3, 0, 3, 1, 3, 2, 3, 3, 3, 4, 4, 0, 4, 1, 4, 2, 4, 3, 4, 4, 1, 0, 0, 1, 0, 1, 1, 0, 2, 1, 0, 3, 1, 0, 4, 1, 1, 0, 1, 1, 1, 1, 1, 2, 1, 1, 3, 1, 1, 4, 1, 2, 0, 1, 2, 1, 1, 2, 2, 1, 2, 3, 1, 2, 4, 1
Offset: 1

Views

Author

Keywords

Comments

An irregular table in which the n-th row lists the base-5 digits of n. - Jason Kimberley, Dec 07 2012
The base-5 Champernowne constant: it is normal in base 5. - Jason Kimberley, Dec 07 2012

Crossrefs

Tables in which the n-th row lists the base b digits of n: A030190 and A030302 (b=2), A003137 and A054635 (b=3), A030373 (b=4), this sequence (b=5), A030548 (b=6), A030998 (b=7), A031035 and A054634 (b=8), A031076 (b=9), A007376 and A033307 (b=10). - Jason Kimberley, Dec 06 2012

Programs

  • Magma
    &cat[Reverse(IntegerToSequence(n,5)):n in[1..31]]; // Jason Kimberley, Dec 07 2012
    
  • Mathematica
    Flatten@ IntegerDigits[ Range@ 40, 5] (* or *)
    almostNatural[n_, b_] := Block[{m = 0, d = n, i = 1, l, p}, While[m <= d, l = m; m = (b - 1) i*b^(i - 1) + l; i++]; i--; p = Mod[d - l, i]; q = Floor[(d - l)/i] + b^(i - 1); If[p != 0, IntegerDigits[q, b][[p]], Mod[q - 1, b]]]; Array[ a[#, 5] &, 105] (* Robert G. Wilson v, Jul 01 2014 *)
  • Python
    from itertools import count, chain, islice
    from sympy.ntheory.factor_ import digits
    def A031219_gen(): return chain.from_iterable(digits(m, 5)[1:] for m in count(1))
    A031219_list = list(islice(A031219_gen(), 30)) # Chai Wah Wu, Jan 07 2022

A003137 Write n in base 3 and juxtapose.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

An irregular table in which the n-th row lists the base-3 digits of n, see A007089. - Jason Kimberley, Dec 07 2012
The base-3 Champernowne constant (A077771): it is normal in base 3. - Jason Kimberley, Dec 07 2012

Examples

			1,
2,
1,0,
1,1,
1,2,
2,0,
2,1,
2,2,
1,0,0,
1,0,1,.... _R. J. Mathar_, Aug 16 2021
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Tables in which the n-th row lists the base b digits of n: A030190 and A030302 (b=2), this sequence and A054635 (b=3), A030373 (b=4), A031219 (b=5), A030548 (b=6), A030998 (b=7), A031035 and A054634 (b=8), A031076 (b=9), A007376 and A033307 (b=10). - Jason Kimberley, Dec 06 2012
Cf. A081604 (row lengths), A053735 (row sums), A030341 (rows reversed), A077771, A007089.

Programs

  • Haskell
    a003137 n k = a003137_tabf !! (n-1) !! k
    a003137_row n = a003137_tabf !! (n-1)
    a003137_tabf = map reverse $ tail a030341_tabf
    a003137_list = concat a003137_tabf
    -- Reinhard Zumkeller, Feb 21 2013
    
  • Magma
    &cat[Reverse(IntegerToSequence(n,3)):n in[1..31]]; // Jason Kimberley, Dec 07 2012
    
  • Mathematica
    Flatten@ IntegerDigits[ Range@ 40, 3] (* or *)
    almostNatural[n_, b_] := Block[{m = 0, d = n, i = 1, l, p}, While[m <= d, l = m; m = (b - 1) i*b^(i - 1) + l; i++]; i--; p = Mod[d - l, i]; q = Floor[(d - l)/i] + b^(i - 1); If[p != 0, IntegerDigits[q, b][[p]], Mod[q - 1, b]]]; Array[ a[#, 3] &, 105] (* Robert G. Wilson v, Jul 01 2014 *)
  • Python
    from itertools import count, islice
    from sympy.ntheory.factor_ import digits
    def A003137_gen(): return (d for m in count(1) for d in digits(m,3)[1:])
    A003137_list = list(islice(A003137_gen(),30)) # Chai Wah Wu, Jan 07 2022

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Sep 25 2000

A030373 Write n in base 4 and juxtapose.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

An irregular table in which the n-th row lists the base-4 digits of n. - Jason Kimberley, Nov 26 2012
The base-4 Champernowne constant: it is normal in base 4. - Jason Kimberley, Nov 26 2012

Examples

			1;
2;
3;
1,0;
1,1;
1,2;
1,3;
2,0;
2,1;
2,2;
...
3,3;
1,0,0;
1,0,1;
1,0,2;
1,0,3;
1,1,0; ....
		

Crossrefs

Tables in which the n-th row lists the base b digits of n: A030190 and A030302 (b=2), A003137 and A054635 (b=3), this sequence (b=4), A031219 (b=5), A030548 (b=6), A030998 (b=7), A031035 and A054634 (b=8), A031076 (b=9), A007376 and A033307 (b=10). - Jason Kimberley, Dec 06 2012

Programs

  • Magma
    &cat[Reverse(IntegerToSequence(n,4)):n in[1..31]]; // Jason Kimberley, Dec 07 2012
    
  • Mathematica
    Flatten[IntegerDigits[Range[40],4]] (* Harvey P. Dale, Aug 23 2011 *)
  • Python
    from itertools import count, chain, islice
    from sympy.ntheory.factor_ import digits
    def A030373_gen(): return chain.from_iterable(digits(m, 4)[1:] for m in count(1))
    A030373_list = list(islice(A030373_gen(), 30)) # Chai Wah Wu, Jan 07 2022

A031076 Write n in base 9 and juxtapose.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

An irregular table in which the n-th row lists the base-9 digits of n. - Jason Kimberley, Dec 07 2012
The base-9 Champernowne constant: it is normal in base 9. - Jason Kimberley, Dec 07 2012

Crossrefs

Tables in which the n-th row lists the base b digits of n: A030190 and A030302 (b=2), A003137 and A054635 (b=3), A030373 (b=4), A031219 (b=5), A030548 (b=6), A030998 (b=7), A031035 and A054634 (b=8), this sequence (b=9), A007376 and A033307 (b=10). - Jason Kimberley, Dec 06 2012

Programs

  • Haskell
    a031076 n = a031076_list !! (n-1)
    a031076_list = concat $ map reverse $ tail a031087_tabf
    -- Reinhard Zumkeller, Jul 07 2015
    
  • Magma
    &cat[Reverse(IntegerToSequence(n,9)):n in[1..31]]; // Jason Kimberley, Dec 07 2012
    
  • Mathematica
    Flatten@ IntegerDigits[ Range@ 55, 9] (* or *)
    almostNatural[n_, b_] := Block[{m = 0, d = n, i = 1, l, p}, While[m <= d, l = m; m = (b - 1) i*b^(i - 1) + l; i++]; i--; p = Mod[d - l, i]; q = Floor[(d - l)/i] + b^(i - 1); If[p != 0, IntegerDigits[q, b][[p]], Mod[q - 1, b]]]; Array[ almostNatural[#, 9] &, 105] (* Robert G. Wilson v, Jul 01 2014 *)
  • Python
    from itertools import count, chain, islice
    from sympy.ntheory.factor_ import digits
    def A031076_gen(): return chain.from_iterable(digits(m,9)[1:] for m in count(1))
    A031076_list = list(islice(A031076_gen(),30)) # Chai Wah Wu, Jan 07 2022
Showing 1-10 of 23 results. Next