login
A375102
a(0) = 1; a(n+1) = 10*a(n) + (a(n)-1 mod 9) + 1, or the least number not yet in the sequence in case a(n) is a multiple of 3 or a prime.
0
1, 11, 2, 3, 4, 44, 448, 4487, 44875, 448751, 4487512, 44875124, 448751248, 4487512487, 44875124875, 448751248751, 4487512487512, 44875124875124, 448751248751248, 4487512487512487, 5, 6, 7, 8, 88, 887, 9, 10, 101, 12, 13, 14, 145, 1451, 15, 16, 167, 17, 18, 19, 20, 202, 2024
OFFSET
0,2
COMMENTS
After a({1, 2, 3}), the next primes occur at indices 19, 20, 22, 25, 28, 30, 33, 36, 37, 39, 88, 279, 280, ... The prime a(88) = 20{248751}*8 (where {x}*n means x repeated n times) has 50 decimal digits, and the prime a(279) = 22487{512487}*31 has 191 digits, it is followed by the Fermat prime a(280) = 257 = A019434(4), which is the least positive integer not appearing earlier.
LINKS
Eric Angelini, Fun with roots, personal blog CinquanteSignes.blogspot.com (and post to the math-fun list), Jul 28 2024.
PROG
(PARI) upto(N=300, a=0, S=[])={vector(N, i, S=setunion(S, [a]); while(#S>1&&S[2]==S[1]+1, S=S[^1]); a=if(a%3 && !ispseudoprime(a), 10*a+(a-1)%9, S[1])+1)}
CROSSREFS
Cf. A008585 (multiples of 3), A000040 (the primes), A010051 (isprime), A010888 (digital root (n-1)%9+1).
Sequence in context: A109864 A231433 A240454 * A377669 A099756 A088277
KEYWORD
nonn
AUTHOR
M. F. Hasler, Jul 30 2024
STATUS
approved