login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A231979 Numbers n such that for every digit d in n, 2*n + 6*d - 3 is prime. 1
1, 2, 4, 5, 7, 8, 10, 13, 17, 19, 22, 29, 32, 34, 37, 43, 44, 50, 52, 55, 65, 67, 70, 77, 83, 89, 112, 113, 115, 118, 124, 127, 133, 145, 152, 155, 167, 172, 182, 188, 199, 200, 215, 229, 274, 277, 295, 302, 308, 322, 362, 379, 400, 418, 433, 488, 494, 499 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

The coefficients 2,6,-3 yield more hits between 1 and 1000000 than 2,2,1 or 1,1,1.

LINKS

T. D. Noe, Table of n, a(n) for n = 1..2000

EXAMPLE

124 is in the sequence since

  2*124+6*1-3=251 which is prime,

  2*124+6*2-3=257 which is prime,

  2*124+6*4-3=269 which is prime.

241 is NOT in the sequence since

  2*241+6*2-3=491 which is prime,

  2*241+6*4-3=503 which is prime,

  but 2*241+6*1-3=485 which is not prime.

MATHEMATICA

fQ[n_] := Module[{d = IntegerDigits[n]}, And @@ PrimeQ[2*n + 6*d - 3]]; Select[Range[1000], fQ] (* T. D. Noe, Nov 19 2013 *)

PROG

(Java)

public class Ndp {

// 2n+6d-3 is prime for all digits d in n

private static final int MAX = 1000000;

public static void main(String[] args) {

  String sequence = "";

  loop: for (int n = 1; sequence.length() < 250 && n < MAX; n++) {

   for (int i = n; i > 0; i /= 10) {

    int d = i % 10;

    if (!isPrime(2 * n + 6 * d - 3)) {

     continue loop;

    }

   }

   sequence += n + ", ";

  }

  System.out.println(sequence);

}

private static boolean isPrime(long n) {

  for (long i = 2; i <= Math.sqrt(n); i++) {

   if (n < 2 || n % i == 0) {

    return false;

   }

  }

  return true;

}

}

CROSSREFS

Sequence in context: A060686 A004214 A258376 * A072013 A326669 A123064

Adjacent sequences:  A231976 A231977 A231978 * A231980 A231981 A231982

KEYWORD

nonn,easy,base

AUTHOR

John R Phelan, Nov 16 2013

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 23 04:15 EDT 2021. Contains 345395 sequences. (Running on oeis4.)