A290984 First n-digit number to appear twice in a row in the decimal expansion of e.
6, 95, 427, 1828, 34619, 507629, 7342911, 21958718, 852480872
Offset: 1
Examples
a(1) = 6 because 6 is the first 1-digit number to appear twice in a row in the decimal expansion of e = 2.718281828459045235360287471352(66)...
Programs
-
Mathematica
With[{s = Rest@ First@ RealDigits[N[E, 10^5]]}, Keys@ Merge[#, Identity] &@ Table[TakeSmallest[#, 1] &@ Sort[Map[#[[1, 1]] &, DeleteCases[#, {}]]] &@ Map[SequenceCases[#, {a_, b_} /; b == a + n] &, KeyMap[FromDigits, PositionIndex@ Partition[s, n, 1]]], {n, 4}]] (* Michael De Vlieger, Aug 16 2017 *) (* or *) s = First@ RealDigits[E,10,51*^5]; Table[p = Partition[s, k, 1]; FromDigits @@ p[[ Select[ Range[ Length@p - k], p[[#]] == p[[#+k]] &, 1]]], {k, 7}] (* much faster, Giovanni Resta, Sep 05 2017 *)
Extensions
a(6)-a(8) from Giovanni Resta, Sep 05 2017
a(9) from Michael S. Branicky, Jan 20 2023
Comments