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

A276473 Number of terms of A202259 with precisely n digits.

Original entry on oeis.org

6, 38, 320, 2819, 25668, 237586, 2224574, 21007948, 199725336, 1908845614, 18321586810, 176478166845
Offset: 1

Views

Author

Barry Carter, Sep 12 2016

Keywords

Comments

When generating n random digits in order, number of ways to fail to generate a prime at any step.
a(n+1) >= 6*a(n), for n > 1, since any term of A202259 counted in a(n) may be extended with 0, 2, 4, 5, 6, or 8. - Michael S. Branicky, Nov 18 2024

Crossrefs

Cf. A202259.

Extensions

a(9)-a(11) from Michael S. Branicky, Nov 13 2024
a(12) from Michael S. Branicky, Nov 18 2024

A062115 Numbers with no prime substring in their decimal expansion.

Original entry on oeis.org

0, 1, 4, 6, 8, 9, 10, 14, 16, 18, 40, 44, 46, 48, 49, 60, 64, 66, 68, 69, 80, 81, 84, 86, 88, 90, 91, 94, 96, 98, 99, 100, 104, 106, 108, 140, 144, 146, 148, 160, 164, 166, 168, 169, 180, 184, 186, 188, 400, 404, 406, 408, 440, 444, 446, 448, 460, 464, 466
Offset: 1

Views

Author

Erich Friedman, Jun 28 2001

Keywords

Comments

This is a 10-automatic sequence, a consequence of the finitude of A071062. - Charles R Greathouse IV, Sep 27 2011
Subsequence of A202259 (right-truncatable nonprimes). Supersequence of A202262 (composite numbers in which all substrings are composite), A202265 (nonprime numbers in which all substrings and reversal substrings are nonprimes). - Jaroslav Krizek, Jan 28 2012

Examples

			25 is not included because 5 is prime.
		

Crossrefs

Subsequence of A084984. [Arkadiusz Wesolowski, Jul 05 2011]
Cf. A071062.
Cf. A163753 (complement).

Programs

  • Haskell
    a062115 n = a062115_list !! (n-1)
    a062115_list = filter ((== 0) . a039997) a084984_list
    -- Reinhard Zumkeller, Jan 31 2012
    
  • Python
    from sympy import isprime
    def ok(n):
        s = str(n)
        ss = (int(s[i:j]) for i in range(len(s)) for j in range(i+1, len(s)+1))
        return not any(isprime(k) for k in ss)
    print([k for k in range(500) if ok(k)]) # Michael S. Branicky, May 02 2023
    
  • Python
    # faster for initial segment of sequence; uses ok, import above
    from itertools import chain, count, islice, product
    def agen(): # generator of terms
        yield from chain((0,), (int(t) for t in (f+"".join(r) for d in count(1) for f in "14689" for r in product("014689", repeat=d-1)) if ok(t)))
    print(list(islice(agen(), 100))) # Michael S. Branicky, May 02 2023

Formula

A039997(a(n)) = 0. - Reinhard Zumkeller, Jul 16 2007
From Charles R Greathouse IV, Mar 23 2010: (Start)
a(n) = O(n^(log_4 10)) = O(n^1.661) because numbers containing only 0,4,6,8 are in this sequence.
a(n) = Omega(n^(log_13637 1000000)) = Omega(n^1.451) for similar reasons; this bound can be increased by considering longer sequences of digits. (End)

Extensions

Offset corrected by Arkadiusz Wesolowski, Jul 27 2011

A202260 Right-truncatable composites: every decimal prefix is a composite number.

Original entry on oeis.org

4, 6, 8, 9, 40, 42, 44, 45, 46, 48, 49, 60, 62, 63, 64, 65, 66, 68, 69, 80, 81, 82, 84, 85, 86, 87, 88, 90, 91, 92, 93, 94, 95, 96, 98, 99, 400, 402, 403, 404, 405, 406, 407, 408, 420, 422, 423, 424, 425, 426, 427, 428, 429, 440, 441, 442, 444, 445, 446, 447, 448
Offset: 1

Views

Author

Jaroslav Krizek, Dec 25 2011

Keywords

Comments

Subsequence of A202259.

Crossrefs

Cf. A012883 (right-truncatable noncomposites), A202259 (right-truncatable nonprimes), A024770 (right-truncatable primes).
Cf. A254750, A254752, A254754, A254755 (left-truncatable composites).

