login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

A376933
a(n) = (A376907(n) - 10^(n-1))/3.
3
2, 3, 9, 219, 89, 707, 7139, 17397, 127107, 185573, 170099, 8513673, 3730629, 9645947, 20878187, 435128997, 413502597, 7180622897, 28071202809, 4197184407, 53159437779, 72827487477, 408466487673, 1622948986427, 1009480191957, 50924645281527, 141362538039039
OFFSET
1,1
MATHEMATICA
a[n_]:=(Module[{k=1}, While[!PrimeQ[m=3k^2+3k+1]||IntegerLength[m]<n, k++]; m]-10^(n-1))/3; Array[a, 15]
PROG
(Python)
from itertools import count
from math import isqrt
from sympy import isprime
def A376933(n):
for k in count(isqrt((((a:=10**(n-1))<<2)-1)//12)):
m = 3*k*(k+1)+1
if m >= a and isprime(m):
return (m-a)//3 # Chai Wah Wu, Oct 13 2024
CROSSREFS
Sequence in context: A332203 A350777 A248236 * A319157 A153702 A280941
KEYWORD
nonn,base,more
AUTHOR
Stefano Spezia, Oct 11 2024
EXTENSIONS
a(21)-a(27) from Chai Wah Wu, Oct 13 2024
STATUS
approved