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-6 of 6 results.

A048436 Take the first n numbers written in base 4, concatenate them, then convert from base 4 to base 10.

Original entry on oeis.org

1, 6, 27, 436, 6981, 111702, 1787239, 28595832, 457533321, 7320533146, 117128530347, 1874056485564, 29984903769037, 479758460304606, 7676135364873711, 491272663351917520, 31441450454522721297, 2012252829089454163026, 128784181061725066433683
Offset: 1

Views

Author

Patrick De Geest, May 15 1999

Keywords

Comments

There is no prime among the first 5000 terms (emails from Kurt Foster, Oct 21 2015 and Oct 24 2015). When is the first prime? - N. J. A. Sloane, Oct 25 2015
There is no prime among the first 45000 terms. - Giovanni Resta, Jun 07 2018

Examples

			a(7): (1)(2)(3)(10)(11)(12)(13) = 12310111213_4 = 1787239.
		

Crossrefs

Cf. A014825.
Concatenation of first n numbers in other bases: 2: A047778, 3: A048435, 4: this sequence, 5: A048437, 6: A048438, 7: A048439, 8: A048440, 9: A048441, 10: A007908, 11: A048442, 12: A048443, 13: A048444, 14: A048445, 15: A048446, 16: A048447. - Dylan Hamilton, Aug 11 2010

Programs

  • Magma
    [n eq 1 select 1 else Self(n-1) * 4^(1+Ilog(4,n)) + n: n in [1..20]]; // Jason Kimberley, Nov 27 2012
    
  • Mathematica
    a[n_]:= FromDigits[Flatten@IntegerDigits[Range@n, 4], 4]; Array[a, 20] (* Vincenzo Librandi, Dec 30 2012 *)
  • Python
    from functools import reduce
    def A048436(n): return reduce(lambda i,j:(i<<(bool((m:=j.bit_length())&1)<<1)+(m&-2))+j,range(n+1)) # Chai Wah Wu, Feb 26 2023

Formula

a(n) = a(n-1) * 4^(1 + floor(log4(n))) + n. [Moved from A117640 by Jason Kimberley, Nov 27 2012]

A058935 Concatenation of first n binary numbers.

Original entry on oeis.org

0, 1, 110, 11011, 11011100, 11011100101, 11011100101110, 11011100101110111, 110111001011101111000, 1101110010111011110001001, 11011100101110111100010011010, 110111001011101111000100110101011, 1101110010111011110001001101010111100
Offset: 0

Views

Author

Henry Bottomley, Jan 12 2001

Keywords

Comments

If the terms are read as decimal numbers, which of them are primes? For example, a(5) = 11011100101 = 1193*9229757 is not a prime. - N. J. A. Sloane, Feb 17 2023
Answer: a(231) is the first prime term when read as a decimal number; a(15) is the first when read as a binary number. - Michael S. Branicky, Feb 17 2023

Crossrefs

Cf. A047778 for this converted to decimal, A001855 (offset) for number of digits.
Cf. A066716: binary Champernowne constant, A030302: binary digits, A030190: same with initial 0, A030303: indices of 1's, A007088.
Other bases: A117640 (4), A007908 (10).

