%I #19 Aug 06 2015 04:17:24
%S 10000103,10000121,10000223,10000303,10000511,10000609,10000721,
%T 10000723,10000813,10000819,10000831,10001009,10001107,10001119,
%U 10001203,10001207,10001209,10001213,10001221,10001227,10001231,10010101,10010113,10010213,10010227,10010311,10010317,10010323,10010401
%N Prime number days: prime numbers that can be interpreted as an ISO date.
%C An ISO date is in the format YYYY-MM-DD.
%C The last term of this sequence is 99991207.
%H Christian Perfect, <a href="/A260915/b260915.txt">Table of n, a(n) for n = 1..24974</a>
%H <a href="http://www.mei.org.uk/month_item">MEI Maths item of the month</a>.
%H <a href="http://www.iso.org/iso/home/standards/iso8601.htm">Date and time format - ISO 8601</a>.
%e 20150821 belongs to this sequence because it is prime and represents the 21st of August 2015.
%t d = Sort@ Join[Flatten[Plus[{100, 300, 500, 700, 800, 1000, 1200}, #] & /@ Select[Range[1, 31, 2], ! Mod[#, 5] == 0 &]], Flatten[Plus[{200, 400, 600, 900, 1100}, #] & /@ Select[Range[1, 29, 2], ! Mod[#, 5] == 0 &]]]; Select[Flatten[Plus[If[Or[Mod[#, 10000000] == 0, Mod[#, 40000] == 0 && ! Mod[#, 1000000] == 0], d, Delete[d, 25]], #] & /@ (10000 Range[1000, 1001])], PrimeQ] (* _Michael De Vlieger_, Aug 04 2015 *)
%o (Python)
%o import datetime
%o .
%o def prime_number_days():
%o ...j = 0
%o ...date = datetime.date(1000,1,1)
%o ...while date.year<2100:
%o ......x = int(date.strftime("%Y%m%d"))
%o ......while primes[j]<x:
%o .........j += 1
%o ......if primes[j]==x:
%o .........yield x
%o ......date += datetime.timedelta(days=1)
%Y Cf. A000040 (prime numbers).
%K nonn,easy,fini,base
%O 1,1
%A _Christian Perfect_, Aug 04 2015
|