Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
A061248
Primes at which sum of digits strictly increases.
5
2, 3, 5, 7, 17, 19, 29, 59, 79, 89, 199, 389, 499, 599, 997, 1889, 1999, 2999, 4999, 6899, 8999, 29989, 39989, 49999, 59999, 79999, 98999, 199999, 389999, 598999, 599999, 799999, 989999, 2998999, 2999999, 4999999, 6999899, 8989999, 9899999
OFFSET
1,1
LINKS
EXAMPLE
a(6) = 19, sum of digits is 10; a(7) = 29, sum of digits is 11 and 11 > 10.
MATHEMATICA
t = {s = 2}; Do[If[(y = Total[IntegerDigits[x = Prime[n]]]) > s, AppendTo[t, x]; s = y], {n, 2, 750000}]; t (* Jayanta Basu, Aug 09 2013 *)
PROG
(Sage)
def A061248(nterms, b=10) :
res = []; n_list = [2]; n = 2; dsum = 0
while len(res) < nterms :
while not (sum(n_list) >= dsum and n.is_prime()) :
i = next((j for j in range(len(n_list)) if n_list[j] < b-1), len(n_list))
if i == len(n_list) : n_list.append(0)
n_list[i] += 1
r = dsum - sum(n_list[i:])
for j in range(i) :
n_list[j] = min(r, b-1)
r -= n_list[j]
n = sum(n_list[i]*b^i for i in range(len(n_list)))
res.append(n); dsum = sum(n_list)+1
return res
# Eric M. Schmidt, Oct 08 2013
CROSSREFS
For the actual digit sums see A062132.
Sequence in context: A127042 A069802 A067954 * A059498 A247147 A158085
KEYWORD
nonn,base
AUTHOR
Amarnath Murthy, Apr 23 2001
EXTENSIONS
More terms from Patrick De Geest, Jun 05 2001
STATUS
approved