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 11-14 of 14 results.

A167292 Primes containing 999 as a substring.

Original entry on oeis.org

1999, 2999, 4999, 8999, 13999, 19991, 19993, 19997, 25999, 32999, 35999, 41999, 49991, 49993, 49999, 52999, 56999, 59999, 69991, 69997, 70999, 71999, 73999, 77999, 79997, 79999, 85999, 94999, 98999, 99901, 99907, 99923, 99929, 99961
Offset: 1

Views

Author

Vincenzo Librandi, Nov 01 2009

Keywords

Crossrefs

Programs

  • Mathematica
    p999Q[n_] := Module[{idn=IntegerDigits[n]}, MemberQ[Partition[idn, 3, 1], {9, 9, 9}]]; Select[Prime[Range[10000]], p999Q] (* Vincenzo Librandi, Sep 15 2013 *)

A076805 Triskaidekaphobic or 13-free primes: primes that do not contain the number 13.

Original entry on oeis.org

2, 3, 5, 7, 11, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 127, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307
Offset: 1

Views

Author

Cino Hilliard, Nov 18 2002

Keywords

Examples

			The PARI program will mask out a sequence containing k or mask in a sequence containing k. The program is limited to primes < 400000000.
The PARI program will generate the following for input as shown: kprimes(2,100,7,0) = 2 3 5 11 13 19 23 29 31 41 43 53 59 61 83 89; kprimes(2,1000,13,1) = 13 113 131 137 139 313 613; kprimes(300000,4000000,314159,1) = 314159 3314159 5314159
		

Crossrefs

A generalization of the examples A038603, A038615 etc. for k = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 by Vasiliy Danilov.
Complement of A166573 with respect to A000040; cf. A011760

