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.

Showing 1-2 of 2 results.

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

A376992 a(n) is the least n-digit prime of the form j^2 + (j+1)^2.

Original entry on oeis.org

5, 13, 113, 1013, 10513, 100801, 1006781, 10030721, 100040513, 1001057513, 10000515313, 100016728501, 1000078402181, 10000013617661, 100000472012281, 1000000064846161, 10000005481873013, 100000002459693601, 1000000116852093013, 10000000062611784481, 100000001234170737761
Offset: 1

Views

Author

Stefano Spezia, Oct 11 2024

Keywords

Crossrefs

Programs

  • Maple
    f:= proc(n) local j,x;
         for j from ceil((sqrt(2*10^(n-1)-1)-1)/2) do
           x:= j^2 + (j+1)^2;
           if isprime(x) then return x fi
         od
    end proc:
    map(f, [$1..40]); # Robert Israel, Oct 13 2024
  • Mathematica
    a[n_]:=Module[{k=1}, While[!PrimeQ[m=2k^2+2k+1]||IntegerLength[m]
    				
  • Python
    from math import isqrt
    from itertools import count
    from sympy import prime
    def A376992(n):
        for k in count(isqrt(((a:=10**(n-1))<<1)-1>>2)):
            m = 2*k*(k+1)+1
            if m >= a and isprime(m):
                return m # Chai Wah Wu, Oct 13 2024

Formula

Conjecture: a(n+1)/a(n) ~ 10.
Showing 1-2 of 2 results.