login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A266281 a(1)=1; a(n) is the first integer > a(n-1) with which, in the a(n-1)/a(n) decimal expansion, n is present. 1

%I #28 Feb 19 2016 05:53:50

%S 1,4,11,13,14,17,19,22,23,29,34,47,58,61,65,87,89,93,94,97,102,103,

%T 105,109,113,115,116,118,121,130,131,136,139,141,149,152,157,159,161,

%U 166,167,169,174,177,179,181,184,188,191,193,194,197,199,203,218,223,224

%N a(1)=1; a(n) is the first integer > a(n-1) with which, in the a(n-1)/a(n) decimal expansion, n is present.

%C Two other sequences are possible without the a(n)>a(n-1) limitation, one with a(n) terms already used in the sequences (where the n growth does not allow data looping), another only with a(n) terms not yet used.

%H Francesco Di Matteo, <a href="/A266281/b266281.txt">Table of n, a(n) for n = 1..1000</a>

%e a(8) = 22 because a(7) = 19 and "8" does not appear in the digital expansion of 19/20 = 0.95 nor of 19/21 = 0.904761904761..., but it does appear in 19/22 = 0.86363...;

%e a(9) = 23 because 22/23 = 0.9565217391304..., where "9" does appear;

%e a(10) = 29 because "10" does not appear in the digital expansion of 23/k for k=24..28, but it does appear in 23/29 = 0.7931034...

%t f[n_] := Block[{a = {1}, k}, Do[k = a[[m - 1]] + 1; While[SequenceCount[Flatten@ First@ RealDigits[a[[m - 1]]/k], IntegerDigits@ m] < 1, k++]; AppendTo[a, k], {m, 2, n}]; a]; f@ 57 (* Version 10.1, or *)

%t f[n_] := Block[{a = {1}, k}, Do[k = a[[m - 1]] + 1; While[StringCount[

%t ToString[FromDigits@ Flatten@ First@ RealDigits[a[[m - 1]]/k]], ToString@ m] < 1, k++]; AppendTo[a, k], {m, 2, n}]; a]; f@ 57 (* _Michael De Vlieger_, Dec 30 2015, Version 5.1 *)

%o (Python)

%o alfa = 1

%o for n in range(2,101):

%o beta = alfa

%o aflag = 0

%o while aflag == 0:

%o beta = beta + 1

%o restlist = []

%o result = ""

%o dividend = alfa

%o lenn = len(str(n))

%o bflag = 0

%o while bflag < lenn:

%o dividend = dividend * 10

%o q = dividend/beta

%o resto = dividend - (q * beta)

%o if resto == 0:

%o bflag = lenn

%o if resto in restlist:

%o bflag = bflag + 1

%o restlist.append(resto)

%o dividend = resto

%o result = result + str(q)

%o if str(n) in result:

%o bflag = lenn

%o aflag = 1

%o print alfa

%o alfa = beta

%Y Cf. A257664, A265740, A265756.

%K nonn,base

%O 1,2

%A _Francesco Di Matteo_, Dec 26 2015

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 1 14:05 EDT 2024. Contains 372174 sequences. (Running on oeis4.)