login
This site is supported by donations to The OEIS Foundation.

 

Logo

Please make a donation to keep the OEIS running. We are now in our 55th year. In the past year we added 12000 new sequences and reached 8000 citations (which often say "discovered thanks to the OEIS"). We need to raise money to hire someone to manage submissions, which would reduce the load on our editors and speed up editing.
Other ways to donate

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A268605 a(0) = 0; a(n+1) is the smallest integer in which the difference between its digits sum and the a(n) digits sum is equal to the n-th prime. 2
0, 2, 5, 19, 89, 1999, 59999, 4999999, 599999999, 199999999999, 399999999999999, 799999999999999999, 8999999999999999999999, 499999999999999999999999999, 29999999999999999999999999999999, 4999999999999999999999999999999999999 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

First 8 terms are primes (and are also in A061248). Next terms are not always primes.

LINKS

Francesco Di Matteo, Table of n, a(n) for n = 1..25

EXAMPLE

a(4) = 19 and 1 + 9 = 10; so a(5) = 89 because 8 + 9 = 17 and 17 - 10 = 7, that is the 4th prime.

PROG

(Python)

sumprime = 0

isPrime=lambda x: all(x % i != 0 for i in range(int(x**0.5)+1)[2:])

for i in range(2, 100):

..if isPrime(i):

....alfa = ""

....k = i + sumprime

....sumprime = k

....while k > 9:

......alfa = alfa + "9"

......k = k - 9

....alfa = str(k)+alfa

....print alfa

(PARI) findnext(x, k) = {sx = sumdigits(x); pk = prime(k); y = 1; while (sumdigits(y) - sx != pk, y++); y; }

lista(nn) = {print1(x = 0, ", "); for (k=1, nn, y = findnext(x, k); print1(y, ", "); x = y; ); } \\ Michel Marcus, Feb 19 2016

CROSSREFS

Cf. A269306, A061248, A067180, A000040.

Sequence in context: A316700 A124348 A323389 * A205804 A052324 A020115

Adjacent sequences:  A268602 A268603 A268604 * A268606 A268607 A268608

KEYWORD

nonn,base

AUTHOR

Francesco Di Matteo, Feb 17 2016

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified December 7 05:14 EST 2019. Contains 329839 sequences. (Running on oeis4.)