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-3 of 3 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

A097487 Write the nonprime positive integers on labels in numerical order, forming an infinite sequence L. Now consider the succession of single digits of A000040 (prime numbers): 2 3 5 7 1 1 1 3 1 7 1 9 2 3 2 9 3 1 3 7 4 1 4 3 4 7 5 3 ... (A033308). This sequence gives an arrangement 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

235, 711, 1, 3171, 9, 232, 93, 1374, 14, 34, 75, 35, 96, 16, 77, 1737, 98, 38, 99, 710, 110, 310, 71091, 1312, 713, 1137, 1391, 4, 91, 51, 15, 716, 316, 717, 3179, 18, 119, 11931, 97199, 21, 12, 2322, 72, 292, 33, 2392, 412, 512, 57, 26, 32, 6, 92, 712, 772, 8
Offset: 1

Views

Author

Eric Angelini, Sep 19 2004; corrected Sep 23 2004

Keywords

Comments

This could be roughly rephrased like this: "Rewrite in the most economical way the prime numbers 'pattern' using only nonprime numbers. Do not use any nonprime twice."

Examples

			We must begin with 2,3,5,7,11,13,... and we cannot represent "2" with the label "2" or "23", so the next possibility is the label "235" (first available nonprime number in L).
		

Crossrefs

Programs

  • Mathematica
    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[PrimeQ@ m, MemberQ[a, m]], g[]]; AppendTo[a, m]; m = 0, {k}]; a]; f[Flatten@ Map[IntegerDigits, Prime@ Range@ 200], 56] (* Michael De Vlieger, Nov 29 2015, Version 10.2 *)

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
Showing 1-3 of 3 results.