A114801 2-concatenation-free sequence starting (1,2).
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 20, 22, 30, 33, 40, 44, 50, 55, 60, 66, 70, 77, 80, 88, 90, 99, 100, 121, 123, 124, 125, 126, 127, 128, 129, 131, 132, 134, 135, 136, 137, 138, 139, 141, 142, 143, 145, 146, 147, 148, 149, 151, 152, 153, 154, 156, 157, 158
Offset: 1
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Stöhr Sequence.
- Rémy Sigrist, PARI program for A114801
Programs
-
Mathematica
conc[x_, y_] := FromDigits@ Flatten@ IntegerDigits[{x, y}]; L = {1, 2}; cc = {12, 21}; Do[k = 1 + Max@L; While[MemberQ[cc, k], k++]; cc = Union[cc, conc[#, k] & /@ L, conc[k, #] & /@ L]; AppendTo[L, k];, {65}]; L (* Giovanni Resta, Jun 15 2016 *)
-
PARI
See Links section.
-
Python
from itertools import count, islice def agen(): # generator of terms cats1, cats2, an, s = {"1", "2"}, {"12", "21"}, 3, "3" yield from [1, 2] while True: yield an cats2 |= {s + c for c in cats1} | {c + s for c in cats1} cats1.add(s) while (s:=str(an)) in cats1 or s in cats2: an += 1 print(list(islice(agen(), 59))) # Michael S. Branicky, Feb 01 2024
Formula
a(0) = 1, a(1) = 2, for n>2: a(n) = least k > a(n-1) such that k is not an element of {Concatenate(a(i), a(j))} for any distinct a(i) <= a(n-1) and a(j) <= a(n-1).
Extensions
Data corrected by Giovanni Resta, Jun 14 2016
Comments