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.

Previous Showing 11-20 of 133 results. Next

A031297 a(n) is the least k such that the base-10 representation of n begins at s(k), where s=A007376.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 1, 16, 18, 20, 22, 24, 26, 28, 30, 15, 34, 2, 38, 40, 42, 44, 46, 48, 50, 17, 37, 56, 3, 60, 62, 64, 66, 68, 70, 19, 39, 59, 78, 4, 82, 84, 86, 88, 90, 21, 41, 61, 81, 100, 5, 104, 106, 108, 110, 23, 43, 63, 83
Offset: 1

Views

Author

Keywords

Comments

A229186 is the same sequence including the a(0) term.

Examples

			a(1) = a(12) = a(123) = 1 since they each start at index 1 in 0123.
a(21) = 15 since it appears first at index 15 in 012345678910111213.
		

Crossrefs

Cf. A007376, A229186 (same sequence but including the a(0) term).
Cf. A165449.
Cf. A030304 (binary variant).

Programs

  • Maple
    with(StringTools): s:="": for n from 1 to 70 do s:=cat(s,convert(n,string)): od: seq(Search(convert(n, string), s), n=1..70); # Nathaniel Johnston, May 26 2011
  • Mathematica
    nmax = 100;
    s = Table[IntegerDigits[n], {n, 0, nmax}] // Flatten;
    a[n_] := SequencePosition[s, IntegerDigits[n], 1][[1, 1]] - 1;
    Array[a, nmax] (* Jean-François Alcover, Feb 21 2021 *)
  • Python
    from itertools import count, islice
    def agen():
        k, chap = 0, "0"
        for n in count(1):
            target = str(n)
            while chap.find(target) == -1: k += 1; chap += str(k)
            yield chap.find(target)
    print(list(islice(agen(), 70))) # Michael S. Branicky, Oct 06 2022

A098067 Consider the succession of single digits of the positive integers: 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 ... (A007376). This sequence is the lexicographically earliest derangement of the positive integers that produces the same succession of digits.

Original entry on oeis.org

12, 3, 4, 5, 6, 7, 8, 9, 10, 1, 112, 13, 14, 15, 16, 17, 18, 19, 20, 2, 122, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73
Offset: 1

Views

Author

Eric Angelini, Sep 13 2004

Keywords

Comments

Derangement here means that a(n) != n.

Examples

			We must begin with "1,2,3,..." and we cannot have a(1) = 1, so the first possible term is "12". The next term must be the smallest available positive integer not leading to a contradiction, thus "3"; the next one will be "4"; etc. After a(10) = 1, we cannot have a(11) = 11, so we use "112" instead. We are not allowed to use "2" after "19" because the next term would have a leading zero, which is forbidden. - _Eric Angelini_, Aug 12 2008
		

Crossrefs

