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 51-56 of 56 results.

A358344 a(1) = 0; a(n) = the smallest number such that the concatenation a(1)a(2)...a(n) is prime in the smallest allowed base; sequence terminates at index m if a(1)a(2)...a(m)k is composite in the smallest allowed base for all k.

Original entry on oeis.org

0, 2, 1, 2, 2, 3, 1, 5, 9, 7, 21, 5, 31, 49, 39, 104, 2, 34, 44, 74, 22, 64, 16, 107, 549, 81, 207, 273, 87, 497, 27, 556, 42, 150, 32, 44, 144, 340, 28, 198, 677, 13, 61, 209, 377, 893, 329, 391, 49, 83, 425, 197, 1017, 205, 191, 163, 1131, 291, 281, 295, 389
Offset: 1

Views

Author

Samuel Harkness, Nov 11 2022

Keywords

Comments

For all n > 1, a(n) > 0.
For all n > 3, if a(n) is even or odd, then until a new number a(n+k) > a(n), all a(n+k) must also be even or odd, respectively.
"Smallest allowed base" is max{a(1), a(2), ..., a(n)} + 1. E.g., a(3) uses base 3 because max{0, 2, 1} + 1 = 3.
Treat a(n) >= 10 as one "digit". E.g., if three consecutive terms were 8, 12, 4, treat the concatenation as "8C4" to be read in base 13 instead of "8124."
It is unknown whether this sequence has infinite terms. There exist initial values which, using the method described in the definition, reach a point that guarantees no new primes. E.g., Michael S. Branicky showed for a(1) = 13, after 4 terms {13, 9, 3, 5} the tested number for a fifth term "k" is not prime for 0 <= k < 13, and the equation for the tested number once k >= 13 is 13*(k+1)^4 + 9*(k+1)^3 + 3*(k+1)^2 + 5(k+1) + k = (k+2)(13*k^3 + 35*k^2 + 38*k + 15), thus never prime. Because there exist initial values which guarantee no new terms after various lengths, any initial value may eventually reach such a point.

Examples

			For a(6): The concatenation a(1)a(2)a(3)a(4)a(5) gives 2122. The smallest base in which 2122 can be read is max{2, 1, 2, 2} + 1 = 3, so test 21220_3 = 213 (nonprime), 21221_3 = 214 (nonprime), 21222_3 = 215 (nonprime). Now, 21223 is the next candidate; note that the new smallest allowed base is max{2, 1, 2, 2, 3} + 1 = 4, so test 21223_4 = 619 (prime). Thus, a(6) = 3.
		

Crossrefs

Programs

  • Mathematica
    V = {0}; While[Length[V] <= 60, c = 0; d = 0; b = Max[V] + 1; CCC = 0; While[c == 0, X = V; X = Append[X, d]; CCC = 0; For[i = 1, i <= Length[X], i++, CCC += Part[X, i]*b^(Length[X] - i)]; If[PrimeQ[CCC], c = 1]; d++; If[d == b, b++]]; V = X]; Print[V]
  • Python
    from sympy import isprime
    from itertools import count, islice
    def fd(d, b): return sum(di*b**i for i, di in enumerate(d[::-1]))
    def anext(alst):
        b = max(alst)
        return next(k for k in count(1) if isprime(fd(alst+[k], max(b, k)+1)))
    def agen():
        alst = [0]
        while True: yield alst[-1]; alst.append(anext(alst))
    print(list(islice(agen(), 61))) # Michael S. Branicky, Nov 11 2022

Extensions

Escape clause added by Jianing Song, Nov 28 2022

A155873 This sequence of prime numbers reproduces itself (without its "tail") when the last digit of each term is erased.

Original entry on oeis.org

2, 3, 5, 7, 23, 37, 59, 73, 233, 373, 593, 739, 2339, 3733, 5939, 7393, 23399, 37337, 59393, 73939, 233993, 373379, 593933, 739391, 2339933, 3733799, 5939333, 7393913, 23399339, 37337999, 59393339, 73939133
Offset: 1

Views

Author

Eric Angelini, Jan 29 2009

Keywords

Comments

Sequence computed by Mensanator. The "tail" of the sequence is made from its last four terms. This is the longest possible such sequence.

Examples

			Erasing the last digit of every term of 2 3 5 7 23 37 59 73 leaves 2 3 5 7, which is 2 3 5 7 23 37 59 73 without its "tail" (the last four integers).
		

Crossrefs

Cf. A024770 (right-truncatable primes: every prefix is prime).

A160952 a(n)=largest (n+1)-digit prime formed by appending a digit to a(n-1); a(0)=2.

Original entry on oeis.org

2, 29, 293, 2939, 29399, 293999, 2939999, 29399999
Offset: 0

