login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A097500
Consider the succession of single digits of A008585 (multiples of 3): 3 6 9 1 2 1 5 1 8 2 1 2 4 2 7 3 0 .... This sequence gives the lexicographically earliest derangement of A001651 (non-multiples of 3) that produces the same succession of digits.
2
3691, 2, 1, 5, 182, 124, 27303336394, 245, 4, 8, 515, 457, 606366697, 275, 7, 88, 184, 879093969910, 2105, 10, 811, 11, 14, 1171, 20, 1231, 26, 1291, 32, 13, 5138, 1411, 44, 1471, 50, 1531, 56, 1591, 62, 16, 5168, 17, 1174, 1771, 80, 1831, 86, 1891, 92, 19, 5198, 20120, 4207, 2102, 1321, 62192, 22
OFFSET
1,1
COMMENTS
Derangement here means a(n) != A008585(n) for all n.
Original name: "Write each non-multiple of 3 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 A008585 (multiples of 3): 3,6,9,1,2,1,5,1,8,2,1,2,4,2,7,3,0,3,3,3,6,3,9,4,2,4,5,4,8,5,1,5,4,5,7,6,0... 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 'multiples-of-3 pattern' using only non-multiples of 3. Do not use any non-multiple of 3 twice."
LINKS
EXAMPLE
We must begin with "3,6,9,12,..." and we cannot represent "3" with 3, 36, or 369, because they are all multiples of 3. So the first possibility for a(1) is 3691.
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[Mod[m, 3] == 0, First@ L == 0, MemberQ[a, m]], g[]]; AppendTo[a, m]; m = 0, {k}]; a]; f[Flatten@ Map[IntegerDigits, Array[3 # &, {120}]], 57] (* Michael De Vlieger, Nov 30 2015, Version 10.2 *)
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Eric Angelini, Sep 19 2004
EXTENSIONS
Name, Comments, and Example edited by Danny Rorabaugh, Nov 28 2015
More terms from Michael De Vlieger, Nov 30 2015
STATUS
approved