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

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

A254750 Numbers such that, in base 10, all their proper prefixes and suffixes represent composites.

Original entry on oeis.org

44, 46, 48, 49, 64, 66, 68, 69, 84, 86, 88, 89, 94, 96, 98, 99, 404, 406, 408, 409, 424, 426, 428, 444, 446, 448, 449, 454, 456, 458, 464, 466, 468, 469, 484, 486, 488, 494, 496, 498, 499, 604, 606, 608, 609, 624, 626, 628, 634, 636, 638
Offset: 1

Views

Author

Stanislav Sykora, Feb 15 2015

Keywords

Comments

A proper prefix (or suffix) of a number m is one which is neither void, nor identical to m.
Alternative definition: Slicing the decimal expansion of a(n) in any way into two nonempty parts, each part represents a composite number.
The list is infinite because any string of two or more digits selected from {4,6,8} represents a member.
Each member a(n) starts, as well as ends, with one of the digits {4,6,8,9}.
Every proper prefix of each member a(n) is a member of A202260, and every proper suffix is a member of A254755.
The sequence is a union of A254752 and A254754.

Examples

			6 is not a member because its expansion cannot be sliced in two.
638 is a member because (6, 38, 63, and 8) are all composites.
		

Crossrefs

Programs

  • PARI
    isComposite(n) = (n>2)&&(!isprime(n));
    slicesIntoComposites(n,b=10) = {my(k=b);if(n0,if(!isComposite(n\k)||!isComposite(n%k),return(0););k*=b);return(1);}

A254751 Numbers such that, in base 10, all their proper prefixes and suffixes represent primes.

Original entry on oeis.org

22, 23, 25, 27, 32, 33, 35, 37, 52, 53, 55, 57, 72, 73, 75, 77, 237, 297, 313, 317, 373, 537, 597, 713, 717, 737, 797, 2337, 2397, 2937, 3113, 3137, 3173, 3797, 5937, 5997, 7197, 7337, 7397, 29397, 31373, 37937, 59397, 73313, 739397
Offset: 1

Views

Author

Stanislav Sykora, Feb 15 2015

Keywords

Comments

A proper prefix (or suffix) of a number m is one which is neither void, nor identical to m.
Alternative definition: Slicing the decimal expansion of a(n) in any way into two nonempty parts, each part represents a prime number.
Every proper prefix of each member a(n) is a member of A024770, and every proper suffix is a member of A024785. Since these are finite sequences, a(n) is also finite. It has 45 members, the largest of which is 739397 and happens to be a prime.
The sequence is a union of A254753 and A020994.
A subsequence of A260181. - M. F. Hasler, Sep 16 2016

Examples

			6 is not a member because its expansion cannot be sliced in two.
597 is a member because (5,97,59, and 7) are all primes.
2331 is excluded because 233 is prime, but 1 is not. - _Gordon Hamilton_, Feb 20 2015
		

Crossrefs