Programs

  • Mathematica
    lim = 80; f[lst_List, k_] := Block[{L = lst, g, a = {}, m = 0}, g[] := {Set[m, First@ FromDigits@ Append[IntegerDigits@ m, First@ #]], Set[L, Last@ #]} &@ TakeDrop[L, 1]; Do[g[]; While[Or[m == Length@ a + 1, First@ L == 0, MemberQ[a, m]], g[]]; AppendTo[a, m]; m = 0, {k}]; a]; f[Flatten@ Map[IntegerDigits, Range@ lim], Floor[lim - 10^(Log10@ lim - 1)]] (* Michael De Vlieger, Nov 29 2015, Version 10.2 *)
  • Perl
    See Link section.
    
  • Python
    from itertools import count
    def diggen():
        for k in count(1): yield from list(map(int, str(k)))
    def aupton(terms):
        g = diggen()
        alst, aset, , , nextd = [12], {12}, next(g), next(g), next(g)
        for n in range(2, terms+1):
            an, nextd = nextd, next(g)
            while an in aset or an == n or nextd == 0:
                an, nextd = int(str(an) + str(nextd)), next(g)
            alst.append(an); aset.add(an)
        return alst
    print(aupton(72)) # Michael S. Branicky, Dec 03 2021

Extensions

Corrected and extended by Jacques ALARDET and Eric Angelini, Aug 12 2008
Derangement wording introduced by Danny Rorabaugh, Nov 26 2015
Edited by Danny Rorabaugh, Nov 29 2015

A256100 In S = A007376 (read as a sequence) the digit S(n) appears a(n) times in the sequence S(1), ..., S(n).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 3, 4, 5, 2, 6, 2, 7, 2, 8, 2, 9, 2, 10, 2, 11, 2, 12, 2, 3, 2, 4, 13, 5, 6, 7, 3, 8, 3, 9, 3, 10, 3, 11, 3, 12, 3, 13, 3, 4, 3, 5, 14, 6, 14, 7, 8, 9, 4, 10, 4, 11, 4, 12, 4, 13, 4, 14, 4, 5, 4, 6, 15, 7, 15, 8, 15, 9, 10, 11, 5, 12, 5, 13, 5, 14, 5, 15, 5, 6
Offset: 1

Views

Author

Wolfdieter Lang, Apr 08 2015

Keywords

Comments

The motivation to consider this sequence came from the proposal A256379 by Anthony Sand.
This sequence can also be read as an irregular triangle (array) in which a(n, k) is the number of appearances of the k-th digit of n in the digits of 1, ... ,n-1 and the first k digits of n. See the example for the head of this array. The row length is A055842(n), n >= 1.
This can also be described as the ordinal transform of A007376. - Franklin T. Adams-Watters, Oct 10 2015

Examples

			a(10) = 2 because A007376(10) = 1 and that sequence up to n=10 is 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, and 1 appears twice.
a(24) = 10 because A007376(24) = 1 and this is the tenth 1 in A007376 up to, and including, A007376(24).
Read as a tabf array a(n, k) with row length A055842(n) this begins:
   n\k  1  2  ...
   1:   1
   2:   1
   3:   1
   4:   1
   5:   1
   6:   1
   7:   1
   8:   1
   9:   1
  10:   2  1
  11:   3  4
  12:   5  2
  13:   6  2
  14:   7  2
  15:   8  2
  16:   9  2
  17:  10  2
  18:  11  2
  19:  12  2
  20:   3  2
  ...
		

Crossrefs

Programs

  • Haskell
    a256100 n = a256100_list !! (n-1)
    a256100_list = f a007376_list $ take 10 $ repeat 1 where
       f (d:ds) counts = y : f ds (xs ++ (y + 1) : ys) where
                               (xs, y:ys) = splitAt d counts
    -- Reinhard Zumkeller, Aug 13 2015
  • Mathematica
    lim = 120; s = Flatten[IntegerDigits /@ Range@ lim]; f[n_] := Block[{d = IntegerDigits /@ Take[s, n] // Flatten // FromDigits}, DigitCount[d][[If[ s[[n]] == 0, 10, s[[n]] ]] ] ]; Array[f, lim] (* Michael De Vlieger, Apr 08 2015, after Robert G. Wilson v at A007376 *)

Formula

a(n) gives the number of digits A007376(n) in the sequence starting with A007376(1) and ending with A007376(n).

A054632 Partial sums of A007376.

Original entry on oeis.org

0, 1, 3, 6, 10, 15, 21, 28, 36, 45, 46, 46, 47, 48, 49, 51, 52, 55, 56, 60, 61, 66, 67, 73, 74, 81, 82, 90, 91, 100, 102, 102, 104, 105, 107, 109, 111, 114, 116, 120, 122, 127, 129, 135, 137, 144, 146, 154, 156, 165, 168, 168, 171, 172, 175, 177
Offset: 0

Views

Author

N. J. A. Sloane, Apr 16 2000

Keywords

Programs

  • Haskell
    a054632 n = a054632_list !! n
    a054632_list = scanl (+) 0 a007376_list
    -- Reinhard Zumkeller, Dec 29 2011
    
  • Python
    from itertools import accumulate, count, islice
    def A054632gen(): return accumulate(int(d) for n in count(0) for d in str(n))
    A054632_list = list(islice(A054632gen(),40)) # Chai Wah Wu, Dec 04 2021

A108202 a(2n) = A007376(n); a(2n+1) = a(n).

Original entry on oeis.org

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

Views

Author

Juliette Bruyndonckx and Alexandre Wajnberg, Jun 15 2005

Keywords

Comments

A sequence, S, consisting of the natural counting digits (A007376) interleaved with S.
Fractal sequence (Kimberling-type) based upon the counting digits.
Similar to but different from A025480 - N. J. A. Sloane, Nov 26 2020.

Crossrefs

First differs from A025480 at a(20).
Even bisection: A007376.
Cf. A003602.

Formula

a(n) = A007376(A025480(n)). - Kevin Ryde, Nov 21 2020

Extensions

More terms from Joshua Zucker, May 18 2006
Name made more explicit by Peter Munn, Nov 20 2020

A098727 Consider the sequence {b(n), n >= 1} of digits of the natural (or counting) numbers: 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... (A007376); a(n) = b(n) + n.

Original entry on oeis.org

2, 4, 6, 8, 10, 12, 14, 16, 18, 11, 11, 13, 14, 15, 17, 17, 20, 19, 23, 21, 26, 23, 29, 25, 32, 27, 35, 29, 38, 32, 31, 34, 34, 36, 37, 38, 40, 40, 43, 42, 46, 44, 49, 46, 52, 48, 55, 50, 58, 53, 51, 55, 54, 57, 57, 59, 60, 61, 63, 63, 66, 65, 69, 67, 72, 69, 75, 71, 78, 74, 71
Offset: 1

Views

Author

Alexandre Wajnberg, Sep 30 2004

Keywords

Comments

Add each digit of the counting numbers to its rank.

Examples

			The sequence of digits of the counting numbers is
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...
The 15th term, for instance, is a 2. Thus 2+15=17 is the 15th term of this sequence.
		

Crossrefs

Programs

  • Mathematica
    Module[{dcn=Flatten[IntegerDigits/@Range[70]]},Total/@Thread[ {dcn,Range[ Length[dcn]]}]] (* Harvey P. Dale, Mar 25 2022 *)

Extensions

More terms from Joshua Zucker, May 18 2006

A127050 A007376(2n+1).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jul 23 2008

Keywords

Comments

This and the other "decimations" of A007376 were suggested by a problem in Honsberger's book.

References

  • R. Honsberger, Mathematical Chestnuts from Around the World, MAA, 2001; see p. 163.

Crossrefs

Programs

  • Python
    from itertools import islice, count
    def A127050gen(): return islice((int(d) for n in count(0) for d in str(n)),1,None,2)
    A127050_list = list(islice(A127050gen(),40)) # Chai Wah Wu, Dec 04 2021

A127353 A007376(2n).

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Jul 23 2008

Keywords

Programs

  • Python
    from itertools import islice, count
    def A127353gen(): return islice((int(d) for n in count(0) for d in str(n)),2,None,2)
    A127533_list = list(islice(A127353gen(),30)) # Chai Wah Wu, Dec 04 2021

A261333 a(n) = 10*(A256100(n+1)-1) + A007376(n+1), a simple variation of A065649.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 0, 21, 31, 41, 12, 51, 13, 61, 14, 71, 15, 81, 16, 91, 17, 101, 18, 111, 19, 22, 10, 32, 121, 42, 52, 62, 23, 72, 24, 82, 25, 92, 26, 102, 27, 112, 28, 122, 29, 33, 20, 43, 131, 53, 132, 63, 73, 83, 34, 93, 35, 103, 36, 113, 37
Offset: 0

Views

Author

Reinhard Zumkeller, Aug 15 2015

Keywords

Comments

Permutation of the nonnegatve integers with inverse A261334.

Crossrefs

Cf. A256100, A007376, A261334 (inverse), A261335 (fixed points), A065649.

Programs

  • Haskell
    a261333 n = a261333_list !! n
    a261333_list = zipWith (+)
                   (map ((* 10) . subtract 1) a256100_list) a007376_list

A055059 Positions in A007376 where the partial sums (A054632) yield primes (A055058).

Original entry on oeis.org

3, 13, 21, 23, 24, 35, 36, 42, 45, 61, 83, 85, 114, 115, 135, 141, 149, 181, 200, 201, 203, 204, 212, 213, 215, 216, 234, 237, 239, 242, 247, 251, 260, 263, 272, 285, 292, 297, 309, 311, 332, 335, 347, 350, 357, 359, 371, 392, 396, 405, 410, 417, 419, 431
Offset: 1

Views

Author

Patrick De Geest, Apr 15 2000

Keywords

Examples

			0123456789101112131415161718192021...
--|.................. sum 0+1+2 = prime 3 at position 3
------------|........ sum 0+1+2+3+4+5+6+7+8+9+1+0+1 = prime 47 at position 13
--------------------| sum 0+1+2+3+4+5+6+7+8+9+1+0+1+1+1+2+1+3+1+4+1 = prime 61 at position 21
		

Crossrefs

Extensions

Definition amended and offset changed by Georg Fischer, Sep 03 2022
Previous Showing 11-20 of 133 results. Next