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

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

A098099 Consider the succession of single digits of the positive odd integers: 1 3 5 7 9 1 1 1 3 1 5 1 7 1 9 2 1 2 3 2 5 ... (A031312). This sequence is the lexicographically earliest sequence of distinct positive even integers that produces the same succession of digits.

Original entry on oeis.org

1357911131517192, 12, 32, 52, 72, 931333537394, 14, 34, 54, 74, 951535557596, 16, 36, 56, 76, 971737577798, 18, 38, 58, 78, 9919395979910, 110, 310, 510, 710, 911111311511711912, 112, 312, 512, 712, 913113313513713914, 114, 314, 514, 714
Offset: 1

Views

Author

Eric Angelini, Sep 22 2004

Keywords

Comments

Original name: "Write each even integer >0 on a single label. Put the labels in numerical order to form an infinite sequence L. Now consider the succession of single digits of A005408 (odd numbers): 1 3 5 7 9 1 1 1 3 1 5 1 7 1 9 2 1 2 3 2 5 2 7 2 9 3 1 3 3 3 5 3 7 3 9... The sequence S gives a rearrangement of the labels that reproduces the same succession of digits, subject to the constraint that the smallest label must be used that does not lead to a contradiction."
This could be roughly rephrased like this: Rewrite in the most economical way the "odd numbers pattern" using only even numbers, but rearranged. All the numbers of the sequence must be different one from another.

Examples

			We must begin with "1,3,5..." and we cannot use "1" or "13" or "135" (only even terms are available), so the first possibility is "1357911131517192". For "199,201,203..." we won't be allowed to use "1992", for instance, since no term begins with a 0.
		

References

  • E. Angelini, "Jeux de suites", in Dossier Pour La Science, pp. 32-35, Volume 59 (Jeux math'), April/June 2008, Paris.

Crossrefs

Programs

  • Mathematica
    f[lst_List, k_] := Block[{L = lst, g, w, a = {}, m}, g[x_] := First@ FirstPosition[x, i_ /; EvenQ@ i]; Do[w = Take[L, g@ L]; L = Drop[L, Length@ w]; m = Take[L, g@ L]; While[Or[MemberQ[a, FromDigits@ w], IntegerLength@ FromDigits@ m < Length@ m], w = Join[w, m]; L = Drop[L, Length@ m]; m = Take[L, g@ L]]; AppendTo[a, FromDigits@ w], {k}]; a]; f[Flatten@ Map[IntegerDigits, Range[1, 1000, 2]], 35] (* Michael De Vlieger, Nov 28 2015, Version 10 *)

Extensions

Name and Example edited by Danny Rorabaugh, Nov 28 2015

A068663 Let N = 23571113171923293137... the concatenation of primes; partition this number into minimal strings of composite numbers.

Original entry on oeis.org

235, 711, 1317, 192, 32, 9, 31374, 14, 34, 75, 35, 9, 6, 16, 77, 1737, 9, 8, 38, 9, 9, 710, 110, 310, 710, 9, 1131, 27, 1311, 371, 39, 14, 9, 15, 115, 716, 316, 717, 3179, 18, 119, 119, 319, 7199, 21, 12, 232, 27, 22, 9, 2332, 39, 24, 12, 51, 25, 72, 6, 32, 6, 9, 27, 12
Offset: 1

Views

Author

Amarnath Murthy, Mar 01 2002

Keywords

Comments

This could be roughly rephrased like this: "Rewrite in the most economical way the prime number 'pattern' using only composite numbers." - Michael De Vlieger, Nov 30 2015, after Danny Rorabaugh at A097487.

Examples

			From _Michael De Vlieger_, Nov 30 2015: (Start)
We begin with N = 235711131719..., taking first digits until we have a composite concatenation. Since 2 and 23 are prime, 235 is the first term. We continue with 711131719... and since 7 and 71 are prime, 711 is the next term.
Composite terms are formed such that the following term has no leading zeros, so as to preserve all the digits of N.
The terms {710, 110, 310, 710} derive from the primes {97, 101, 103, 107, 109} and happen to be formed because eliding the zero would result in a prime in these cases.
a(70) = 330 because although 33 would suffice as it is composite, the zero leading next digits 07311313... would result in a(71) losing a digit of N. (End)
		

Crossrefs

Programs

  • Mathematica
    lim = 123; 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[! CompositeQ@ m, First@ L == 0], g[]]; AppendTo[a, m]; m = 0, {k}]; a]; f[Flatten@ Map[IntegerDigits, Prime@ Range@ lim], Floor[lim/2]] (* Michael De Vlieger, Nov 30 2015, Version 10.2 *)

Extensions

Corrected and extended by Eli McGowan (ejmcgowa(AT)mail.lakeheadu.ca), May 06 2002

A097484 Write the odd positive integers on labels in numerical order, forming an infinite sequence L. Consider the succession of single digits of L: 1 3 5 7 9 1 1 1 3 1 5 1 7 1 9 2 1 2 3 2 5 2 7 2 9 3 1 ... (A031312). This sequence is a derangement of L that produces the same succession of digits, subject to the constraint that the smallest unused label must be used that does not lead to a contradiction.

Original entry on oeis.org

13, 5, 7, 9, 1, 113, 15, 17, 19, 21, 23, 25, 27, 29, 3, 133, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 11, 1113, 115, 117, 119, 121, 123, 125, 127, 129, 131
Offset: 1

Views

Author

Eric Angelini, Sep 19 2004

Keywords

Comments

Derangement here means the n-th element of L is not the n-th element of this sequence, so a(n) != 2n - 1.

Examples

			We must begin with 1,3,5,7... and we cannot have a(1) = 1, so the next possibility is the label "13". The next term must be the smallest available label not leading to a contradiction, thus "5". The next one will be "7", etc. After the label "9" the smallest available label is "1". After this "1" we cannot have a(6) = 11 -- we thus take the smallest available label which is "113". No label is allowed to start with a leading zero.
		

Crossrefs

Same type of sequence -- but for even numbers -- is A097481. - Eric Angelini, Aug 12 2008

Extensions

Corrected and extended by Jacques ALARDET and Eric Angelini, Aug 12 2008
Derangement wording introduced by Danny Rorabaugh, Nov 26 2015
Showing 1-4 of 4 results.