Programs

  • Haskell
    import Data.List (isInfixOf)
    a076805 n = a076805_list !! (n-1)
    a076805_list = filter (not . ("13" `isInfixOf`) . show) a000040_list
    -- Reinhard Zumkeller, Nov 09 2011
    
  • Mathematica
    Select[Prime[Range[90]],!MemberQ[Partition[IntegerDigits[#],2,1],{1,3}]&] (* Harvey P. Dale, Mar 25 2012 *)
    Select[Prime[Range[100]],SequenceCount[IntegerDigits[#],{1,3}]==0&] (* Harvey P. Dale, Aug 11 2023 *)
  • PARI
    /* k primes - kprimes.gp. Primes containing or not containing digit k=1,2,3...9,10,11... PARI does not have a good string manipulation capability. This program circumvents that by using the % modulo and floor operators. Also commented out is a log implementation which is slower than string apps. The program either masks out prime numbers k or masks them in.*/
    
  • PARI
    log10(z) = if(z>0,floor(log(z)/log(10))+1,1);\\integer function for log(z) base 10 + 1
    { kprimes(n1,n2,k,t) = \\n1,n2=range,k=mask,t=0 mask out t=1 mask in
    ct=0; pct=0; forprime(p=n1,n2,x=p; f=0;\\x=temp variable to diminish p
    ln = length(Str(p));\\get length of the prime p using strings
    lk = length(Str(k));\\get length of mask integer k using strings
    ln = log10(p);\\get length of the prime p using logs
    lk = log10(k);\\get length of mask integer k using strings
    r = 10^lk; \\set the remainder length = length of k
    for(j=1,ln-lk+1, \\permute through the digits
    d = x % r;\\get lk digits
    if(d==k,f=1; break);\\break for loop if match and set flag
    x = floor(x/10);\\diminish x for next test for k
    ); if(f==t,print1(p" "); ct+=1);\\if no k string of digits,print
    ); print(); print(ct); }
    
  • PARI
    hasNo13(n)=n=digits(n); for(i=2,#n, if(n[i]==3&&n[i-1]==1, return(0))); 1
    select(hasNo13, primes(10^4)) \\ Charles R Greathouse IV, Dec 02 2013
    
  • PARI
    is_A076805(n,t=13)=!until(t>n\=10,t==n%100&&return) \\ M. F. Hasler, Dec 02 2013

Formula

a(n) >> n^1.0044, where the exponent is log(r)/log(10) with r the larger root of x^2 - 10x + 1. [Charles R Greathouse IV, Nov 09 2011]
kfreep(n, k) = true if for primes p over the range n and integer k, p mod 10^(floor(log_10(k))+1) <> k for p = p/10 mod 10^(floor(log_10(k))+1) <> k over the range floor(log_10(k))+1. This is a mathematical definition of the recurrence. In practice it is convenient to use string operations. E.g., If Not Instr(Str(p), Str(k)) then true or k is not a substring of p so list p.

Extensions

Original PARI code restored by M. F. Hasler, Dec 02 2013

A175017 Primes p containing the string "13" and sum of digits sod(p) = 13.

Original entry on oeis.org

139, 1327, 1381, 2137, 2713, 3613, 4513, 5413, 6133, 7213, 9013, 11317, 11353, 12613, 13009, 13063, 13171, 13441, 13513, 13711, 15313, 18013, 21613, 24133, 26113, 31333, 31513, 32413, 34213, 36013, 41341, 41413, 44131, 45013, 51133, 53113, 54013
Offset: 1

Views

Author

Eva-Maria Zschorn (e-m.zschorn(AT)zaschendorf.km3.de), Apr 04 2010

Keywords

Comments

p = prime(k) of form (I) 13//r, (II) s//13 or (III) t//13//u with sod(r) = sod(s) = sod(t) + sod(u) = 9.

Examples

			1327 = prime(217), sod(1327) = 1+3+2+7 = 13, first term of sequence;
7213 = prime(922), sod(922) = 13, 9th term of sequence (the 55th so-called Honaker prime);
smallest such containing two "13"-strings: 13513 = prime(1601);
smallest such containing the maximal number of three "13"-strings: 13013131 = prime(850054);
smallest such palindromic prime: 31513 = palprime(53) = prime(3391), 2nd: 113030311 = palprime(986) = prime(6466683).
		

Crossrefs

Programs

  • Mathematica
    p13Q[n_]:=Module[{idn=IntegerDigits[n]},Total[idn]==13&&MemberQ[Partition[idn,2,1],{1,3}]]
    Select[Prime[Range[6000]],p13Q]  (* Harvey P. Dale, Feb 03 2011 *)
  • Python
    from sympy import nextprime
    A175017_list, p = [],2
    while len(A175017_list) <= 100:
        s = str(p)
        if '13' in s and sum(int(d) for d in s) == 13:
            A175017_list.append(p)
        p = nextprime(p) # Chai Wah Wu, Mar 05 2020

Extensions

Corrected and extended by Harvey P. Dale, Feb 03 2011

A169645 Primes p = prime(k) of form 13//r, s//13 or t//13//u and sod(p) = sod(k).

Original entry on oeis.org

131, 1301, 1361, 1913, 3137, 7013, 7213, 11353, 12613, 13007, 13037, 13127, 13217, 13297, 13327, 13339, 13367, 13417, 13457, 13933, 15913, 18013, 22613, 29131, 31391, 41131, 41333, 51131, 54013, 57139, 57713, 63313, 64513, 65713, 68813, 70139, 71353, 74713
Offset: 1

Views

Author

Eva-Maria Zschorn (e-m.zschorn(AT)zaschendorf.km3.de), Apr 05 2010

Keywords

Comments

Sum of digits of p = prime(k), p containing the string "13", equals sum of digits of the prime index k
A subsequence of A033548
Still no (published) proof if sequence is infinite

Examples

			13//1 = 131 = prime(32), r = 1, sod(k) = 5
19//13 = 1913 = prime(293), s = 19, sod(k) = 14
3//13//7 = 3137 = prime(446), t = 3, u = 7, sod(k) = 14
		

Crossrefs

Programs

  • Mathematica
    sodQ[{a_,b_}]:=SequenceCount[IntegerDigits[b],{1,3}]>0&&Total[ IntegerDigits[ a]] ==Total[IntegerDigits[b]]; Select[Table[ {n, Prime[n]},{n,7000}],sodQ][[All,2]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, May 10 2018 *)

Extensions

Corrected and extended by Harvey P. Dale, May 10 2018
Previous Showing 11-14 of 14 results.