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.

A098103 Consider the succession of single digits of the primes (A000040): 2 3 5 7 1 1 1 3 1 7 1 9 2 3 2 9 3 1 ... (A033308). This sequence is the lexicographically earliest derangement of A000040 that produces the same succession of digits.

Original entry on oeis.org

23, 5, 7, 11, 13, 17, 19, 2, 3, 293, 137, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 1371391491511, 571, 631, 67173179181191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283
Offset: 1

Views

Author

Eric Angelini, Sep 22 2004

Keywords

Comments

Derangement here means a(n) != A000040(n) for all n.
Original name: "Write each prime number >0 on a single label. Put the labels in numerical order to form an infinite sequence L. Consider the succession of single digits of L: 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 5 9 6 1 6 7 7 1 7 3 7 9... (see A033308). The sequence S gives a rearrangement of the labels that reproduces the same succession of digits, subject to the constraints that a label of L cannot represent itself, and 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 'prime numbers pattern' using only prime numbers, but rearranged. Do not use any prime more than once."
a(180) has over 1000 digits. - Danny Rorabaugh, Nov 29 2015

Examples

			We must begin with "2,3,5,7,11,..." and we cannot have the first term be 2, the first prime, so the smallest available prime is 23.
		

Crossrefs

For other sequences of this type, cf. A098067.

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[m == Prime[Length@ a + 1], ! PrimeQ@ m, MemberQ[a, m]], g[]]; AppendTo[a, m]; m = 0, {k}]; a]; f[Flatten@ Map[IntegerDigits, Prime@ Range@ 120], 53] (* Michael De Vlieger, Nov 29 2015, Version 10.2 *)
  • Sage
    def A098103(n):
      Pr, p, s, A, i = Primes(), 2, "", [], 1
      while len(A)A098103(179) # Danny Rorabaugh, Nov 29 2015

Extensions

Name, Comments, and Example edited by Danny Rorabaugh, Nov 28 2015
Corrected and extended by Danny Rorabaugh, Nov 29 2015