login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Slowest increasing sequence where a(n)+(first digit of a(n)) is prime.
3

%I #16 Oct 04 2024 06:54:16

%S 1,10,12,16,18,21,27,29,34,38,43,49,54,56,61,65,67,72,76,81,89,92,94,

%T 98,100,102,106,108,112,126,130,136,138,148,150,156,162,166,172,178,

%U 180,190,192,196,198,209,221,225,227,231,237,239,249,255,261,267,269,275

%N Slowest increasing sequence where a(n)+(first digit of a(n)) is prime.

%H Robert Israel, <a href="/A107836/b107836.txt">Table of n, a(n) for n = 1..10000</a>

%e 1 + 1 = 2, which is prime; 10 + 1 = 11, which is prime; 12 + 1 = 13, which is prime; 16 + 1 = 17, which is prime; 18 + 1 = 19, which is prime; 21 + 2 = 23, which is prime; etc.

%p select(t -> isprime(t + floor(t/10^ilog10(t))), [$1..1000]); # _Robert Israel_, May 05 2020

%t Select[ Range[280], PrimeQ[ # + IntegerDigits[ # ][[1]]] &] (* _Robert G. Wilson v_, Jun 14 2005 *)

%o (Python)

%o from sympy import isprime

%o from itertools import count, islice

%o def agen(): # generator of terms

%o an = 0

%o while True:

%o an = next(k for k in count(an+1) if isprime(k + int(str(k)[0])))

%o yield an

%o print(list(islice(agen(), 58))) # _Michael S. Branicky_, Oct 03 2024

%K base,easy,nonn

%O 1,2

%A _Eric Angelini_, Jun 11 2005

%E Edited, corrected and extended by _Robert G. Wilson v_, Jun 14 2005