cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A376933 a(n) = (A376907(n) - 10^(n-1))/3.

Original entry on oeis.org

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

Views

Author

Stefano Spezia, Oct 11 2024

Keywords

Crossrefs

Programs

  • Mathematica
    a[n_]:=(Module[{k=1}, While[!PrimeQ[m=3k^2+3k+1]||IntegerLength[m]
    				
  • PARI
    a(n) = my(m=10^(n-1), p); for(k=(sqrtint(12*m-3)-3)\6, oo, p=3*k*(k+1)+1; if(p>m&&isprime(p), return((p-m)/3))); \\ Jinyuan Wang, Mar 01 2025
  • 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
    

Extensions

a(21)-a(27) from Chai Wah Wu, Oct 13 2024