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-10 of 102 results. Next

A269503 Largest prime factor of A138148(n).

Original entry on oeis.org

101, 13, 137, 9091, 9901, 909091, 5882353, 52579, 333667, 9091, 99990001, 1058313049, 265371653, 909091, 2906161, 21993833369, 999999000001, 909090909090909091, 1111111111111111111, 909091, 1056689261, 549797184491917, 11111111111111111111111
Offset: 1

Views

Author

Altug Alkan, May 11 2016

Keywords

Comments

Largest prime factor of (10^(n+1)+1)*(10^n-1)/9.

Examples

			a(4) = 9091 because largest prime factor of 111101111 is 9091.
		

Crossrefs

Programs

  • Maple
    seq(max(max(numtheory:-factorset((10^n-1)/9)),
    max(numtheory:-factorset(10^(n+1)+1))), n=1..30); # Robert Israel, May 11 2016
  • PARI
    a006530(n) = if(n>1, vecmax(factor(n)[, 1]), 1);
    for(n=1, 25, print1(a006530((10^(2*n+1)-1)/9-10^n), ", "));

Formula

a(n) = max(A003020(n),A003021(n+1)) for n >= 2. - Robert Israel, May 11 2016

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
    

A129868 Binary palindromic numbers with only one 0 bit.

Original entry on oeis.org

0, 5, 27, 119, 495, 2015, 8127, 32639, 130815, 523775, 2096127, 8386559, 33550335, 134209535, 536854527, 2147450879, 8589869055, 34359607295, 137438691327, 549755289599, 2199022206975, 8796090925055, 35184367894527, 140737479966719, 562949936644095
Offset: 0

Views

Author

Zak Seidov, May 24 2007

Keywords

Comments

Binary expansion is 0, 101, 11011, 1110111, 111101111, ... (see A138148).
9 + 8a(n) = s^2 is a perfect square with s = 2^(n + 2) -1 = 3, 7, 15, 31, 63, ...
Numbers with middle bit 0, that have only one bit 0, and the total number of bits is odd.
The fractional part of the base 2 logarithm of a(n) approaches 1 as n approaches infinity.
Also called binary cyclops numbers.
Last digit of the decimal representation follows the pattern 5, 7, 9, 5, 5, 7, 9, 5, ... . - Alex Ratushnyak, Dec 08 2012

Crossrefs

Base 10 analog is A134808.
Binary palindromic numbers, including repunits (or Mersenne numbers A000225) are in A006995. The sequence of binary pandigital (having both 0's and 1's) palindromic numbers begins 5, 9, 17, 21, 27, 33, 45, 51, 65, 73, ...