Programs

  • PARI
    isComposite(n) = (n>2)&&(!isprime(n));
    isRightTruncatableComposite(n,b=10) = {my(k=b);if(!isComposite(n),return(0););while(n\k>0,if(!isComposite(n\k),return(0););k*=b);return(1);} \\ Stanislav Sykora, Feb 15 2015

A202265 Nonprime numbers in which all substrings and reversal substrings are nonprimes.

Original entry on oeis.org

0, 1, 4, 6, 8, 9, 10, 18, 40, 44, 46, 48, 49, 60, 64, 66, 68, 69, 80, 81, 84, 86, 88, 90, 94, 96, 99, 100, 108, 180, 184, 186, 400, 404, 406, 408, 440, 444, 446, 448, 460, 464, 466, 468, 469, 480, 481, 484, 486, 488, 490, 494, 496, 600, 604, 606, 608, 609
Offset: 1

Views

Author

Jaroslav Krizek, Dec 25 2011

Keywords

Comments

Subsequence of A062115, A202259.
Supersequence of A202266.

Examples

			All substrings and reversal substrings of 186 are nonprimes: 1, 6, 8, 18, 68, 81, 86, 186, 681.
		

Crossrefs

Cf. A202263 (primes in which all substrings and reversal substrings are primes), A068669 (noncomposite numbers in which all substrings and reversal substrings are noncomposites), A202266 (composite numbers in which all substrings and reversal substrings are composites).

