login
A376689
a(n) is the first number that is a prime times 3^n and ends in exactly n 1's.
1
2, 21, 711, 240111, 51111, 45411111, 16059111111, 43761111111, 2121411111111, 328203111111111, 11862441111111111, 37253511111111111, 10630644111111111111, 141896571111111111111, 17806995411111111111111, 9675948111111111111111, 11187474501111111111111111, 235460890911111111111111111
OFFSET
0,1
LINKS
EXAMPLE
a(3) = 240111 because 240111 = 3^3 * 8893 with 8893 prime and 240111 ends with three 1's.
a(12) = 10630644111111111111, not 3721911111111111111, because although 3721911111111111111 = 3^12 * 7003432386871 with 7003432386871 prime, 3721911111111111111 ends in 14 1's rather than just 12.
MAPLE
f:= proc(n) local x0, p;
x0:= -(1-10^(-n))/9 mod 3^n;
for p from x0*10^n+(10^n-1)/9 by 30^n do if isprime(p/3^n) and p mod 10^(n+1) <> (10^(n+1)-1)/9 then return p fi od
end proc;
map(f, [$0..20]);
CROSSREFS
Cf. A065821.
Sequence in context: A024233 A015209 A342267 * A113083 A174964 A210830
KEYWORD
nonn,base
AUTHOR
Robert Israel, Oct 01 2024
STATUS
approved