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-10 of 45 results. Next

A014261 Numbers that contain odd digits only.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 31, 33, 35, 37, 39, 51, 53, 55, 57, 59, 71, 73, 75, 77, 79, 91, 93, 95, 97, 99, 111, 113, 115, 117, 119, 131, 133, 135, 137, 139, 151, 153, 155, 157, 159, 171, 173, 175, 177, 179, 191, 193, 195, 197, 199, 311, 313, 315, 317, 319
Offset: 1

Views

Author

Keywords

Comments

Or, numbers whose product of digits is odd.
Complement of A007928; A196563(a(n)) = 0. - Reinhard Zumkeller, Oct 04 2011
If n is represented as a zerofree base-5 number (see A084545) according to n = d(m)d(m-1)...d(3)d(2)d(1)d(0) then a(n) = Sum_{j = 0..m} c(d(j))*10^j, where c(k) = 1, 3, 5, 7, 9 for k = 1..5. - Hieronymus Fischer, Jun 06 2012

Examples

			a(10^3) = 13779.
a(10^4) = 397779.
a(10^5) = 11177779.
a(10^6) = 335777779.
		

Crossrefs

Subsequence of A059708 and of A225985. A066640 and A030096 are subsequences.

Programs

  • Haskell
    a014261 n = a014261_list !! (n-1)
    a014261_list = filter (all (`elem` "13579") . show) [1,3..]
    -- Reinhard Zumkeller, Jul 05 2011
    
  • Magma
    [ n : n in [1..129] | IsOdd(&*Intseq(n,10)) ];
    
  • Mathematica
    Select[Range[400], OddQ[Times@@IntegerDigits[#]] &] (* Alonso del Arte, Feb 21 2014 *)
  • PARI
    is(n)=Set(digits(n)%2)==[1] \\ Charles R Greathouse IV, Jul 06 2017
    
  • PARI
    a(n)={my(k=1); while(n>5^k, n-=5^k; k++); fromdigits([2*d+1 | d<-digits(5^k+n-1, 5)]) - 3*10^k} \\ Andrew Howroyd, Jan 17 2020
    
  • Python
    from itertools import islice, count
    def A014261(): return filter(lambda n: set(str(n)) <= {'1','3','5','7','9'}, count(1,2))
    A014261_list = list(islice(A014261(),20)) # Chai Wah Wu, Nov 22 2021
    
  • Python
    from itertools import count, islice, product
    def agen(): yield from (int("".join(p)) for d in count(1) for p in product("13579", repeat=d))
    print(list(islice(agen(), 60))) # Michael S. Branicky, Jan 13 2022

Formula

A121759(a(n)) = a(n); A000035(A007959(a(n))) = 1. - Reinhard Zumkeller, Nov 30 2007
From Reinhard Zumkeller, Aug 30 2009: (Start)
a(n+1) - a(n) = A164898(n). - Reinhard Zumkeller, Aug 30 2009
a(n+1) = h(a(n)) with h(x) = 1 + (if x mod 10 < 9 then x + x mod 2 else 10*h(floor(x/10)));
a(n) = f(n, 1) where f(n, x) = if n = 1 then x else f(n-1, h(x)). (End)
From Hieronymus Fischer, Jun 06 2012: (Start)
a(n) = Sum_{j = 0..m-1} ((2*b_j(n)+1) mod 10)*10^j, where b_j(n) = floor((4*n+1-5^m)/(4*5^j)), m = floor(log_5(4*n+1)).
a(1*(5^n-1)/4) = 1*(10^n-1)/9.
a(2*(5^n-1)/4) = 1*(10^n-1)/3.
a(3*(5^n-1)/4) = 5*(10^n-1)/9.
a(4*(5^n-1)/4) = 7*(10^n-1)/9.
a(5*(5^n-1)/4) = 10^n - 1.
a((5^n-1)/4 + 5^(n-1)-1) = (10^n-5)/5.
a(n) = (10^log_5(4*n+1)-1)/9 for n = (5^k-1)/4, k > 0.
a(n) < (10^log_5(4*n+1)-1)/9 for (5^k-1)/4 < n < (5^(k+1)-1)/4, k > 0.
a(n) <= 27/(9*2^log_5(9)-1)*(10^log_5(4*n+1)-1)/9 for n > 0, equality holds for n = 2.
a(n) > 0.776*10^log_5(4*n+1)-1)/9 for n > 0.
a(n) >= A001742(n), equality holds for n = (5^k-1)/4, k > 0.
a(n) = A084545(n) if and only if all digits of A084545(n) are 1, else a(n) > A084545(n).
G.f.: g(x)= (x^(1/4)*(1-x))^(-1) Sum_{j >= 0} 10^j*z(j)^(5/4)*(1-z(j))*(1 + 3*z(j) + 5*z(j)^2 + 7*z(j)^3 + 9*z(j)^4)/(1-z(j)^5), where z(j) = x^5^j.
Also: g(x) = (1/(1-x))*(h_(5,0)(x) + 2*h_(5,1)(x) + 2*h_(5,2)(x) + 2*h_(5,3)(x) + 2*h_(5,4)(x) - 9*h_(5,5)(x)), where h_(5,k)(x) = Sum_{j >= 0} 10^j*x^((5^(j+1)-1)/4)*(x^5^j)^k/(1-(x^5^j)^5). (End)
a(n) = A225985(A226091(n)). - Reinhard Zumkeller, May 26 2013
Sum_{n>=1} 1/a(n) = A194181. - Bernard Schott, Jan 13 2022

Extensions

More terms from Robert G. Wilson v, Oct 18 2002
Examples and crossrefs added by Hieronymus Fischer, Jun 06 2012

A020471 Primes that contain digits 7 and 9 only.

Original entry on oeis.org

7, 79, 97, 797, 977, 997, 77797, 77977, 77999, 79777, 79979, 79997, 79999, 97777, 777977, 777979, 779797, 797977, 799979, 799999, 999979, 7777997, 7779979, 7779997, 7797799, 7797997, 7799797, 7799999, 7977779, 7977797, 7977799, 7977997
Offset: 1

Views

Author

Keywords

Crossrefs

Subsequence of A030096.
Cf. A020449 (digits 0 & 1), ..., A020472 (digits 8 & 9).

Programs

  • Magma
    [p: p in PrimesUpTo(7977997) | Set(Intseq(p)) subset [7,9]]; // Vincenzo Librandi, Jul 28 2012
  • Mathematica
    Flatten[Table[Select[FromDigits/@Tuples[{7,9},n],PrimeQ],{n,7}]] (* Vincenzo Librandi, Jul 28 2012 *)

Extensions

Edited by M. F. Hasler, Jul 26 2015

A020457 Primes that contain digits 1 and 9 only.

Original entry on oeis.org

11, 19, 191, 199, 911, 919, 991, 1999, 9199, 11119, 19919, 19991, 91199, 99119, 99191, 99991, 111119, 111191, 111919, 119191, 191119, 191911, 191999, 199999, 911111, 919111, 991999, 999199, 1111991, 1191119, 1191191, 1191199, 1191991, 1199999
Offset: 1

Views

Author

Keywords

Crossrefs

Subsequence of A329761 and hence of A030096.

Programs

  • Magma
    [p: p in PrimesUpTo(1199999) | Set(Intseq(p)) subset [1, 9]]; // Vincenzo Librandi, Jul 27 2012
  • Mathematica
    Flatten[Table[Select[FromDigits/@Tuples[{1,9},n],PrimeQ],{n,7}]] (* Vincenzo Librandi, Jul 27 2012 *)

A020468 Primes that contain digits 5 and 9 only.

Original entry on oeis.org

5, 59, 599, 59999, 95959, 99559, 599959, 599999, 995959, 999599, 999959, 5595559, 5595599, 5599999, 5955959, 5995999, 5999599, 9555599, 9559999, 9595559, 9955559, 9995599, 55555559, 55559599, 55595599, 55599959, 55959559, 59999999, 95559559
Offset: 1

Views

Author

Keywords

Crossrefs

Subsequence of A030096.

Programs

  • Magma
    [p: p in PrimesUpTo(95559559 ) | Set(Intseq(p)) subset [5,9]]; // Vincenzo Librandi, Jul 27 2012
  • Mathematica
    Flatten[Table[Select[FromDigits/@Tuples[{5,9},n],PrimeQ],{n,8}]] (* Vincenzo Librandi, Jul 27 2012 *)

A068690 Primes such that all digits (except perhaps the least significant digit) are even.

Original entry on oeis.org

2, 3, 5, 7, 23, 29, 41, 43, 47, 61, 67, 83, 89, 223, 227, 229, 241, 263, 269, 281, 283, 401, 409, 421, 443, 449, 461, 463, 467, 487, 601, 607, 641, 643, 647, 661, 683, 809, 821, 823, 827, 829, 863, 881, 883, 887, 2003, 2027, 2029, 2063, 2069, 2081, 2083, 2087
Offset: 1

Views

Author

Amarnath Murthy and Joseph L. Pe, Mar 03 2002

Keywords

Comments

Essentially the same as A154764.

Examples

			2 is in the sequence even though the least significant digit of 2 is even instead of odd. - _David A. Corneth_, Sep 18 2019
		

Crossrefs

Programs

  • Haskell
    a068690 n = a068690_list !! (n-1)
    a068690_list = filter (all (`elem` "02468") . init . show) a000040_list
    -- Reinhard Zumkeller, Apr 28 2014
  • Mathematica
    (*returns true if all but the last digit of n is even, false o.w.*) f[n_] := Module[{a, l, i, r = True}, a = IntegerDigits[n]; l = Length[a]; For[i = 1, i < l, i++, If[Mod[a[[i]], 2] == 1, r = False; Break[ ]]]; r]; Select[Range[1, 4*10^3], PrimeQ[ # ] && f[ # ] &]
    m = 7; Prepend[Reap[Do[If[PrimeQ[fd = FromDigits[{a[1], a[2], a[3], a[4], a[5], a[6], a[m]}]], Sow[fd]], {a[1], 0, 8, 2}, {a[2], 0, 8, 2}, {a[3], 0, 8, 2}, {a[4], 0, 8, 2}, {a[5], 0, 8, 2}, {a[6], 0, 8, 2}, {a[m], 1, 9, 2}]][[2, 1]], 2] (* all terms < 10^8. Zak Seidov, Jan 29 2013 *)
    Select[ Prime@ Range[10000], ContainsAll[{0, 2, 4, 6, 8}, Most@ IntegerDigits[#]] &] (* From version 10. Mikk Heidemaa, Feb 08 2016 *)
    Select[Prime[Range[400]],AllTrue[Most[IntegerDigits[#]],EvenQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Sep 18 2019 *)

Extensions

Definition rephrased by N. J. A. Sloane, Dec 11 2007

A091633 Primes having only {1, 3, 7, 9} as digits.

Original entry on oeis.org

3, 7, 11, 13, 17, 19, 31, 37, 71, 73, 79, 97, 113, 131, 137, 139, 173, 179, 191, 193, 197, 199, 311, 313, 317, 331, 337, 373, 379, 397, 719, 733, 739, 773, 797, 911, 919, 937, 971, 977, 991, 997, 1117, 1171, 1193, 1319, 1373, 1399, 1733, 1777, 1913, 1931, 1933
Offset: 1

Views

Author

Enoch Haga, Jan 26 2004

Keywords

Comments

Some primes of sufficient length might be termed DNA primes if the sequence of digits 1,3,7,9 in any order happens to be an appropriate analog of the DNA bases A, G, C, T. It would be interesting to know if it is possible for any DNA sequence to match a DNA prime.

Crossrefs

Subsequence of A136333, A245193, and A030096.
A091871 gives prime index.
Cf. A010051.

Programs

  • Haskell
    a091633 n = a091633_list !! (n-1)
    a091633_list = filter ((== 1) . a010051') a136333_list
    -- Reinhard Zumkeller, Jul 17 2014
  • Mathematica
    Select[Flatten[Table[FromDigits/@Tuples[{1,3,7,9},n],{n,4}]],PrimeQ] (* Harvey P. Dale, Jun 26 2015 *)

Formula

Select primes having digits 1, 3, 7, 9 only.
a(n) = A000040(A091871(n)). - R. J. Mathar, Aug 29 2018

A020455 Primes that contain digits 1 and 7 only.

Original entry on oeis.org

7, 11, 17, 71, 1117, 1171, 1777, 7177, 7717, 11117, 11171, 11177, 11717, 11777, 17117, 71171, 71711, 71777, 77171, 77711, 1111711, 1111771, 1117111, 1117117, 1117177, 1171111, 1171117, 1171771, 1177171, 1177711, 1177717, 1711117, 1717117, 1771177, 1771717
Offset: 1

Views

Author

Keywords

Comments

There are no terms whose number of digits is divisible by 3: for every d that is a multiple of 3, every d-digit number j consisting of no digits other than 1's and 7's will have a digit sum divisible by 3, so j will also be divisible by 3. - Mikk Heidemaa, Mar 26 2021

Crossrefs

Subsequence of A030096.

Programs

  • Magma
    [p: p in PrimesUpTo(1771177) | Set(Intseq(p)) subset [1, 7]]; // Vincenzo Librandi, Jul 27 2012
    
  • Mathematica
    Flatten[Table[Select[FromDigits/@Tuples[{1,7},n],PrimeQ],{n,7}]] (* Vincenzo Librandi, Jul 27 2012 *)
  • Python
    from sympy import isprime
    def only17(n): return int(bin(n+1)[3:].replace('1', '7').replace('0', '1'))
    def auptod(digs):
      return list(filter(isprime, (only17(i) for i in range(1, 2**(digs+1)-1))))
    print(auptod(8)) # Michael S. Branicky, Jul 11 2021

Formula

{ A000040 } intersect { A276039 }.

A020463 Primes that contain digits 3 and 7 only.

Original entry on oeis.org

3, 7, 37, 73, 337, 373, 733, 773, 3373, 3733, 7333, 33377, 33773, 37337, 77377, 77773, 333337, 333737, 373777, 377737, 733333, 733373, 737773, 773777, 777373, 777737, 3333373, 3333773, 3337333, 3337777, 3377377, 3733333, 3773377, 3773773, 3777377, 7337333, 7337777, 7377373, 7733377, 7737337
Offset: 1

Views

Author

Keywords

Crossrefs

Subsequence of A030096.

Programs

  • Mathematica
    Flatten[Table[Select[FromDigits/@Tuples[{3,7},n],PrimeQ],{n,7}]] (* Vincenzo Librandi, Jul 27 2012 *)

A020451 Primes that contain digits 1 and 3 only.

Original entry on oeis.org

3, 11, 13, 31, 113, 131, 311, 313, 331, 3313, 3331, 11113, 11131, 11311, 13313, 13331, 31333, 33113, 33311, 33331, 113111, 113131, 131111, 131113, 131311, 311111, 313133, 313331, 313333, 331333, 333131, 333331, 1111333, 1131113, 1131131, 1131133, 1131331
Offset: 1

Views

Author

Keywords

Crossrefs

Subsequence of A030096, A045429, and A032917.

Programs

  • Magma
    [p: p in PrimesUpTo(1131331) | Set(Intseq(p)) subset [1,3]]; // Bruno Berselli, Jul 27 2012
    
  • Maple
    N:= 8: # to get all a(n) with at most N digits
    S:= {}:
    for d from 1 to N do
      r:= (10^d-1)/9;
      S:= S union select(isprime,map(`+`,map(convert,combinat[powerset]
          ({seq(2*10^i,i=0..d-1)}),`+`),r));
    od:
    S; # if using Maple 11 or earlier, uncomment the next line
    # sort(convert(S,list)); # Robert Israel, May 04 2015
  • Mathematica
    Flatten[Table[Select[FromDigits/@Tuples[{1,3},n],PrimeQ],{n,7}]] (* Vincenzo Librandi, Jul 27 2012 *)
  • Python
    from sympy import primerange
    def checkd(a, c):
        b =  set(int(i) for i in set(str(a)))
        return b.issubset(c)
    for n in primerange(2, 2000000):
        if checkd(n, [1, 3]):
            print(n)
    # Abhiram R Devesh, May 04 2015

A020453 Primes that contain digits 1 and 5 only.

Original entry on oeis.org

5, 11, 151, 1151, 1511, 11551, 15511, 15551, 51151, 51511, 51551, 55511, 115151, 511111, 511151, 515111, 1111151, 1115551, 1155151, 1551551, 1555111, 5115511, 5151151, 5151551, 5155511, 5511151, 5511511, 5515151, 5551111, 15511151
Offset: 1

Views

Author

Keywords

Comments

The first 8 terms are also primes when read backward, i.e. in A007500. See also A199325. - M. F. Hasler, Nov 05 2011

Crossrefs

Subsequence of A030096.

Programs

  • Mathematica
    Flatten[Table[Select[FromDigits/@Tuples[{1,5},n],PrimeQ],{n,7}]] (* Vincenzo Librandi, Jul 27 2012 *)
  • PARI
    {L=[1,5];for(d=1,9,u=vector(d,i,10^(d-i))~;forvec(v=vector(d,i,[1,#L]),ispseudoprime(t=vector(d,i,L[v[i]])*u)&print1(t",")))}  \\ M. F. Hasler, Nov 05 2011
Showing 1-10 of 45 results. Next