Programs

  • Mathematica
    Select[Range[0,1000],NoneTrue[Union[Flatten[{#,IntegerReverse[#]}&/@Flatten[Table[ FromDigits/@Partition[IntegerDigits[#],d,1],{d,IntegerLength[#]}]]]],PrimeQ]&] (* Harvey P. Dale, Jul 30 2024 *)

Extensions

Corrected (498 deleted) by Harvey P. Dale, Jul 30 2024

A331044 a(n) is the greatest prime number of the form floor(n/10^k) for some k >= 0, or 0 if no such prime number exists.

Original entry on oeis.org

0, 0, 2, 3, 0, 5, 0, 7, 0, 0, 0, 11, 0, 13, 0, 0, 0, 17, 0, 19, 2, 2, 2, 23, 2, 2, 2, 2, 2, 29, 3, 31, 3, 3, 3, 3, 3, 37, 3, 3, 0, 41, 0, 43, 0, 0, 0, 47, 0, 0, 5, 5, 5, 53, 5, 5, 5, 5, 5, 59, 0, 61, 0, 0, 0, 0, 0, 67, 0, 0, 7, 71, 7, 73, 7, 7, 7, 7, 7, 79, 0
Offset: 0

Views

Author

Rémy Sigrist, Jan 08 2020

Keywords

Comments

In other words, a(n) is the greatest prime prefix of n, or 0 if every prefix of n is nonprime.
This sequence is a decimal variant of A039634.

Examples

			For n = 42:
- neither 42 nor 4 is a prime number,
- hence a(42) = 0.
For n = 290:
- 290 is not a prime number,
- 29 is a prime number,
- hence a(290) = 29.
		

Crossrefs

See A331045 for a similar sequence.

Programs

  • Mathematica
    A331044[n_] := NestWhile[Quotient[#, 10] &, n, # > 0 && !PrimeQ[#] &];
    Array[A331044, 100, 0] (* Paolo Xausa, Nov 22 2024 *)
  • PARI
    a(n, base=10) = while (n, if (isprime(n), return (n), n\=base)); 0

Formula

a(n) <= n with equality iff n = 0 or n is a prime number.
a(n) >= 0 with equality iff n belongs to A202259.

A329428 Starting from n: as long as the decimal representation starts with a prime number, replace the largest such prefix with the index of the corresponding prime number; a(n) corresponds to the final value.

Original entry on oeis.org

0, 1, 1, 1, 4, 1, 6, 4, 8, 9, 10, 1, 12, 6, 14, 15, 16, 4, 18, 8, 10, 1, 12, 9, 14, 15, 16, 4, 18, 10, 10, 1, 12, 9, 14, 15, 16, 12, 18, 10, 40, 6, 42, 14, 44, 45, 46, 15, 48, 49, 10, 1, 12, 16, 14, 15, 16, 12, 18, 4, 60, 18, 62, 63, 64, 65, 66, 8, 68, 69, 40
Offset: 0

Views

Author

Rémy Sigrist, Nov 30 2019

Keywords

Comments

As long as we have a number whose decimal representation is the concatenation of a prime number, say the k-th prime number, and a minimal string possibly empty or with leading zeros, say v, we replace this number with the concatenation of k and v; eventually none of the prefixes will be a prime number.

Examples

			For n = 991:
- let pi denote A000720,
- 991 gives pi(991) = 167,
- 167 gives pi(167) = 39,
- 39 gives pi(3) followed by 9 = 29,
- 29 gives pi(29) = 10,
- neither 1 nor 10 is a prime number, so a(991) = 10.
		

Crossrefs

See A327539 for similar sequences.

Programs

  • Mathematica
    Array[Which[# == 0, 0, # == 1, 1, True, FixedPoint[If[! IntegerQ@ #1, FromDigits[#2], FromDigits[Join @@ {IntegerDigits@ PrimePi@ #1, Drop[#2, IntegerLength@ #1]}]] & @@ {SelectFirst[Table[FromDigits[#[[1 ;; i]]], {i, Length@ #, 1, -1}], PrimeQ], #} &@ IntegerDigits[#] &, #]] &, 71, 0] (* Michael De Vlieger, Dec 01 2019 *)
    f[n_]:=Block[{p,r,d = IntegerDigits@ n,v=n}, Do[{p,r}= FromDigits/@ TakeDrop[d,k]; If[PrimeQ@ p, v=PrimePi[p] 10^(Length[d]-k)+r; Break[]],{k, Length@d, 1, -1}]; v]; a[n_]:= FixedPoint[f, n]; Array[a,71,0] (* Giovanni Resta, Dec 02 2019 *)
  • PARI
    t(n) = if (n==0, 0, isprime(n), primepi(n), 10*t(n\10)+(n%10))
    a(n) = while (n!=n=t(n),); n

Formula

a(n) <= n with equality iff n belongs to A202259.
a(prime(k)) = a(k) for any k > 0 where prime(k) denotes the k-th prime number.
a(10*k + v) = 10*a(k) + v for any k > 0 and v in {0, 2, 4, 5, 6, 8}.
a(A007097(k)) = 1 for any k >= 0.

A331045 a(n) is the least prime number of the form floor(n/10^k) for some k >= 0, or 0 if no such prime number exists.

Original entry on oeis.org

0, 0, 2, 3, 0, 5, 0, 7, 0, 0, 0, 11, 0, 13, 0, 0, 0, 17, 0, 19, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, 41, 0, 43, 0, 0, 0, 47, 0, 0, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0, 61, 0, 0, 0, 0, 0, 67, 0, 0, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 0, 0, 0, 83
Offset: 0

Views

Author

Rémy Sigrist, Jan 08 2020

Keywords

Comments

In other words, a(n) is the least prime prefix of n, or 0 if every prefix of n is nonprime.
This sequence is a variant of A331044.

Examples

			For n = 23:
- 2 is a prime number,
- hence a(23) = 2.
		

Crossrefs

Programs

  • PARI
    a(n, base=10) = my (d=digits(n, base), p=0); for (k=1, #d, if (isprime(p=base*p+d[k]), return (p))); return (0)

Formula

a(n) <= n with equality iff n = 0 or n belongs to A069090.
a(n) >= 0 with equality iff n belongs to A202259.
a(n) <= A331044(n).

A331046 Numbers k such that floor(k/10^m) is a prime number for some m >= 0.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 41, 43, 47, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 61, 67, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 83, 89, 97, 101, 103, 107, 109, 110, 111, 112, 113
Offset: 1

Views

Author

Rémy Sigrist, Jan 08 2020

Keywords

Comments

In other words, these are the numbers with a prime prefix.
For any m > 0:
- let f(m) be the proportion of positive numbers <= 10^m belonging to this sequence,
- we have f(m) = Sum_{p < 10^m in A069090} 1/10^A055642(p),
- also f(m) <= f(m+1) <= 1,
- so {f(m)} has a limit, say F, as m tends to infinity,
- what is the value of F?

Examples

			The number 2 is prime, so every number in A217394 belongs to this sequence.
		

Crossrefs

Cf. A055642, A069090, A202259 (complement), A217394, A331044, A331045.

Programs

  • PARI
    is(n,base=10) = while (n, if (isprime(n), return (1), n\=base)); return (0)
Showing 1-8 of 8 results.