[seqfan] Re: A145713 and company
Douglas McNeil
mcneil at hku.hk
Mon Aug 30 03:30:33 CEST 2010
I wonder about the following:
> A145713: Number of primes among the first 10^n primes that have most
> significant and least significant decimal digit are equal.
> 3, 12, 107, 1182, 14145, 158038, 1703163, 17520560, 157563621, 1431557209
> I used the Mathematica coding: f[n_] := Block[{id = IntegerDigits at n},
> If[id[[1]] == id[[-1]], id[[1]], 0]];
> k = n = 1; p = 2; t = {0, 0, 0, 0}; While[n < 9, While[ k < 10^n + 1,
> Switch[ f at p, 1, t[[1]]++, 3, t[[2]]++, 7, t[[3]]++, 9, t[[4]]++]; k++; p =
> NextPrime at p]; Print[{t,Plus@@t}]; n++ ]
It'd be nice to preserve A145713 = sum of the others. But I don't
think the textual definition of A145713 proposed matches the code: if
we're allowing 1-digit primes, then <= 31 we have 5: 2,3,5,7,11, and
so A145713(1)=5. If we change the code, we lose the relation.
A def'n like the the above needs to rule out 2 and 5. Probably the
current 9 < p bit was introduced by one of the editors to avoid this
1-digit difficulty (c.f. the author's "equal and distinct first and
last digits" in a comment, which to my eyes says it well).
Doug
--
Department of Earth Sciences
University of Hong Kong
More information about the SeqFan
mailing list