OFFSET
1,1
COMMENTS
Initialize a binary register L for the ten digits to zero (0000000000); cumulatively toggle the N-th digit of L for every digit N as we wander through the primes. Primes P such that L is 1111111111 after including the digits of P are added to the sequence.
L is 1111111111 when all of the digits in the current and preceding primes have simultaneously occurred an odd number of times.
LINKS
Donovan Johnson, Table of n, a(n) for n = 1..1000
EXAMPLE
The progression of L from 2 to 359 (primes 17-353 replaced by dots for brevity):
2: 0010000000
3: 0011000000
5: 0011010000
7: 0011010100
11: 0011010100
13: 0110010100
...
359: 1110110011
The next prime, 367, toggles the 4th, 7th, and 8th digits of L giving 1111111111, so 367 is a member of the sequence.
The next prime, 373, toggles the 4th digit of L twice (no change) and toggles the 8th digit of L giving 1111111011, so 373 is excluded.
The next member of the sequence, 389, occurs three primes later:
379: 1110111110
383: 1110111100
389: 1111111111
MAPLE
A192448 := proc(nmax) local Lf, p, l, d, wrks ;
Lf := vector([seq(0, i=0..9)]) ;
p := 2;
for l from 1 to nmax do
for d in convert(p, base, 10) do
Lf[d+1] := Lf[d+1]+1 ;
end do:
wrks := true;
for i from 1 to 10 do
if type(Lf[i], 'even') then
wrks := false;
break;
end if;
end do:
if wrks then
print(p);
end if;
p := nextprime(p) ;
end do:
return ;
end proc:
A192448(20000) ; # R. J. Mathar, Jul 12 2011
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Gil Broussard, Jul 02 2011
STATUS
approved