login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Irregular triangle, read by rows, of primes with prefix n and digits "7" appended, otherwise 0.
7

%I #13 Mar 30 2012 18:35:54

%S 17,0,37,47,0,67,677,0,0,97,977,107,0,127,1277,137,0,157,167,0,0,197,

%T 0,0,227,0,0,257,0,277,2777,0,0,307,317,0,337,347,0,367,3677,0,0,397,

%U 0,0,0,0,0,457,467,0,487,4877,0,0,0,0,0,547,5477,557,0,577,587,0,607,617,0,0

%N Irregular triangle, read by rows, of primes with prefix n and digits "7" appended, otherwise 0.

%C Row n ends when a composite number is found.

%e for k=1..2 , a(12,k) = {127, 1277} are in the sequence.

%p with(numtheory): for n from 1 to 100 do:a0:=n:id:=0:c:=0:for k from 1 to 20

%p while (id=0) do:a1:=a0*10+7:if type(a1,prime)=true then a0:=a1:printf(`%d, `,a0):c:=c+1:else

%p id:=1:fi:od:if c=0 then printf(`%d, `,0):else fi:od:

%t Reap[Do[cnt = 0; d = IntegerDigits[n]; While[p = FromDigits[AppendTo[d, 7]]; PrimeQ[p], cnt++; Sow[p]]; If[cnt == 0, Sow[0]], {n, 61}]][[2, 1]]

%Y Cf. A185682, A185684.

%K nonn,base,less,tabf

%O 1,1

%A _Michel Lagneau_, Feb 10 2011