A175728 Decimal expansion of e written as a sequence of distinct positive integers.
2, 7, 1, 8, 28, 18, 284, 5, 90, 4, 52, 3, 53, 60, 287, 47, 13, 526, 6, 24, 9, 77, 57, 2470, 93, 69, 99, 59, 574, 96, 696, 76, 27, 72, 40, 766, 30, 35, 354, 75, 94, 571, 38, 21, 78, 525, 16, 64, 274, 2746, 63, 91, 93200, 305, 992, 181, 74, 135, 966, 290, 43, 572, 900, 33, 42
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
rd = RealDigits[E, 10, 200][[1]]; lst = {}; f[n_] := Block[{k = 1}, While[a = FromDigits[ Take[ rd, k]]; MemberQ[lst, a] || rd[[k + 1]] == 0, k++ ]; AppendTo[ lst, a]; rd = Drop[rd, k]]; Array[f, 70]; lst (* Robert G. Wilson v, Aug 22 2010 *)
-
Python
from itertools import islice from sympy import exp def diggen(): yield from map(int, str(exp(1).n(10**5))[:-1].replace(".", "")) def agen(): # generator of terms g = diggen() aset, nextd = set(), next(g) while True: an, nextd = nextd, next(g) while an in aset or nextd == 0: an, nextd = int(str(an) + str(nextd)), next(g) yield an aset.add(an) print(list(islice(agen(), 65))) # Michael S. Branicky, Mar 31 2022
Extensions
More terms from Robert G. Wilson v, Aug 22 2010
Comments