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.

A217657 Delete the initial digit in decimal representation of n.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
Offset: 0

Views

Author

Reinhard Zumkeller, Oct 10 2012

Keywords

Comments

When n - a(n)*10^[log_10 n] >= 10^[(log_10 n) - 1], where [] denotes floor, or when n < 100 and 10|n, n is the concatenation of A000030(n) and a(n) - corrected by Glen Whitney, Jul 01 2022
a(110) = 10 is the first term > 9. The sequence consists of 10 repetitions of 0 (n = 0..9), then 9 repetitions of {0, ..., 9} (n = 10..99), then 9 repetitions of {0, ..., 99} (n = 100..999), and so on. - M. F. Hasler, Oct 18 2017

Crossrefs

Cf. A059995 (drop final digit of n), A000030 (initial digit of n), A202262.

Programs

  • Haskell
    a217657 n | n <= 9    = 0
              | otherwise = 10 * a217657 n' + m where (n', m) = divMod n 10
    
  • Mathematica
    Array[FromDigits@ Rest@ IntegerDigits@ # &, 121, 0] (* Michael De Vlieger, Dec 22 2019 *)
  • PARI
    apply( A217657(n)=n%10^logint(n+!n,10), [0..199]) \\ M. F. Hasler, Oct 18 2017, edited Dec 22 2019
    
  • Python
    def a(n): return 0 if n < 10 else int(str(n)[1:])
    print([a(n) for n in range(121)]) # Michael S. Branicky, Jul 01 2022

Formula

a(n) = 0 if n <= 9, otherwise 10*a(floor(n/10)) + n mod 10.
a(n) = n mod 10^floor(log_10(n)), a(0) = 0. - M. F. Hasler, Oct 18 2017

Extensions

Data extended to include the first terms larger than 9, by M. F. Hasler, Dec 22 2019

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

A068669 Noncomposite numbers in which every substring is noncomposite.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 13, 17, 23, 31, 37, 53, 71, 73, 113, 131, 137, 173, 311, 313, 317, 373, 1373, 3137
Offset: 1

Views

Author

Amarnath Murthy, Mar 02 2002

Keywords

Comments

It is easy to see that this sequence is complete - the only potential 5-digit candidate 31373 is not prime. - Tanya Khovanova, Dec 09 2006

Examples

			137 is a member as all the substrings, i.e. 1, 3, 7, 13, 37, 137, are noncomposite.
All substrings of 3137 are noncomposite numbers: 1, 3, 7, 13, 37, 137, 313, 3137. - _Jaroslav Krizek_, Dec 25 2011
		

Crossrefs

Programs

  • Mathematica
    noncompositeQ[n_] := n == 1 || PrimeQ[n]; Reap[ Do[ id = IntegerDigits[n]; lid = Length[id]; test = And @@ noncompositeQ /@ FromDigits[#, 10]& /@ Flatten[ Table[ Take[id, {i, j}], {i, 1, lid}, {j, i, lid}], 1]; If[test, Sow[n]], {n, Join[{1}, Prime /@ Range[10000]]}]][[2, 1]](* Jean-François Alcover, May 09 2012 *)

Extensions

1 added following a redefinition by Jaroslav Krizek. - R. J. Mathar, Jan 20 2012

A226099 Positive integers that yield a prime when their most significant (i.e., leftmost) decimal digit is removed.

Original entry on oeis.org

12, 13, 15, 17, 22, 23, 25, 27, 32, 33, 35, 37, 42, 43, 45, 47, 52, 53, 55, 57, 62, 63, 65, 67, 72, 73, 75, 77, 82, 83, 85, 87, 92, 93, 95, 97, 102, 103, 105, 107, 111, 113, 117, 119, 123, 129, 131, 137, 141, 143, 147, 153, 159, 161, 167, 171, 173, 179, 183, 189, 197, 202, 203, 205, 207, 211, 213, 217
Offset: 1

Views

Author

Jonathan Vos Post, May 26 2013

Keywords

Comments

Terms < 110 are the same as in A260181, numbers whose last digit is prime. - M. F. Hasler, Dec 20 2019
These are numbers with decimal expansion of the form k = xp where p is a prime and x is a single digit. Whether or not the number k itself is a prime is irrelevant. - N. J. A. Sloane, Dec 21 2019

Examples

			a(1) = 12 because when its most significant (or leftmost) digit (1) is removed, the remaining number 2 is prime, and it is the least such number.
102, 103, 105 and 107 are in the sequence because if the first digit is dropped, what is left is a 1-digit prime with a leading digit '0'.
		

Crossrefs

Cf. A000040, A217657 (n without initial digit), A000030 (initial digit of n), A260181 (last digit is prime), A202262 (substrings are composite).

Programs

  • Magma
    [k:k in [1..220]| IsPrime( k-Reverse(Intseq(k))[1]*10^(#Intseq(k)-1 ))]; // Marius A. Burtea, Dec 21 2019
  • Mathematica
    Select[Range@ 300, PrimeQ@ FromDigits@ Rest@ IntegerDigits@ # &] (* Giovanni Resta, Dec 20 2019 *)
  • PARI
    select( is(n)=isprime(n%10^logint(n+!n,10)), [0..222]) \\ M. F. Hasler, Dec 20 2019
    

Formula

From M. F. Hasler, Dec 21 2019: (Start)
n in A226099 (this sequence) <=> A217657(n) in A000040 (prime).
a(n) = a(n-4) + 10 for 4 < n < 41, i.e., 20 < a(n) < 110; a(n) = a(n-25) for 61 < n < 287, i.e., 200 < a(n) < 1100, etc. (End)

A202266 Composite numbers in which all substrings and reversal substrings are composites.

Original entry on oeis.org

4, 6, 8, 9, 44, 46, 48, 49, 64, 66, 68, 69, 84, 86, 88, 94, 96, 99, 444, 446, 448, 464, 466, 468, 469, 484, 486, 488, 494, 496, 644, 646, 648, 649, 664, 666, 668, 669, 684, 686, 688, 694, 696, 699, 844, 846, 848, 849, 864, 866, 868, 869, 884, 886, 888, 946, 948
Offset: 1

Views

Author

Jaroslav Krizek, Dec 25 2011

Keywords

Comments

Subsequence of A202265, A202262.

Examples

			All substrings and reversal substrings of 446 are composites: 4, 6, 44, 46, 64, 446, 644.
		

Crossrefs

Cf. A202263 (primes in which all substrings and reversal substrings are primes), A202264 (noncomposite numbers in which all substrings and reversal substrings are noncomposite), A202265 (nonprimes in which all substrings and reversal substrings are nonprimes).

A225619 Composite numbers that remain composite if any digit is deleted (zero and one are not considered prime).

Original entry on oeis.org

44, 46, 48, 49, 64, 66, 68, 69, 84, 86, 88, 94, 96, 98, 99, 104, 106, 108, 120, 122, 124, 125, 126, 128, 140, 142, 144, 145, 146, 148, 150, 152, 154, 155, 156, 158, 160, 162, 164, 165, 166, 168, 180, 182, 184, 185, 186, 188, 204, 206, 208, 210, 212, 214, 215
Offset: 1

Views

Author

Derek Orr, Aug 04 2013

Keywords

Comments

These are sometimes called "deletable composites".

Examples

			142 is composite. If the 1 is deleted, 42 is composite. If the 4 is deleted, 12 is composite. If the 2 is deleted, 14 is composite. Therefore, 142 is included in this sequence.
		

Crossrefs

Cf. A202262 (composite numbers in which all substrings are composite).

Programs

  • Mathematica
    prime01Q[n_] := n == 0 || n == 1 || PrimeQ[n]; okQ[n_] := Module[{d = IntegerDigits[n]}, Not[Or @@ prime01Q /@ Table[FromDigits[Delete[d, i]], {i, Length[d]}]]]; Select[Range[215], ! PrimeQ[#] && okQ[#] &] (* T. D. Noe, Aug 14 2013 *)

A330597 Squarefree numbers in which all substrings are squarefree.

Original entry on oeis.org

1, 2, 3, 5, 6, 7, 11, 13, 15, 17, 21, 22, 23, 26, 31, 33, 35, 37, 51, 53, 55, 57, 61, 62, 65, 66, 67, 71, 73, 77, 111, 113, 115, 131, 133, 137, 151, 155, 157, 173, 177, 211, 213, 215, 217, 221, 222, 223, 226, 231, 233, 235, 237, 262, 265, 266, 267, 311, 313
Offset: 1

Views

Author

Rémy Sigrist, Dec 19 2019

Keywords

Comments

This sequence is finite, the last term being a(1690) = 77377717.

Examples

			1, 3, 7, 13, 37 and 137 are all squarefree, hence 137 is a term.
		

Crossrefs

Cf. A005117, A085823 (prime variant), A202262 (composite variant).

Programs

  • Mathematica
    sfQ[k_]:=With[{i=IntegerDigits[k]},AllTrue[Flatten[Table[ FromDigits/@ Partition[ i,n,1],{n,IntegerLength[k]}]],SquareFreeQ]]; Select[ Range[ 350],sfQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 09 2020 *)
  • PARI
    See Links section.

A366826 Composite numbers whose proper substrings (of their decimal expansions) are all primes.

Original entry on oeis.org

4, 6, 8, 9, 22, 25, 27, 32, 33, 35, 52, 55, 57, 72, 75, 77, 237, 537, 737
Offset: 1

Views

Author

Kalle Siukola, Oct 25 2023

Keywords

Comments

There are no terms greater than 999 because the only three-digit prime whose substrings are all primes is 373 (see A085823) and prepending or appending any prime digit to it would create a different three-digit substring.

Examples

			237 is included because it is composite and 2, 3, 7, 23 and 37 are all primes.
4 is included because it is composite and has no proper substrings.
		

Crossrefs

Subsequence of A002808.
Cf. A000040.

Programs

  • Python
    from itertools import combinations
    from sympy import isprime
    for n in range(2, 1000):
        if not isprime(n):
            properSubstrings = set(
                int(str(n)[start:end]) for (start, end)
                in combinations(range(len(str(n)) + 1), 2)
            ) - set((n,))
            if all(isprime(s) for s in properSubstrings):
                print(n, end=', ')
Showing 1-8 of 8 results.