Views

Author

Vladislav-Stepan Malakhovsky and Juri-Stepan Gerasimov, May 31 2009

Keywords

Comments

There is no prime a(8) since 293999991 to 293999999 are all composite.
This is also one of five longest possible sequences of primes where each term is formed by appending a digit to the previous term. Alternatively, one can view 29399999 as a prime where truncating the last digit successively always produces a prime. These are called Right-truncatable primes and the other four with 8 digits are 23399339, 37337999, 5939339 and 73939133. A list of all 83 possible Right-truncatable primes can be found in links for A024770. I have independently verified that this list is complete.

Examples

			a(0)=2, a(1)=29, a(2)=293, a(3)=2939, a(4)=29399, a(5)=293999, a(6)=2939999, a(7)=29399999.
		

Crossrefs

Extensions

Syntactically incorrect maple code deleted by R. J. Mathar, Oct 15 2011

A173060 Partial sums of A024785.

Original entry on oeis.org

2, 5, 10, 17, 30, 47, 70, 107, 150, 197, 250, 317, 390, 473, 570, 683, 820, 987, 1160, 1357, 1580, 1863, 2176, 2493, 2830, 3177, 3530, 3897, 4270, 4653, 5050, 5493, 5960, 6483, 7030, 7643, 8260, 8903, 9550, 10203, 10876, 11559, 12302, 13075, 13872
Offset: 1

Views

Author

Jonathan Vos Post, Feb 08 2010

Keywords

Comments

Partial sums of left-truncatable primes. This sequence has 4260 terms. The subsequence of prime partial sums of left-truncatable primes begins 2, 5, 17, 47, 107, 197, 317, 683, 7643. The subsubsequence of left-truncatable prime partial sums of left-truncatable primes begins 2, 5, 197, 317.

Examples

			a(57) = 2 + 3 + 5 + 7 + 13 + 17 + 23 + 37 + 43 + 47 + 53 + 67 + 73 + 83 + 97 + 113 + 137 + 167 + 173 + 197 + 223 + 283 + 313 + 317 + 337 + 347 + 353 + 367 + 373 + 383 + 397 + 443 + 467 + 523 + 547 + 613 + 617 + 643 + 647 + 653 + 673 + 683 + 743 + 773 + 797 + 823 + 853 + 883 + 937 + 947 + 953 + 967 + 983 + 997 + 1223 + 1283 + 1367.
		

Crossrefs

Formula

a(n) = SUM[i=1..n] A024785(i) = SUM[i=1..n] {p prime, and every suffix of p in decimal expansion is prime, and no digits are zero}.

A284060 Primes that are left-, left/right-, and right-truncatable.

Original entry on oeis.org

2, 3, 5, 7, 23, 37, 53, 73, 373, 3137, 3797
Offset: 1

Views

Author

Rick L. Shepherd, Mar 19 2017

Keywords

Comments

Intersection of A020994 and A077390. Only the last three terms exhibit all three properties nontrivially.

Examples

			The prime 3797 is a term because it is a term of A024785 (truncating from the left: 797, 97, 7 are primes), of A077390 (truncating the same number of digits from left and from right: 79 is a prime), and of A024770 (truncating from the right: 379, 37, 3 are primes). The digit 9 is not a prime, so 3797 is not also a term of A085823.
		

Crossrefs

Cf. A020994, A024770, A024785, A077390, A085823 (a subsequence).

A360225 a(1) = 2, a(2) = 3, a(n) = the smallest prime whose digits consist of a(n-2), followed by zero or more digits, followed by a(n).

Original entry on oeis.org

2, 3, 23, 3023, 2393023, 3023172393023, 2393023313023172393023, 3023172393023282393023313023172393023, 239302331302317239302383023172393023282393023313023172393023
Offset: 1

Views

Author

Robert C. Lyons, Jan 30 2023

Keywords

Examples

			a(4) = 3023 because int(concat('3', '23')) is not prime, and int(concat('3', '0', '23')) is prime.
		

Crossrefs

Programs

  • Python
    from sympy import isprime
    max_n = 10
    prev_prev = 2
    prev = 3
    seq = [prev_prev, prev]
    for n in range(3, max_n+1):
        result = int(str(prev_prev) + str(prev))
        if not isprime(result):
            middle_length = 1
            keep_searching = True
            while keep_searching:
                for middle in range(0, 10**middle_length):
                    result = int(str(prev_prev) + str(middle).zfill(middle_length) + str(prev))
                    if isprime(result):
                        keep_searching = False
                        break
                middle_length = middle_length + 1
        seq.append(result)
        prev_prev = prev
        prev = result
    print(seq)
Previous Showing 51-56 of 56 results.