[seqfan] Re: Any digit-pair in S sums to a prime

Maximilian Hasler maximilian.hasler at gmail.com
Thu Apr 11 16:38:49 CEST 2013


On Wed, Apr 10, 2013 at 6:57 PM, Eric Angelini wrote:
>
> Any digit-pair in S sums to a prime, commas or not:
> S=1,2,3,4,7,6,5,8,9,20,21,11,12,14,16,50,23,25,29,41,43,47,49,83,85,61,65,
>

I think "any 2 subsequent digits" would be better,
"any pair" does not require that they are neighbors.

> S is supposed not to show twice the same
> integer, and S wants to be the lexicofirst such seq.
>

The sequence
0, 2, 1, 4, 3, 8, 5, 6, 7, 41, 11, 12, 9, 20, 21, 14, 16, 50, 23, ...
has the same property and is lexicographically smaller than yours. ;-)

My script

EA114(n,a=[1],u=0)={ while(#a<n, u+=1<<a[#a];
 for(t=a[1]+1,9e9, bittest(u,t) & next; my(d=concat(a[#a]%10,digits(t)));
 for(i=2,#d, isprime(d[i-1]+d[i]) || next(2)); a=concat(a,t);break));a }

confirms your terms (if they are to be positive).


> The same seq with prime absolute
> differences between digits is perhaps T:
>
> T=1,3,5,2,4,6,8,13,14,7,9,20,24,16,18,30,25,27,29,41,31,35,36,38,50,52,42,46,
> 47,49,61,63,53,57,58,64,68,69,70,72,74,75,79,202,92,94,96,81,83,85,86,97,
> 203,130,205,207,241,302,413,131,...
>

Here, too, my script

EA114b(n,a=[1],u=0)={ while(#a<n, u+=1<<a[#a];
 for(t=a[1]+1,9e9, bittest(u,t) & next; my(d=concat(a[#a]%10,digits(t)));
 for(i=2,#d, isprime(abs(d[i-1]-d[i])) || next(2)); a=concat(a,t);break));a }

Confirms your terms if they are to be positive, and else yields

0, 2, 4, 1, 3, 5, 7, 9, 6, 8, 13, 14, 16, 18, 30, 20, 24, 25, 27, 29,
41, 31, 35, 36, 38, 50, 52, 42, 46, 47, 49, 61, 63, 53, 57, 58, 64,
68, 69, 70, 72, 74, 75, 79, 202, 92, 94, 96, 81, 83,...


A related sequence would be that of numbers which certainly will never
be in any of these sequences, like 10,13,15,17,18,19,22,24,...
which is not yet on OEIS, and between 10 and 100 close to
A104211 		Integers n such that the sum of the digits of n is not prime.

Best wishes,
Maximilian



More information about the SeqFan mailing list