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-3 of 3 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
    

A134809 Cyclops primes.

Original entry on oeis.org

101, 103, 107, 109, 307, 401, 409, 503, 509, 601, 607, 701, 709, 809, 907, 11027, 11047, 11057, 11059, 11069, 11071, 11083, 11087, 11093, 12011, 12037, 12041, 12043, 12049, 12071, 12073, 12097, 13033, 13037, 13043, 13049, 13063
Offset: 1

Views

Author

Omar E. Pol, Nov 25 2007

Keywords

Comments

Cyclops numbers that are prime numbers: primes with an odd number of digits with middle digit 0 that have only one digit 0.
The only known Fibonacci number in this sequence is 99194853094755497 (see A005478 and A182809).
The only known Lucas number in this sequence is 688846502588399 (see A005479 and A182811).

Crossrefs

Intersection of prime numbers A000040 and cyclops numbers A134808.

Programs

  • Mathematica
    (* First run the program given for A134808 *) Select[Prime[Range[2000]], cyclopsQ] (* Alonso del Arte, Dec 16 2010 *)
    cycQ[n_]:=Module[{idn=IntegerDigits[n],len},len=Length[idn];OddQ[len] && Count[idn,0] == 1 && idn[[(len+1)/2]]==0]; Select[Flatten[Table[Prime[ Range[ PrimePi[10^(2n)+1],PrimePi[10^(2n+1)]]],{n,2}]],cycQ] (* Harvey P. Dale, Jun 20 2014 *)
  • Python
    # cyclops() in A134808
    from sympy import isprime
    print([c for c in cyclops(upto=13063) if isprime(c)]) # Michael S. Branicky, Jan 05 2021

Extensions

Links added by Omar E. Pol, Mar 25 2011

A182811 Cyclops-Lucas numbers.

Original entry on oeis.org

64079, 1860498, 4870847, 688846502588399
Offset: 1

Views

Author

Omar E. Pol, Dec 20 2010

Keywords

Comments

a(4) = 688846502588399 is the only known Cyclops-Lucas prime.
It seems likely that these four are the only terms. There are no further terms below Lucas(10^7), and that number in decimal contains 208435 zeros (with ~208988 expected assuming normality), whereas a member of this sequence must have only 1. - D. S. McNeil, Dec 21 2010
This sequence is similar to A182809 in the sense that both have four positive terms and the only known prime is also the largest known term. - Omar E. Pol, Dec 21 2010
Indices in A000032 are 23, 30, 32, 71. - Michel Marcus and Omar E. Pol, Feb 18 2018

Examples

			a(1) = 64079 is in the sequence because 64079 is a Lucas number and it is also a cyclops number.
		

Crossrefs

Intersection of A000032 and A134808.

Programs

  • Mathematica
    (* First run the program given for A134808 *) Select[LucasL[Range[10^3]], cyclopsQ] (* Alonso del Arte, Dec 20 2010 *)
    Select[LucasL[Range[500]],OddQ[IntegerLength[#]]&&DigitCount[#,10,0]==1&&IntegerDigits[#][[(IntegerLength[#]+1)/2]]==0&] (* Harvey P. Dale, Jul 01 2017 *)

Formula

Intersection of A000032 and A134808.
Showing 1-3 of 3 results.