Programs

  • Mathematica
    FromDigits /@ Flatten /@ Rest[FoldList[Append, {}, IntegerDigits[Range[10], 2]]] (* Eric W. Weisstein, Nov 04 2015 *)
  • Python
    from itertools import count, islice
    def agen(s=""): yield from (int(s:=s+bin(n)[2:]) for n in count(0))
    print(list(islice(agen(), 13))) # Michael S. Branicky, Feb 17 2023
    
  • Python
    from functools import reduce
    def A058935(n): return int(bin(reduce(lambda i,j:(i<Chai Wah Wu, Feb 26 2023

Formula

a(n) = a(n-1)*10^A029837(n) + A007088(n).

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

Original entry on oeis.org

1, 111, 111111, 1111111111, 111111111111111, 111111111111111111111, 1111111111111111111111111111, 111111111111111111111111111111111111, 111111111111111111111111111111111111111111111, 1111111111111111111111111111111111111111111111111111111, 111111111111111111111111111111111111111111111111111111111111111111
Offset: 1

Views

Author

Keywords

Comments

Concatenate 1, 11, 111, ..., 11...1 (n ones). There are n*(n+1)/2 1's in a(n).
This is a kind of unary analog of A058935, A360502, A117640, etc.
When regarded as decimal numbers, which (if any) is the smallest prime?
Answer: All terms > 1 are composite, since 111 is composite, all triangular numbers > 3 are composite and a prime repunit must have a prime number of decimal digits (see A004023). - Chai Wah Wu, Apr 19 2023. [This result was independently obtained by Michael S. Branicky, see A362429. - N. J. A. Sloane, Apr 20 2023]
a(45) has more than 1000 digits, and so cannot be included in the b-file. - Jason Bard, Apr 12 2025

Examples

			a(3) = 111111 because 3(3+1)/2 = 6, and 111111 has 6 ones.
		

Crossrefs

Programs

Formula

a(n) = A000042(A000217(n)). - Jason Bard, Apr 12 2025

A362117 Concatenation of first n numbers in base 5.

Original entry on oeis.org

1, 12, 123, 1234, 123410, 12341011, 1234101112, 123410111213, 12341011121314, 1234101112131420, 123410111213142021, 12341011121314202122, 1234101112131420212223, 123410111213142021222324, 12341011121314202122232430, 1234101112131420212223243031
Offset: 1

Views

Author

Keywords

Comments

When regarded as decimal numbers, the first prime in this sequence is a(6) = 12341011.
a(8) is also prime and for n <= 2000, a(n) is not prime except for n = 6 or 8. - Chai Wah Wu, Apr 19 2023

Crossrefs

Programs

  • Mathematica
    A362117[n_]:=FromDigits[Flatten[IntegerDigits[Range[n],5]]];Array[A362117,20] (* Paolo Xausa, Nov 27 2023 *)
  • Python
    from gmpy2 import digits
    def A362117(n): return int(''.join(digits(n,5) for n in range(1,n+1))) # Chai Wah Wu, Apr 19 2023

A362119 Concatenate the base-6 strings for 1,2,...,n.

Original entry on oeis.org

1, 12, 123, 1234, 12345, 1234510, 123451011, 12345101112, 1234510111213, 123451011121314, 12345101112131415, 1234510111213141520, 123451011121314152021, 12345101112131415202122, 1234510111213141520212223, 123451011121314152021222324, 12345101112131415202122232425
Offset: 1

Views

Author

Keywords

Comments

The smallest prime occurs at n = 12891. - Michael S. Branicky, Apr 20 2023
The b-file has only 313 terms, since a(314) has 1001 digits.

Crossrefs

Programs

  • Mathematica
    A362119[n_]:=FromDigits[Flatten[IntegerDigits[Range[n],6]]];Array[A362119,20] (* Paolo Xausa, Nov 27 2023 *)
  • Python
    from sympy.ntheory import digits
    from itertools import count, islice
    def agen(s="", base=6): yield from (int(s:=s+"".join(map(str, digits(n, base)[1:]))) for n in count(1))
    print(list(islice(agen(), 20)))

A362429 Smallest k such that the concatenation of the numbers 123...k in base n is prime when interpreted as a decimal number, or -1 if no such prime exists.

Original entry on oeis.org

-1, 231, 7315, 3241, 6, 12891, 22, 227, 127
Offset: 1

Views

Author

Keywords

Comments

The sequence can be extended to bases larger than 10 by concatenating the decimal equivalents of digits.
a(1) is -1 since no such primes are possible (the sequence in question is A362118). Proof. The number of ones in the resulting repunit is triangular and per A000217, 3 is the only prime triangular number, and per A004023, prime repunits must have prime indices.
If it exists, a(10) would be the index of the first prime in A007908. See A007908 for the latest information about the search for this prime.
a(10), ..., a(14) are respectively ?, 144, 307, ?, 25.
a(10) and a(13) are presently unknown. a(13) > 10000 if it is not -1.

Examples

			a(5) is 6: 12341011 (concatenate 1 though 6 in base 5) is a prime when interpreted as a decimal number.
		

Crossrefs

Sequences of concatenations: A362118 (base 1), A058935 (base 2), A360502 (base 3), A117640 (base 4), A362117 (base 5), A362119 (base 6), A007908 (base 10).
Cf. A376221.

Programs

  • Python
    from gmpy2 import is_prime
    from sympy.ntheory import digits
    from itertools import count, islice
    def c(base, s=""):
        if base == 1: yield from (s:=s+"1"*n for n in count(1))
        else:
            yield from (s:=s+"".join(map(str, digits(n, base)[1:])) for n in count(1))
    def a(n):
        if n == 1: return -1
        return next(k for k, t in enumerate(c(n), 1) if is_prime(int(t)))
Showing 1-6 of 6 results.