[seqfan] Re: Sum of two consecutive digits is a prime
Maximilian Hasler
maximilian.hasler at gmail.com
Mon Mar 23 14:52:38 CET 2009
On Mon, Mar 23, 2009 at 9:14 AM, Eric Angelini wrote:
> a(1)=1
> a(n) is always the smallest integer > a(n-1) such that
> two consecutive digits in the sequence sum up to a prime:
After the initial
2,3,4,7,41,43,47,49,83,85,89,
the following pattern repeats:
202,302,303,
411,412,502,503,830,
2020,2021,2023,2025,2029,2030,2032,3020,3021,
4111,4112,5020,5021,6111,6112,9202,9203,
with each time two digits (either 02 or 11) more:
20202,30202,30203,
41111,41112,50202,50203,83020,
202020,202021,202023,202025,202029,202030,202032,302020,302021,
411111,411112,502020,502021,611111,611112,920202,920203,
and so on.
Maximilian
unoptimized PARI code:
EAnext(n)={ local(L=n%10-48); until(0,
until( isprime(L+Vecsmall(Str(n++))[1]),);
for( k=0,#Str(n)-2, isprime( [1,1]*divrem(n\10^k%100,10)) | next(2));
break) ; n }
More information about the SeqFan
mailing list