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!)
A166875 Numbers less than 100 that can't be obtained from 2, 4, 6, 8 using +, -, x and /. 0
17, 21, 23, 27, 31, 33, 37, 38, 39, 41, 43, 45, 47, 49, 53, 55, 57, 59, 61, 62, 63, 65, 66, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 86, 87, 89, 90, 91, 93, 94, 95, 97, 98, 99 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
MATHEMATICA
M := {{2, 4, 6, 8}, {2, 4, 8, 6}, {2, 6, 4, 8}, {2, 6, 8, 4}, {2, 8, 4, 6}, {2, 8, 6, 4}, {4, 2, 6, 8}, {4, 2, 8, 6}, {4, 6, 2, 8}, {4, 6, 8, 2}, {4, 8, 2, 6}, {4, 8, 6, 2}, {6, 2, 4, 8}, {6, 2, 8, 4}, {6, 2, 4, 8}, {6, 2, 8, 4}, {6, 4, 2, 8}, {6, 4, 8, 2}, {6, 8, 2, 4}, {6, 8, 4, 2}, {8, 2, 4, 6}, {8, 2, 6, 4}, {8, 4, 2, 6}, {8, 4, 6, 2}, {8, 6, 2, 4}, {8, 6, 4, 2}}
operaciones[n_] := Module[{d0, d1, d2}, d0 = Mod[n, 4]; d1 = Mod[(n - d0)/4, 4]; d2 = Mod[(n - d0 - 4 d1)/4^2, 4]; {d2, d1, d0}] resultado1[o_, e_] := Module[{res = e[[1]], i}, For[i = 1, i < 4, i++,
res = Switch[o[[i]], 0, res + e[[i + 1]], 1, res - e[[i + 1]], 2, res*e[[i + 1]], 3, res/e[[i + 1]]]]; res] resultado2[o_, e_] := Module[{aux1, aux2}, aux1 = Switch[o[[1]], 0, e[[1]] + e[[2]], 1, e[[1]] - e[[2]], 2, e[[1]]*e[[2]], 3, e[[1]]/e[[2]]]; aux2 = Switch[o[[3]], 0, e[[3]] + e[[4]], 1, e[[3]] - e[[4]], 2, e[[3]]*e[[4]], 3, e[[3]]/e[[4]]]; Switch[o[[2]], 0, aux1 + aux2, 1, aux1 - aux2, 2, aux1*aux2, 3, aux1/aux2]]
prueba[x_] := Module[{parar = True}, For[n = 0, n < 4^3 && parar, n++, For[i = 1, i < 27 && parar, i++, parar = Not[resultado1[operaciones[n], M[[i]]] == x || resultado2[operaciones[n], M[[i]]] == x]]]; parar] For[j = 0, j < 100, j++, If[prueba[j], Print[j]]]
CROSSREFS
Sequence in context: A140146 A039502 A039505 * A282109 A307863 A128546
KEYWORD
nonn,fini,full
AUTHOR
Salvador Perez Gomez (pies314(AT)hotmail.com), Oct 22 2009
STATUS
approved

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 April 25 03:15 EDT 2024. Contains 371964 sequences. (Running on oeis4.)