Programs

  • Mathematica
    fQ[n_] := (p = {2, 3, 5, 7}; If[ Union@ Join[p, {Mod[n, 10]}] != p, {False}, Block[{idn = IntegerDigits@ n, lng = Floor@ Log10@ n}, Union@ PrimeQ@ Flatten@ Table[{FromDigits[ Take[idn, i]], FromDigits[ Take[idn, -lng + i - 1]]}, {i, lng}] == {True}]]); Select[ Range@1000000, fQ] (* Robert G. Wilson v, Feb 21 2015 *)
    Select[Range[10,750000],AllTrue[Flatten[Table[FromDigits/@TakeDrop[IntegerDigits[#],n],{n,IntegerLength[#]-1}]],PrimeQ]&] (* Harvey P. Dale, Feb 13 2024 *)
  • PARI
    slicesIntoPrimes(n,b=10) = {my(k=b);if(n0,if(!isprime(n\k)||!isprime(n%k),return(0););k*=b;);return(1);}
    
  • Sage
    def breakIntoPrimes(n):
        D=n.digits()
        for i in [1..len(D)-1]:
            if not(is_prime(sum(D[i:][j]*10^j for j in range(len(D[i:])))) and is_prime(sum(D[:i][j]*10^j for j in range(len(D[:i]))))):
                return False
            else:
                continue
        return True
    [n for n in [10..1000] if breakIntoPrimes(n)] # Tom Edgar, Feb 20 2015

A254753 Composite numbers with only prime proper prefixes and suffixes in base 10.

Original entry on oeis.org

22, 25, 27, 32, 33, 35, 52, 55, 57, 72, 75, 77, 237, 297, 537, 597, 713, 717, 737, 2337, 2397, 2937, 3113, 3173, 5937, 5997, 7197, 7337, 7397, 29397, 31373, 37937, 59397, 73313
Offset: 1

Views

Author

Stanislav Sykora, Feb 15 2015

Keywords

Comments

A proper prefix (or suffix) of a number m is one which is neither void, nor identical to m.
Alternative definition: Slicing the decimal expansion of a composite a(n) in any way into two nonempty parts, each part represents a prime number.
This sequence is a subset of A254751. Every proper prefix of each member a(n) is a member of A024770, and every proper suffix is a member of A024785. Since the latter are finite sequences, a(n) is also a finite sequence. It has 34 members, the largest of which is the composite number 73313.
Should one change the definition to 'prime numbers such that, in base 10, all their proper prefixes and suffixes represent primes', the result would be the sequence A020994.

Examples

			6 is not a member because its expansion cannot be sliced in two.
The composite 73313 is a member because (7, 3313, 73, 313, 733, 13, 7331, 3) are all primes.
		

Crossrefs

Programs

  • Mathematica
    apQ[n_]:=Module[{idn=IntegerDigits[n],c1,c2},c1=FromDigits/@ Table[ Take[ idn,k],{k,Length[idn]-1}];c2=FromDigits/@Table[Take[idn,k],{k,-(Length[ idn]-1), -1}]; AllTrue[ Join[c1,c2],PrimeQ]]; Select[Range[ 10,80000], CompositeQ[#] && apQ[#]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Nov 29 2018 *)
  • PARI
    isComposite(n) = (n>2)&&(!isprime(n));
    slicesIntoPrimes(n,b=10) = {my(k=b);if(n0,if(!isprime(n\k)||!isprime(n%k),return(0););k*=b;);1;}
    isCompositeSlicingIntoPrimes(n,b=10) = isComposite(n) && slicesIntoPrimes(n,b);

A254754 Prime numbers such that, in base 10, all their proper prefixes and suffixes represent composites.

Original entry on oeis.org

89, 409, 449, 499, 809, 4049, 4549, 4649, 4909, 4969, 6299, 6469, 6869, 6899, 6949, 8009, 8039, 8069, 8209, 8609, 8669, 8699, 8849, 9049, 9209, 9649, 9949, 40009, 40099, 40609, 40639, 40699, 40849, 42209, 42649, 44249, 44699, 45949, 46049, 46099
Offset: 1

Views

Author

Stanislav Sykora, Feb 15 2015

Keywords

Comments

A proper prefix (or suffix) of a number m is one which is neither void, nor identical to m.
Alternative definition: Slice the decimal expansion of the prime number a(n) in any way into two nonempty parts; then both parts represent a composite number.
This sequence is a subset of A254750. Each member a(n) must start with one of the digits {4,6,8,9} and end with 9.
Every proper prefix of each member a(n) is a member of A202260, and every proper suffix is a member of A254755.
These numbers are rare and tend to become rarer with increasing n, but the sequence does not seem to terminate (for example, 4*10^28 + 9 is a member).

Examples

			7 is not a member because its expansion cannot be sliced in two.
The prime 4969 is a member because it is a prime and the slices (4, 969, 49, 69, 496, and 9) are all composites.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[5,5000]],AllTrue[Flatten[Table[FromDigits/@TakeDrop[IntegerDigits[#],n],{n,IntegerLength[ #]-1}]],CompositeQ]&] (* Harvey P. Dale, Sep 22 2024 *)
  • PARI
    isComposite(n) = (n>2)&&(!isprime(n));
    slicesIntoComposites(n,b=10) = {my(k=b);if(n0,if(!isComposite(n\k)||!isComposite(n%k),return(0););k*=b);return(1);}
    isPrimeSlicingIntoComposites(n,b=10) = isprime(n) && slicesIntoComposites(n,b);
Showing 1-5 of 5 results.