login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A134808 Cyclops numbers. 39
0, 101, 102, 103, 104, 105, 106, 107, 108, 109, 201, 202, 203, 204, 205, 206, 207, 208, 209, 301, 302, 303, 304, 305, 306, 307, 308, 309, 401, 402, 403, 404, 405, 406, 407, 408, 409, 501, 502, 503, 504, 505, 506, 507, 508, 509, 601, 602, 603, 604, 605, 606 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

Numbers with middle digit 0, that have only one digit 0, and the total number of digits is odd; the digit 0 represents the eye of a cyclops.

LINKS

Vincenzo Librandi, Table of n, a(n) for n = 1..1000

Brady Haran and Simon Pampena, Glitch Primes and Cyclops Numbers, Numberphile video (2015)

EXAMPLE

109 is a cyclops number because 109 has only one digit 0 and this 0 is the middle digit.

MATHEMATICA

cyclopsQ[n_Integer, b_:10] := Module[{digitList = IntegerDigits[n, b], len, pos0s, flag}, len = Length[digitList]; pos0s = Select[Range[len], digitList[[#]] == 0 &]; flag = OddQ[len] && (Length[pos0s] == 1) && (pos0s == {(len + 1)/2}); Return[flag]]; Select[Range[0, 999], cyclopsQ] (* Alonso del Arte, Dec 16 2010 *)

Reap[Do[id=IntegerDigits[n]; If[Position[id, 0]=={{(Length[id]+1)/2}}, Sow[n]], {n, 0, 10^3}]][[2, 1]] (* Zak Seidov, Dec 17 2010 *)

PROG

(Sage)

def is_cyclops(n, base=10):

....dg = n.digits(base) if n > 0 else [0]

....return len(dg) % 2 == 1 and dg[len(dg)//2] == 0 and dg.count(0) == 1

is_A134808 = lambda n: is_cyclops(n) # D. S. McNeil, Dec 17 2010

(PARI) a(n, {base=10}) = my (l=0); my (r=n-1); while (r >= (base-1)^(2*l), r -= (base-1)^(2*l); l++); return (base^(l+1) * ( (base^l-1)/(base-1) + if (base>2, fromdigits(digits(r \ ((base-1)^l), (base-1)), base)) ) + ( (base^l-1)/(base-1) + if (base>2, fromdigits(digits(r % ((base-1)^l), (base-1)), base)))) \\ Rémy Sigrist, Apr 29 2017

CROSSREFS

Cf. A134809, A138131, A138148, A160717, A182809.

Sequence in context: A152054 A296883 A183086 * A274612 A261448 A213312

Adjacent sequences:  A134805 A134806 A134807 * A134809 A134810 A134811

KEYWORD

base,easy,nonn

AUTHOR

Omar E. Pol, Nov 21 2007

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 15 20:04 EDT 2019. Contains 328037 sequences. (Running on oeis4.)