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.

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