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.

Previous Showing 61-70 of 104 results. Next

A048611 Find smallest pair (x,y) such that x^2 - y^2 = 11...1 (n times) = (10^n-1)/9; sequence gives value of x.

Original entry on oeis.org

1, 6, 20, 56, 156, 340, 2444, 4440, 167000, 55556, 267444, 333400, 132687920, 5555556, 10731400, 40938800, 2682647040, 333334000, 555555555555555556, 3334367856, 11034444280, 35595935980, 5555555555555555555556
Offset: 1

Views

Author

Keywords

Comments

Least solutions for 'Difference between two squares is a repunit of length n'.

Examples

			For n=2, 6^2 - 5^2 = 11.
		

References

  • David Wells, "Curious and Interesting Numbers", Revised Ed. 1997, Penguin Books, p. 119. ISBN 0-14-026149-4.

Crossrefs

Programs

  • Mathematica
    s = Flatten[Table[r = (10^i - 1)/9; d = Divisors[r]; p = d[[Length[d]/2]]; Solve[{x - y == p, x + y == r/p}, {y, x}], {i, 2, 56}]]; Prepend[Cases[s, Rule[x, n_] -> n], 1]
  • Python
    from sympy import divisors
    def A048611(n):
        d = divisors((10**n-1)//9)
        l = len(d)
        return (d[l//2]+d[(l-1)//2])//2 # Chai Wah Wu, Apr 05 2021

Formula

a(n) = (A033677((10^n-1)/9)+A033676((10^n-1)/9))/2. - Chai Wah Wu, Apr 05 2021

Extensions

Corrected and extended by Patrick De Geest, Jun 15 1999
More terms from Hans Havermann, Jul 02 2000
Offset corrected by Chai Wah Wu, Apr 05 2021

A076697 Indices of record values in A079451, largest prime factor of Lucas numbers A000032.

Original entry on oeis.org

0, 2, 4, 5, 7, 8, 11, 13, 16, 17, 19, 26, 31, 37, 41, 47, 53, 61, 68, 71, 76, 79, 86, 113, 136, 164, 172, 178, 202, 218, 229, 262, 278, 284, 307, 313, 328, 353, 373, 436, 443, 458, 487, 503, 557, 577, 586, 613, 617, 746, 751, 758, 863, 914
Offset: 0

Views

Author

Shane Findley, Oct 25 2002

Keywords

Comments

From M. F. Hasler, Apr 09 2025: (Start)
Original name: Next-to-largest factor of Lucas(n).
The offset 0 is coherent with the fact that the initial term is a starting value rather than a record value.
When A000032(n) is prime (<=> n is in A001606), it necessarily sets a new record for the largest prime factor, since A000032 is increasing from the second term on. Therefore, A001606 is a subsequence. (End)

Crossrefs

Cf. A000042 (Lucas numbers, starting with 2), A079451 (largest prime factor of these).
Cf. A001606 (Indices of prime Lucas numbers: a subsequence).

Programs

  • PARI
    A076697_first(n, m=0)=vector(n,i, i>1 || n=-1; until(mA079451(n++), m), );n) \\ M. F. Hasler, Apr 09 2025
    
  • Python
    def A076697(n):
        try: terms, M = A076697.terms, A076697.M
        except AttributeError: A076697.terms = terms = [0]; A076697.M = M = 2
        while len(terms) <= n: terms.append(next(i for i in range(terms[-1]+1, 1<<59)
            if M < (M:=max(A079451(i),M)))); A076697.M = M
        return terms[n] # M. F. Hasler, Apr 10 2025

Extensions

New definition and data corrected and extended by M. F. Hasler, Apr 09 2025

A083813 a(n) = 3*(10^n-1).

Original entry on oeis.org

27, 297, 2997, 29997, 299997, 2999997, 29999997, 299999997, 2999999997, 29999999997, 299999999997, 2999999999997, 29999999999997, 299999999999997
Offset: 1

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), May 08 2003

Keywords

Comments

Original definition: 3n+1 is the digit reversal of n+1.
1. a(n) = 27 + 270 + 2700 + ... up to n terms = sum of n terms of the geometric progression with the first term 27 and common ratio 10.
2. a(n) = 27*A000042(n) (the unary sequence).
Equals A086574 restricted to positive indices. See that entry for many more comments, formulas and references. - M. F. Hasler, Jul 29 2016

Crossrefs

Essentially a duplicate of A086574.

Programs

  • Mathematica
    3(10^Range[20]-1) (* or *) Table[10 FromDigits[PadRight[{2},n,9]]+7,{n,20}] (* Harvey P. Dale, Jan 25 2020 *)

Extensions

Edited by M. F. Hasler, Jul 29 2016

A093521 Runs of 1's of lengths 1, prime(1), prime(2), prime(3), ... separated by 0's.

Original entry on oeis.org

1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0
Offset: 1

Views

Author

Robert G. Wilson v, Mar 29 2004

Keywords

Comments

Carl Sagan's "Contact" sequence.
Zeros occur at positions given by 1+A110895(k). - Antti Karttunen, Nov 08 2018

References

  • W. A. Dembski and J. M. Kushiner, Signs of Intelligence, Baker Book House Co., Grand Rapids, MI, p30-31, 2001,
  • Carl Sagan, Contact, Simon and Schuster, Chapter 4 "Prime Numbers," pp. 68-82, NY, 1985.

Crossrefs

Programs

  • Mathematica
    a = Table[1, {100}]; Do[ a[[Sum[Prime[i], {i, n}] + n]] = 0, {n, 1, 8}]; a
  • PARI
    up_to = 111;
    A093521list(up_to) = { my(v=vector(up_to), i=2, j); v[1] = 1; v[2] = 0; forprime(p=2, oo, j=p; while(j, if(i==up_to, return(v), i++; v[i] = 1; j--)); if(i==up_to, return(v), i++; v[i] = 0)); };
    v093521 = A093521list(up_to);
    A093521(n) = v093521[n];

Extensions

Data section extended up to n=111 by Antti Karttunen, Nov 08 2018

A272232 Smallest k > 0 such that R_k//n//R_k is prime, where R_k is the repunit A002275(k) of length k and // denotes concatenation; or -1 if no such k exists.

Original entry on oeis.org

1, 9, -1, 1, 2, 1, 10, 3, 1, 1, 3, -1, 2, 3, 33, 1, 2, 1, 1, 21, 1, 2, -1, 1, 7, 48, 292, 4, 3, 1, 1, 2, 1, -1, 135, -1, 1, -1, 1, 34, 3, 3, 40, 2, -1, 1, 3, 1, 1, 32, 61, 1, 2, 1, 137, -1, 3, 1, 2, 42, 1, 14, 1, 262, 2, 22, -1, 3, 9, 2, 33, 73, 1, 3, 1, 2, 3, -1, 2, 2, 1
Offset: 0

Views

Author

Felix Fröhlich, Apr 23 2016

Keywords

Comments

a(2) = -1 (see second comment in A258372).
a(n) = -1 if n > 0 is in A099814 (see fourth comment in A004022).
a(n) = -1 if n is of the form A000042(i)*10^j+A000042(i) for some j > i > 0, since the resulting number is divisible by A002275(k)//A000042(i).
a(n) = -1 if n is a term of A010785 with an even number of digits, since any number of the form 1..1d..d1..1 with an even number of digits d is divisible by 11.
a(n) = 1 if there exists an integer x such that n = (A002275(A004023(x))-A011557(x)-1)/10.
From Chai Wah Wu, Nov 07 2019: (Start)
a(n) = -1 if n has an even number of digits and is a multiple of 11. In particular, a(n) = -1 if n is a term of A056524.
a(n) = -1 if n = (10^k+1)(10^m-1)/9 for some m > 0, k >= 0.
(End)
a(140) > 20000. - Hans Havermann, May 21 2022

Examples

			a(0) = 1 since 101 is prime; a(1) refers to the prime 1111111111111111111.
a(124) = -1 because R_k//124//R_k is divisible by 125*10^k-1.
		

Crossrefs

Programs

  • Mathematica
    Table[SelectFirst[Range[10^4], PrimeQ@ FromDigits@ Flatten@ {#, IntegerDigits@ n, #} &@ Table[1, {#}] &], {n, 0, 91}] /. k_ /; MissingQ@ k -> 0 (* Michael De Vlieger, Apr 25 2016, Version 10.2 *)
  • PARI
    a(n) = my(k=1); while(!ispseudoprime(eval(Str((10^k-1)/9, n, (10^k-1)/9))), k++); k

Extensions

a(35)-a(80) from Giovanni Resta, May 01 2016
Escape clausae value changed to -1 by N. J. A. Sloane, May 17 2022

A334131 Numbers that can be written as a product of distinct repunits.

Original entry on oeis.org

0, 1, 11, 111, 1111, 1221, 11111, 12221, 111111, 122221, 123321, 1111111, 1222221, 1233321, 1356531, 11111111, 12222221, 12333321, 12344321, 13566531, 111111111, 122222221, 123333321, 123444321, 135666531, 135787531, 1111111111, 1222222221
Offset: 1

Views

Author

Ilya Gutkovskiy, Apr 14 2020

Keywords

Examples

			13566531 = 11*111*11111. - _David A. Corneth_, Mar 26 2021
		

Crossrefs

A355280 Binary numbers (digits in {0, 1}) with no run of digits with length < 2.

Original entry on oeis.org

11, 111, 1100, 1111, 11000, 11100, 11111, 110000, 110011, 111000, 111100, 111111, 1100000, 1100011, 1100111, 1110000, 1110011, 1111000, 1111100, 1111111, 11000000, 11000011, 11000111, 11001100, 11001111, 11100000, 11100011, 11100111, 11110000, 11110011, 11111000, 11111100, 11111111
Offset: 1

Views

Author

M. F. Hasler, Oct 17 2022

Keywords

Comments

This is the binary representation of the terms in A033015.
The sequence can be seen as a table where row r contains the terms with r digits. Then row r+1 is obtained by from the terms of row r by duplicating their last digit, and from those of row r-1 by appending twice the 1's complement of their last digit. This yields the row lengths given in FORMULA.

Examples

			There can't be a terms with only 1 digit, so the smallest term is a(1) = 11.
The only 3-digit term is a(2) = 111, since in 100 the digit 1 is alone, and in 101 and 110 the digit 0 is alone.
With four digits we must have either no or two digits 0 and they must be at the end (to avoid isolated '1's), i.e., a(3) = 1100 and a(4) = 1111.
		

Crossrefs

Cf. A033015 (the same terms converted from base 2 to base 10),
Subsequence of A007088 (the binary numbers); A000042 (numbers in base 1) = A002275 \ {0} (repunits) are subsequences; A061851 is the subsequence of palindromes.

Programs

  • Maple
    F:= proc(d) option remember;
       local R,i,j, x0;
       R:= NULL;
       for i from d-2 to 2 by -1 do
         x0:= (10^d - 10^i)/9;
         for j from i-2 to 0 by -1 do
            R:= R, op(map(t -> t + x0, procname(j)))
         od
       od;
       sort([R, (10^d-1)/9])
    end proc:
    F(0):= [0]; F(1):= [];
    seq(op(F[i]),i=2..9); # Robert Israel, May 12 2025
  • PARI
    {is_A355280(n,d=digits(n))=vecmax(d)==1 && is_A033015(fromdigits(d,2))}
    A355280(n)=A007088(A033015(n))
    concat(apply( {A355280_row(n)=if(n>2, setunion([x*10+x%10|x<-A355280_row(n-1)],[x*100+11*(1-x%10)|x<-A355280_row(n-2)]), n>1, [11],[])}, [1..8])) \\ "Row" of n-digit terms. For (very) large n one should implement memoization instead of this naive recursion.
    
  • Python
    def A355280_row(n): return [] if n<2 else [11] if n==2 else sorted(
        [x*10+x%10 for x in A355280_row(n-1)] +
        [x*100+11-x%10*11 for x in A355280_row(n-2)]) # M. F. Hasler, Oct 17 2022

Formula

a(n) = A007088(A033015(n)).
The number of terms with n digits is Fibonacci(n-1); the largest such term is A000042(n) = A002275(n).

A357774 Binary expansions of odd numbers with two zeros in their binary expansion.

Original entry on oeis.org

1001, 10011, 10101, 11001, 100111, 101011, 101101, 110011, 110101, 111001, 1001111, 1010111, 1011011, 1011101, 1100111, 1101011, 1101101, 1110011, 1110101, 1111001, 10011111, 10101111, 10110111, 10111011, 10111101, 11001111, 11010111, 11011011, 11011101, 11100111, 11101011
Offset: 1

Views

Author

Bernard Schott, Oct 19 2022

Keywords

Comments

For m >= 4, there are A000217(m-3) terms with m digits.

Crossrefs

A267524 \ {1, 10, 100} and A267705 \ {1, 10} are two subsequences.
Similar, but with k zeros in their binary expansion: A000042 (k=0), A190619 (k=1).

Programs

  • Mathematica
    FromDigits[IntegerDigits[#, 2]] & /@ Select[Range[1, 250, 2], DigitCount[#, 2, 0] == 2 &] (* Amiram Eldar, Oct 19 2022 *)
  • PARI
    isok(k) = (k%2) && (#binary(k) == hammingweight(k)+2); \\ A357773
    f(n) = fromdigits(binary(n), 10); \\ A007088
    lista(nn) = apply(f, select(isok, [1..nn])); \\ Michel Marcus, Oct 19 2022
  • Python
    from itertools import combinations, count, islice
    def agen(): # generator of terms
        for d in count(4):
            b, c = 2**d - 1, 2**(d-1)
            for i, j in combinations(range(1, d-1), 2):
                yield int(bin(b - (c >> i) - (c >> j))[2:])
    print(list(islice(agen(), 30))) # Michael S. Branicky, Oct 19 2022
    
  • Python
    from itertools import count, islice
    def A357774_gen(): # generator of terms
        for l in count(2):
            m = (10**(l+2)-1)//9
            for i in range(l,0,-1):
                k = m-10**i
                yield from (k-10**j for j in range(i-1,0,-1))
    A357774_list = list(islice(A357774_gen(),30)) # Chai Wah Wu, Feb 19 2023
    
  • Python
    from math import isqrt, comb
    from sympy import integer_nthroot
    def A357774(n):
        a = (m:=integer_nthroot(6*n, 3)[0])+(n>comb(m+2,3))+3
        b = isqrt((j:=comb(a-1,3)-n+1)<<3)+3>>1
        c = j-comb((r:=isqrt(w:=j<<1))+(w>r*(r+1)),2)
        return (10**a-1)//9-10**b-10**c # Chai Wah Wu, Dec 19 2024
    

Formula

a(n) = A007088(A357773(n)).

A046415 Repunit of length a(n) has exactly 4 prime factors (counted with multiplicity).

Original entry on oeis.org

8, 9, 10, 14, 41, 43, 49, 53, 109, 157, 167, 173, 197, 199, 223, 229, 269, 283, 307, 349
Offset: 1

Views

Author

Patrick De Geest, Jul 15 1998

Keywords

Crossrefs

Programs

  • Mathematica
    Select[Range[350],PrimeOmega[FromDigits[PadRight[{},#,1]]]==4&] (* Harvey P. Dale, Oct 27 2020 *)
  • PARI
    isok(n) = bigomega((10^n - 1)/9) == 4; \\ Michel Marcus, Apr 23 2017

Extensions

More terms from Robert Gerbicz, Nov 22 2010
Offset corrected to 1, a(18)-a(20) added by Ray Chandler, Apr 23 2017

A046416 Repunit of length a(n) has exactly 5 prime factors (counted with multiplicity).

Original entry on oeis.org

6, 25, 29, 62, 89, 134, 137, 142, 151, 179, 239, 257, 271, 277, 289
Offset: 1

Views

Author

Patrick De Geest, Jul 15 1998

Keywords

Crossrefs

Extensions

More terms from Robert Gerbicz, Nov 22 2010
a(14) by Bo Gyu Jeong, Jun 30 2012
a(15) from Ray Chandler, Apr 23 2017
Previous Showing 61-70 of 104 results. Next