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

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

A197652 Numbers that are congruent to 0 or 1 mod 10.

Original entry on oeis.org

0, 1, 10, 11, 20, 21, 30, 31, 40, 41, 50, 51, 60, 61, 70, 71, 80, 81, 90, 91, 100, 101, 110, 111, 120, 121, 130, 131, 140, 141, 150, 151, 160, 161, 170, 171, 180, 181, 190, 191, 200, 201, 210, 211, 220, 221, 230, 231, 240, 241, 250, 251, 260, 261, 270, 271
Offset: 1

Views

Author

Philippe Deléham, Oct 16 2011

Keywords

Comments

From Wesley Ivan Hurt, Sep 26 2015: (Start)
Numbers with last digit 0 or 1.
Complement of (A260181 Union A262389). (End)
Numbers k such that floor(k/2) = 5*floor(k/10). - Bruno Berselli, Oct 05 2017

Crossrefs

Programs

Formula

a(n) = Sum_{k>=0} A030308(n,k)*b(k) with b(0)=1 and b(k) = 5*2^k = A020714(k) for k>0.
From Zak Seidov, Oct 20 2011: (Start)
a(n) = a(n-2) + 10.
a(n) = 5*n - 7 - 2*(-1)^n. (End)
From Vincenzo Librandi, Jul 11 2012: (Start)
G.f.: x^2*(1+9*x)/((1+x)*(1-x)^2).
a(n) = a(n-1) + a(n-2) - a(n-3) for n>3. (End)
E.g.f.: 9 + (5*x - 7)*exp(x) - 2*exp(-x). - David Lovler, Sep 03 2022

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)

A262389 Numbers whose last digit is composite.

Original entry on oeis.org

4, 6, 8, 9, 14, 16, 18, 19, 24, 26, 28, 29, 34, 36, 38, 39, 44, 46, 48, 49, 54, 56, 58, 59, 64, 66, 68, 69, 74, 76, 78, 79, 84, 86, 88, 89, 94, 96, 98, 99, 104, 106, 108, 109, 114, 116, 118, 119, 124, 126, 128, 129, 134, 136, 138, 139, 144, 146, 148, 149
Offset: 1

Views

Author

Wesley Ivan Hurt, Sep 21 2015

Keywords

Comments

Numbers ending in 4, 6, 8 or 9.
Union of A017317, A017341, A017365 and A017377.
Subsequence of A118951 (numbers containing at least one composite digit).
Complement of (A197652 Union A260181).

Crossrefs

Cf. A118951, A197652, A260181 (last digit is prime).

Programs

  • Magma
    [(5*n+1-(-1)^n+(3+(-1)^n)*(-1)^((2*n-3-(-1)^n) div 4) div 2) div 2: n in [1..70]]; // Vincenzo Librandi, Sep 21 2015
  • Maple
    A262389:=n->(5*n+1-(-1)^n+(3+(-1)^n)*(-1)^((2*n-3-(-1)^n)/4)/2)/2: seq(A262389(n), n=1..100);
  • Mathematica
    Table[(5n+1-(-1)^n+(3+(-1)^n)*(-1)^((2n-3-(-1)^n)/4)/2)/2, {n, 100}]
    LinearRecurrence[{1, 0, 0, 1, -1}, {4, 6, 8, 9, 14}, 80] (* Vincenzo Librandi, Sep 21 2015 *)
    CoefficientList[Series[(4 + 2*x + 2*x^2 + x^3 + x^4)/((x - 1)^2*(1 + x + x^2 + x^3)), {x, 0, 80}], x] (* Wesley Ivan Hurt, Sep 21 2015 *)
    Select[Range[200],CompositeQ[Mod[#,10]]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 21 2019 *)

Formula

G.f.: x*(4+2*x+2*x^2+x^3+x^4)/((x-1)^2*(1+x+x^2+x^3)).
a(n) = a(n-1) + a(n-4) - a(n-5) for n>5.
a(n) = (5*n+1-(-1)^n+(3+(-1)^n)*(-1)^((2*n-3-(-1)^n)/4)/2)/2.
Sum_{n>=1} (-1)^(n+1)/a(n) = (sqrt(10-2*sqrt(5))*Pi - sqrt(5)*arccoth(3/sqrt(5)) - 4*log(2))/20. - Amiram Eldar, Jul 30 2024

Extensions

Name edited by Jon E. Schoenfield, Feb 15 2018
Showing 1-4 of 4 results.