cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-9 of 9 results.

A134808 Cyclops numbers.

Original entry on oeis.org

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
Offset: 1

Views

Author

Omar E. Pol, Nov 21 2007

Keywords

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.

Examples

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

Crossrefs

Programs

  • 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 *)
    cycQ[n_]:=Module[{idn=IntegerDigits[n],len=IntegerLength[n]},OddQ[len] && DigitCount[ n,10,0]==1&&idn[[(len+1)/2]]==0]; Join[{0},Select[Range[ 0,700],cycQ]] (* Harvey P. Dale, Mar 07 2020 *)
  • 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
    
  • Python
    from itertools import product
    def cyclops(upto=float('inf'), upton=float('inf')): # generator
      yield 0
      c, n, half_digits, pow10 = 0, 1, 0, 10
      while 100**(half_digits+1) < upto and n < upton:
        half_digits += 1
        pow10 *= 10
        for left in product("123456789", repeat=half_digits):
          left_plus_eye = int("".join(left))*pow10
          for right in product("123456789", repeat=half_digits):
            c, n = left_plus_eye + int("".join(right)), n+1
            if c <= upto and n <= upton: yield c
    print([c for c in cyclops(upto=606)])
    print([c for c in cyclops(upton=52)]) # Michael S. Branicky, Jan 05 2021
  • 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
    

A160711 Cyclops squares: squares (A000290) that are also cyclops numbers (A134808).

Original entry on oeis.org

0, 11025, 19044, 21025, 24025, 32041, 38025, 42025, 47089, 51076, 58081, 59049, 65025, 66049, 67081, 75076, 87025, 93025, 1110916, 1140624, 1170724, 1190281, 1240996, 1270129, 1290496, 1340964, 1350244, 1380625, 1420864, 1430416
Offset: 1

Views

Author

Omar E. Pol, Jun 08 2009

Keywords

Examples

			19044 is in the sequence because it is a square (138^2) and is also a cyclops number (odd number of digits, middle digit is the only zero).
11025 is in the sequence because it is a square (105^2) and is also a cyclops number (odd number of digits, middle digit is the only zero). - _Michael B. Porter_, Jul 09 2016
		

Crossrefs