Programs

  • Magma
    [2^(2*n+1)-2^n-1: n in [0..25]]; // Vincenzo Librandi, Dec 08 2015
    
  • Maple
    A129868:=n->2^(2*n + 1) - 2^n - 1: seq(A129868(n), n=0..30); # Wesley Ivan Hurt, Dec 08 2015
  • Mathematica
    (* 1st *) FromDigits[ #,2]&/@NestList[Append[Prepend[ #, 1], 1]&, {0}, 25] (* 2nd *) NestList[(1/2)(7 + 8# + Sqrt[9 + 8# ])&, 0, 22] (* both of these are from Zak Seidov *)
    f[n_] := 2^(2n + 1) - 2^n - 1; Table[f@n, {n, 0, 22}] (* Robert G. Wilson v, Aug 24 2007 *)
    Table[EulerE[2, 2^n], {n, 1, 60}]/2 - 1 (* Vladimir Joseph Stephan Orlovsky, Nov 03 2009 *)
    (* After running the program in A134808 *) Select[Range[0, 2^16 - 1], cyclopsQ[#, 2] &] (* Alonso del Arte, Dec 17 2010 *)
    LinearRecurrence[{7, -14, 8}, {0, 5, 27}, 30] (* Vincenzo Librandi, Dec 08 2015 *)
  • PARI
    concat(0, Vec(x*(5-8*x)/(1-7*x+14*x^2-8*x^3) + O(x^100))) \\ Altug Alkan, Dec 08 2015
    
  • Python
    def A129868(n): return ((m:=1<Chai Wah Wu, Mar 19 2024

Formula

a(n) = 2^(2n + 1) - 2^n - 1 = 2*4^n - 2^n - 1 = (2^n - 1)(2*2^n + 1).
G.f.: x*(8*x-5)/((x-1)*(2*x-1)*(4*x-1)).
Recurrences:
a(n) = (1/2)*(7 + 8*a(n - 1) + sqrt(9 + 8*a(n - 1))), a(0) = 0;
a(n) = 6*a(n - 1) - 8*a(n - 2) - 3, a(0) = 0, a(1) = 5;
a(n) = 7*a(n - 1) - 14*a(n - 2) + 8*a(n - 3), a(0) = 0, a(1) = 5, a(2) = 27.
a(n) = A006516(n+1) - 1.

A332112 a(n) = (10^(2n+1)-1)/9 + 10^n.

Original entry on oeis.org

2, 121, 11211, 1112111, 111121111, 11111211111, 1111112111111, 111111121111111, 11111111211111111, 1111111112111111111, 111111111121111111111, 11111111111211111111111, 1111111111112111111111111, 111111111111121111111111111, 11111111111111211111111111111, 1111111111111112111111111111111
Offset: 0

Views

Author

M. F. Hasler, Feb 09 2020

Keywords

Comments

a(0) = 2 is the only prime in this sequence, since all other terms factor as a(n) = R(n+1)*(10^n+1), where R(n) = (10^n-1)/9.

Crossrefs

Cf. A002275 (repunits R_n = (10^n-1)/9), A011557 (10^n).
Cf. A138148 (cyclops numbers with binary digits), A002113 (palindromes).
Cf. A332132 .. A332192 (variants with different repeated digit 3, ..., 9).
Cf. A332113 .. A332119 (variants with different middle digit 3, ..., 9).
Cf. A331860 & A331861 (indices of primes in non-palindromic variants).

Programs

  • Maple
    A332112 := n -> (10^(2*n+1)-1)/9+10^n;
  • Mathematica
    Array[ (10^(2 # + 1)-1)/9 + 10^# &, 15, 0]
  • PARI
    apply( {A332112(n)=10^(n*2+1)\9*1+10^n}, [0..15])
    
  • Python
    def A332112(n): return 10**(n*2+1)//9+10**n

Formula

a(n) = A138148(n) + 2*10^n = A002275(2n+1) + 10^n.
G.f.: (2 - 101*x)/((1 - x)(1 - 10*x)(1 - 100*x)).
a(n) = 111*a(n-1) - 1110*a(n-2) + 1000*a(n-3) for n > 2.

A332120 a(n) = 2*(10^(2n+1)-1)/9 - 2*10^n.

Original entry on oeis.org

0, 202, 22022, 2220222, 222202222, 22222022222, 2222220222222, 222222202222222, 22222222022222222, 2222222220222222222, 222222222202222222222, 22222222222022222222222, 2222222222220222222222222, 222222222222202222222222222, 22222222222222022222222222222, 2222222222222220222222222222222
Offset: 0

Views

Author

M. F. Hasler, Feb 09 2020

Keywords

Crossrefs

Cf. A002275 (repunits R_n = (10^n-1)/9), A002276 (2*R_n), A011557 (10^n).
Cf. A138148 (cyclops numbers with binary digits), A002113 (palindromes).
Cf. A332130 .. A332190 (variants with different repeated digit 3, ..., 9).
Cf. A332121 .. A332129 (variants with different middle digit 1, ..., 9).

Programs

  • Maple
    A332120 := n -> 2*((10^(2*n+1)-1)/9-10^n);
  • Mathematica
    Array[2 ((10^(2 # + 1)-1)/9 - 10^#) &, 15, 0]
  • PARI
    apply( {A332120(n)=(10^(n*2+1)\9-10^n)*2}, [0..15])
    
  • Python
    def A332120(n): return (10**(n*2+1)//9-10**n)*2

Formula

a(n) = 2*A138148(n) = A002276(2n+1) - 2*10^n.
G.f.: 2*x*(101 - 200*x)/((1 - x)(1 - 10*x)(1 - 100*x)).
a(n) = 111*a(n-1) - 1110*a(n-2) + 1000*a(n-3) for n > 2.
E.g.f.: 2*exp(x)*(10*exp(99*x) - 9*exp(9*x) - 1)/9. - Stefano Spezia, Jul 13 2024

A332190 a(n) = 10^(2n+1) - 1 - 9*10^n.

Original entry on oeis.org

0, 909, 99099, 9990999, 999909999, 99999099999, 9999990999999, 999999909999999, 99999999099999999, 9999999990999999999, 999999999909999999999, 99999999999099999999999, 9999999999990999999999999, 999999999999909999999999999, 99999999999999099999999999999, 9999999999999990999999999999999
Offset: 0

Views

Author

M. F. Hasler, Feb 08 2020

Keywords

Crossrefs

Cf. A002275 (repunits R_n = (10^n-1)/9), A002283 (9*R_n), A011557 (10^n).
Cf. A138148 (cyclops numbers with binary digits only), A002113 (palindromes).
Cf. A332120 .. A332180 (variants with different repeated digit 2, ..., 8).
Cf. A332191 .. A332197, A181965 (variants with different middle digit 1, ..., 8).

Programs

  • Maple
    A332190 := n -> 10^(2*n+1)-1-9*10^n;
  • Mathematica
    Array[10^(2 # + 1)-1-9*10^# &, 15, 0]
    LinearRecurrence[{111,-1110,1000},{0,909,99099},20] (* Harvey P. Dale, May 28 2021 *)
  • PARI
    apply( {A332190(n)=10^(n*2+1)-1-9*10^n}, [0..15])
    
  • Python
    def A332190(n): return 10**(n*2+1)-1-9*10^n

Formula

a(n) = 9*A138148(n) = A002283(2n+1) - A011557(n).
G.f.: 9*x*(101 - 200*x)/((1 - x)(1 - 10*x)(1 - 100*x)).
a(n) = 111*a(n-1) - 1110*a(n-2) + 1000*a(n-3) for n > 2.

A332197 a(n) = 10^(2n+1) - 1 - 2*10^n.

Original entry on oeis.org

7, 979, 99799, 9997999, 999979999, 99999799999, 9999997999999, 999999979999999, 99999999799999999, 9999999997999999999, 999999999979999999999, 99999999999799999999999, 9999999999997999999999999, 999999999999979999999999999, 99999999999999799999999999999, 9999999999999997999999999999999
Offset: 0

Views

Author

M. F. Hasler, Feb 08 2020

Keywords

Comments

According to Kamada, n = 118 and n = 145126 are the only known indices of primes (the so-called palindromic near-repdigit or wing primes).

Crossrefs

Cf. A002275 (repunits R_n = (10^n-1)/9), A002283 (9*R_n), A011557 (10^n).
Cf. A138148 (cyclops numbers with binary digits only).
Cf. A332190 .. A332196, A181965 (variants with different middle digit 0, ..., 8).
Cf. A332117 .. A332187 (variants with different repeated digit 1, ..., 9).

Programs

  • Maple
    A332197 := n -> 10^(n*2+1)-1-2*10^n;
  • Mathematica
    Array[ 10^(2 # + 1) -1 -2*10^# &, 15, 0]
    Table[FromDigits[Join[PadRight[{},n,9],{7},PadRight[{},n,9]]],{n,0,20}] (* or *) LinearRecurrence[{111,-1110,1000},{7,979,99799},20] (* Harvey P. Dale, Mar 03 2023 *)
  • PARI
    apply( {A332197(n)=10^(n*2+1)-1-2*10^n}, [0..15])
    
  • Python
    def A332197(n): return 10**(n*2+1)-1-2*10^n

Formula

a(n) = 9*A138148(n) + 7*10^n.
G.f.: (7 + 202*x - 1100*x^2)/((1 - x)*(1 - 10*x)*(1 - 100*x)).
a(n) = 111*a(n-1) - 1110*a(n-2) + 1000*a(n-3) for n > 2.

A138120 Concatenation of n digits 1, 2n-1 digits 0 and n digits 1.

Original entry on oeis.org

101, 1100011, 11100000111, 111100000001111, 1111100000000011111, 11111100000000000111111, 111111100000000000001111111, 1111111100000000000000011111111, 11111111100000000000000000111111111, 111111111100000000000000000001111111111
Offset: 1

Views

Author

Omar E. Pol, Apr 06 2008

Keywords

Comments

a(n) has 4n-1 digits.
a(n) is also A147539(n) written in base 2. [Omar E. Pol, Nov 08 2008]

Examples

			n ........... a(n)
1 ........... 101
2 ......... 1100011
3 ....... 11100000111
4 ..... 111100000001111
5 ... 1111100000000011111
		

Crossrefs

Programs

  • Maple
    a:= n-> parse(cat(1$n,0$(2*n-1),1$n)):
    seq(a(n), n=1..11);  # Alois P. Heinz, Mar 03 2022
  • Mathematica
    Table[FromDigits[Join[PadRight[{},n,1],PadRight[{},2n-1,0], PadRight[ {},n,1]]],{n,10}] (* or *) LinearRecurrence[{11011,-10121010,110110000,-100000000},{101,1100011,11100000111,111100000001111},10] (* Harvey P. Dale, Mar 19 2016 *)
  • PARI
    Vec(x*(10001000*x^2-12100*x+101)/((x-1)*(10*x-1)*(1000*x-1)*(10000*x-1)) + O(x^100)) \\ Colin Barker, Sep 16 2013
    
  • Python
    def a(n): return int("1"*n + "0"*(2*n-1) + "1"*n)
    print([a(n) for n in range(1, 11)]) # Michael S. Branicky, Mar 03 2022

Formula

G.f.: x*(10001000*x^2-12100*x+101) / ((x-1)*(10*x-1)*(1000*x-1)*(10000*x-1)). [Colin Barker, Sep 16 2013]

A181965 a(n) = 10^(2n+1) - 10^n - 1.

Original entry on oeis.org

8, 989, 99899, 9998999, 999989999, 99999899999, 9999998999999, 999999989999999, 99999999899999999, 9999999998999999999, 999999999989999999999, 99999999999899999999999, 9999999999998999999999999, 999999999999989999999999999, 99999999999999899999999999999, 9999999999999998999999999999999
Offset: 0

Views

Author

Ivan Panchenko, Apr 04 2012

Keywords

Comments

n 9's followed by an 8 followed by n 9's.
See A183187 = {26, 378, 1246, 1798, 2917, ...} for the indices of primes.

Crossrefs

Cf. (A077794-1)/2 = A183187 (indices of primes).
Cf. A002275 (repunits R_n = (10^n-1)/9), A002283 (9*R_n), A011557 (10^n).
Cf. A138148 (cyclops numbers with binary digits only), A002113 (palindromes).
Cf. A332190 .. A332197 (variants with different middle digit 0, ..., 7).

Programs

  • Maple
    A181965 := n -> 10^(2*n+1)-1-10^n; # M. F. Hasler, Feb 08 2020
  • Mathematica
    Array[10^(2 # + 1) - 1- 10^# &, 15, 0] (*  M. F. Hasler, Feb 08 2020 *)
    Table[With[{c=PadRight[{},n,9]},FromDigits[Join[c,{8},c]]],{n,0,20}] (* Harvey P. Dale, Jun 07 2021 *)
  • PARI
    apply( {A181965(n)=10^(n*2+1)-1-10^n}, [0..15]) \\ M. F. Hasler, Feb 08 2020
    
  • Python
    def A181965(n): return 10**(n*2+1)-1-10^n # M. F. Hasler, Feb 08 2020

Formula

From M. F. Hasler, Feb 08 2020: (Start)
a(n) = 9*A138148(n) + 8*10^n = A002283(2n+1) - A011557(10^n).
G.f.: (8 + 101*x - 1000*x^2)/((1 - x)(1 - 10*x)(1 - 100*x)).
a(n) = 111*a(n-1) - 1110*a(n-2) + 1000*a(n-3) for n > 2. (End)

Extensions

Edited and extended to a(0) = 8 by M. F. Hasler, Feb 10 2020

A332189 a(n) = 8*(10^(2n+1)-1)/9 + 10^n.

Original entry on oeis.org

9, 898, 88988, 8889888, 888898888, 88888988888, 8888889888888, 888888898888888, 88888888988888888, 8888888889888888888, 888888888898888888888, 88888888888988888888888, 8888888888889888888888888, 888888888888898888888888888, 88888888888888988888888888888, 8888888888888889888888888888888
Offset: 0

Views

Author

M. F. Hasler, Feb 08 2020

Keywords

Crossrefs

Cf. A002275 (repunits R_n = (10^n-1)/9), A002282 (8*R_n), A011557 (10^n).
Cf. A138148 (cyclops numbers with binary digits), A002113 (palindromes).
Cf. A332119 .. A332189 (variants with different "wing" digit 1, ..., 8).
Cf. A332180 .. A332187 (variants with different middle digit 0, ..., 7).

Programs

  • Maple
    A332189 := n -> 8*(10^(2*n+1)-1)/9+10^n;
  • Mathematica
    Array[8 (10^(2 # + 1)-1)/9 + 10^# &, 15, 0]
  • PARI
    apply( {A332189(n)=10^(n*2+1)\9*8+10^n}, [0..15])
    
  • Python
    def A332189(n): return 10**(n*2+1)//9*8+10**n

Formula

a(n) = 8*A138148(n) + 9*10^n = A002282(2n+1) + 10^n.
G.f.: (9 - 101*x - 700*x^2)/((1 - x)(1 - 10*x)(1 - 100*x)).
a(n) = 111*a(n-1) - 1110*a(n-2) + 1000*a(n-3) for n > 2.
Showing 1-10 of 102 results. Next