Programs

  • Mathematica
    Select[Range[0, 1200]^2, And[OddQ@ Length@ #, #[[Ceiling[Length[#]/2]]] == 0, Count[#, 0] == 1] &@ IntegerDigits@ # &] (* Michael De Vlieger, Jul 08 2016 *)
    cnQ[n_]:=Module[{len=IntegerLength[n]},OddQ[len]&&DigitCount[n,10,0]==1 && IntegerDigits[n][[(len+1)/2]]==0]; Join[{0},Select[Range[1200]^2,cnQ]] (* Harvey P. Dale, Mar 19 2018 *)

A153806 Strobogrammatic cyclops numbers.

Original entry on oeis.org

0, 101, 609, 808, 906, 11011, 16091, 18081, 19061, 61019, 66099, 68089, 69069, 81018, 86098, 88088, 89068, 91016, 96096, 98086, 99066, 1110111, 1160911, 1180811, 1190611, 1610191, 1660991, 1680891, 1690691, 1810181, 1860981
Offset: 1

Views

Author

Omar E. Pol, Jan 15 2009

Keywords

Comments

Intersection of A000787 and A134808.

Examples

			1680891 is a member because it is the same upside down (A000787) and also a cyclops number (A134808).
		

Crossrefs

Programs

  • Mathematica
    Select[Range[10^7], And[OddQ@ Length@#, Part[#, Ceiling[Length[#]/2]] == 0, Times @@ Boole@ Map[MemberQ[{0, 1, 6, 8, 9}, #] &, Union@ #] == 1, Count[#, 0] == 1, (Take[#, Floor[Length[#]/2]] /. {6 -> 9, 9 -> 6}) ==
    Reverse@ Take[#, -Floor[Length[#]/2]]] &@ IntegerDigits@ # &] (* Michael De Vlieger, Jul 05 2016 *)
  • Python
    import sys
    f = open('b153806.txt', 'w')
    i = 1
    n = 0
    a = [""]
    r = [""]  #reversed strobogrammatically
    while True:
        for x,y in zip(a,r):
            f.write(str(i)+" "+x+"0"+y+"\n")
            i += 1
            if i>20000:
                f.close()
                sys.exit()
        a = sum([[x+"1",x+"6",x+"8",x+"9"] for x in a],[])
        r = sum([["1"+x,"9"+x,"8"+x,"6"+x] for x in r],[])
    # Kenny Lau, Jul 05 2016

Extensions

Extended beyond 11011 by R. J. Mathar, Jan 17 2009

A160717 Cyclops triangular numbers.

Original entry on oeis.org

0, 105, 406, 703, 903, 11026, 13041, 14028, 15051, 27028, 36046, 41041, 43071, 46056, 61075, 66066, 75078, 77028, 83028, 85078, 93096, 1110795, 1130256, 1160526, 1180416, 1250571, 1290421, 1330896, 1350546, 1360425, 1380291
Offset: 1

Views

Author

Omar E. Pol, Jun 08 2009

Keywords

Comments

Triangular numbers (A000217) that are also cyclops numbers (A134808).

Examples

			105 is in the sequence since it is both a triangular number (105 = 1 + 2 + ... + 14) and a Cyclops number (number of digits is odd, and the only zero is the middle digit). - _Michael B. Porter_, Jul 08 2016
		

Crossrefs

Programs

  • Maple
    count:= 1: A[1]:= 0:
    for d from 1 to 3 do
      for x from 0 to 9^d-1 do
        L:= convert(x+9^d,base,9);
        X:= add((L[i]+1)*10^(i-1),i=1..d);
        for y from 0 to 9^d-1 do
          L:= convert(y+9^d,base,9);
          Y:= add((L[i]+1)*10^(i-1),i=1..d);
          Z:= Y + 10^(d+1)*X;
          if issqr(1+8*Z) then
            count:= count+1;
            A[count]:= Z;
          fi
    od od od:
    seq(A[i],i=1..count); # Robert Israel, Jul 08 2016
  • Mathematica
    cyclopsQ[n_] := Block[{id=IntegerDigits@n,lg=Floor[Log[10,n]+1]}, Count[id,0]==1 && OddQ@lg && id[[(lg+1)/2]]==0]; lst = {0}; Do[t = n (n + 1)/2; If[ cyclopsQ@t, AppendTo[lst, t]], {n, 0, 1670}]; lst (* Robert G. Wilson v, Jun 09 2009 *)
    cyclpsQ[n_]:=With[{len=IntegerLength[n]},OddQ[len]&&DigitCount[n,10,0]==1&&IntegerDigits[n][[(len+1)/2]]==0]; Join[{0},Select[ Accumulate[ Range[2000]],cyclpsQ]] (* Harvey P. Dale, Nov 05 2024 *)

Extensions

More terms from Robert G. Wilson v, Jun 09 2009
Offset and b-file changed by N. J. A. Sloane, Jul 27 2016

A153807 Strobogrammatic cyclops primes.

Original entry on oeis.org

101, 16091, 1160911, 1180811, 1190611, 1690691, 1880881, 1960961, 1990661, 6110119, 6610199, 6860989, 166906991, 168101891, 169609691, 188906881, 189808681, 196906961, 199609661, 616906919, 661609199, 666101999, 668609899
Offset: 1

Views

Author

Omar E. Pol, Jan 15 2009

Keywords

Comments

Primes in A153806.

Crossrefs

Extensions

Extended by Ray Chandler, May 20 2009

A160712 Composite cyclops numbers (A134808).

Original entry on oeis.org

102, 104, 105, 106, 108, 201, 202, 203, 204, 205, 206, 207, 208, 209, 301, 302, 303, 304, 305, 306, 308, 309, 402, 403, 404, 405, 406, 407, 408, 501, 502, 504, 505, 506, 507, 508, 602, 603, 604, 605, 606, 608, 609, 702, 703, 704
Offset: 1

Views

Author

Omar E. Pol, Jun 08 2009

Keywords

Crossrefs

Extensions

Edited by Omar E. Pol, Jul 04 2009

A136098 Prime palindromic cyclops numbers.

Original entry on oeis.org

101, 16061, 31013, 35053, 38083, 73037, 74047, 91019, 94049, 1120211, 1150511, 1160611, 1180811, 1190911, 1250521, 1280821, 1360631, 1390931, 1490941, 1520251, 1550551, 1580851, 1630361, 1640461, 1660661, 1670761, 1730371
Offset: 1

Views

Author

Lekraj Beedassy, Mar 15 2008

Keywords

Comments

Prime entries of A138131.

Crossrefs

Programs

  • Maple
    f:= proc(n,d) local L,m,k,p;
      L:= convert(9^d+n,base,9);
      p:= add((1+L[d+1-i])*(10^(i-1)+10^(2*d+1-i)),i=1..d);
      if isprime(p) then p fi;
    end proc:
    [seq(seq(f(i,d),i=0..9^d-1),d=1..3)]; # Robert Israel, Feb 18 2018
  • Mathematica
    Select[Flatten[Table[Select[Range[10^(2n), 10^(2n+1)-1], PalindromeQ[ #] && DigitCount[ #, 10, 0]==1&&IntegerDigits[#][[(IntegerLength[#]+1)/2]]==0&], {n, 3}]],PrimeQ] (* James C. McMahon, Apr 27 2025 *)

A138831 n-th perfect number minus 1, written in base 2.

Original entry on oeis.org

101, 11011, 111101111, 1111110111111, 1111111111110111111111111, 111111111111111101111111111111111, 1111111111111111110111111111111111111
Offset: 1

Views

Author

Omar E. Pol, Apr 08 2008, Apr 09 2008, Apr 14 2008

Keywords

Comments

Subset of A138148, cyclops numbers with binary digits, only.
Subset of A002113, palindromes in base 10.
a(n) has 2*A090748(n) digits 1.
The number of digits of a(n) is 2*A000043(n)-1, equal to A133033(n), the number of proper divisors of n-th perfect number.
a(n) = (A135627(n) written in base 2).

Examples

			n ... A000396(n) - 1 = A135627(n) ............. a(n)
1 ............ 6 - 1 = ...... 5 ............... 101
2 ........... 28 - 1 = ..... 27 .............. 11011
3 .......... 496 - 1 = .... 495 ............ 111101111
4 ......... 8128 - 1 = ... 8127 .......... 1111110111111
5 ..... 33550336 - 1 = 33550335 .... 1111111111110111111111111
		

Crossrefs

Formula

a(n) = A138148(A090748(n)).

A160725 Cyclops semiprimes.

Original entry on oeis.org

106, 201, 202, 203, 205, 206, 209, 301, 302, 303, 305, 309, 403, 407, 501, 502, 505, 703, 706, 707, 802, 803, 807, 901, 905, 11013, 11014, 11015, 11017, 11019, 11021, 11023, 11029, 11031, 11035, 11038, 11041, 11042, 11051, 11053
Offset: 1

Views

Author

Omar E. Pol, Jun 12 2009

Keywords

Comments

Cyclops numbers (A134808) that are also semiprimes (A001358).

Crossrefs

Programs

  • Maple
    g:= proc(x,n)
      local L,i;
      L:= convert(x+9^(2*n),base,9);
      add((L[i]+1)*10^(i-1),i=1..n)+add((L[i]+1)*10^i,i=n+1..2*n)
    end proc:
    select(t -> numtheory:-bigomega(t)=2,[seq(seq(g(i,n),i=0..9^(2*n)-1),n=1..2)]); # Robert Israel, Jan 20 2019
  • Mathematica
    Select[Range@ 12000, And[OddQ@ #2, #3[[Ceiling[#2/2] ]] == 0, Count[#3, 0] == 1, PrimeOmega@ #1 == 2] & @@ {#, IntegerLength@ #, IntegerDigits@ #} &] (* or *)
    Select[Flatten@ Table[a (10^(d + 1)) + b, {d, 2}, {a, FromDigits /@ Tuples[Range@ 9, {d}]}, {b, FromDigits /@ Tuples[Range@ 9, {d}]}], PrimeOmega@ # == 2 &] (* Michael De Vlieger, Jan 20 2019 *)
Showing 1-9 of 9 results.