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-4 of 4 results.

A176069 Numbers of the form k^2+k+1 that are the product of two distinct primes.

Original entry on oeis.org

21, 57, 91, 111, 133, 183, 381, 553, 703, 813, 871, 993, 1057, 1191, 1261, 1333, 1561, 1641, 1807, 1893, 1981, 2071, 2257, 2353, 2653, 2757, 2863, 3193, 3661, 4033, 4291, 4971, 5257, 5403, 5853, 6807, 6973, 7141, 7311, 7483, 8373, 8557, 8743, 9121, 9313, 9507, 9703
Offset: 1

Views

Author

Keywords

Examples

			21 is a term as 21 = 3*7 = 4^2+4+1; 21 is the product of two distinct primes and 21 is of the form k^2 + k + 1.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=Last/@FactorInteger[n]=={1,1};Select[Array[ #^2+#+1&,6!,2],f[ # ]&]

Extensions

Name corrected by David A. Corneth, May 29 2023

A176070 Numbers of the form k^3+k^2+k+1 that are the product of two distinct primes.

Original entry on oeis.org

15, 85, 259, 1111, 4369, 47989, 65641, 291919, 2016379, 2214031, 3397651, 3820909, 5864581, 9305311, 13881841, 15687751, 16843009, 19756171, 22030681, 28746559, 62256349, 64160401, 74264821, 79692331, 101412319, 117889591, 172189309, 185518471, 191435329, 270004099, 328985791
Offset: 1

Views

Author

Keywords

Comments

As k^3 + k^2 + k + 1 = (k + 1) * (k^2 + 1) and k <= 1 does not give a term, k + 1 and k^2 + 1 must be prime so k must be even. - David A. Corneth, May 30 2023

Examples

			15 is in the sequence as 15 = 3*5 = 2^3+2^2+2+1; 15 is a product of two distinct primes and of the form k^3 + k^2 + k + 1.
		

Crossrefs

Cf. A002496, A006093, A006881, A053698, A070689, A174969, A176069, A237627 (semiprimes of that form).

Programs

  • Mathematica
    f[n_]:=Last/@FactorInteger[n]=={1,1};Select[Array[ #^3+#^2+#+1&,7! ],f[ # ]&]
  • PARI
    upto(n) = {my(res = List(), u = sqrtnint(n, 3) + 1); forprime(p = 3, u, c = (p-1)^2 + 1; if(isprime(c), listput(res, c*p))); res} \\ David A. Corneth, May 30 2023

Formula

a(n) = (A070689(n + 1) + 1) * (A070689(n + 1)^2 + 1). - David A. Corneth, May 30 2023

Extensions

Name corrected by and more terms from David A. Corneth, May 30 2023

A353056 Composite numbers of the form k^2+k+1 all of whose prime factors are of that same form.

Original entry on oeis.org

21, 91, 273, 343, 507, 651, 1333, 4557, 6321, 6643, 27391, 36673, 50851, 65793, 83811, 105301, 139503, 190533, 194923, 217623, 234741, 391251, 545383, 1647373, 1961401, 2032051, 2376223, 4517751, 6118203, 6484663, 11590621, 13180531, 14535157, 20155611, 28371603, 35646871
Offset: 1

Views

Author

Michel Marcus, Apr 20 2022

Keywords

Examples

			21 = 4^2+4+1 and its factors are 3 and 7, terms of A002383. So 21 is a term.
		

Crossrefs

Subsequence of A174969.
Cf. A002383.

Programs

  • Maple
    q:= n-> not isprime(n) and andmap(p-> issqr(4*p-3), numtheory[factorset](n)):
    select(q, [k*(k+1)+1$k=4..6000])[];  # Alois P. Heinz, Apr 20 2022
  • Mathematica
    Select[Table[n^2 + n + 1, {n, 1, 6000}], CompositeQ[#] && AllTrue[FactorInteger[#][[;; , 1]], IntegerQ@Sqrt[4*#1 - 3] &] &] (* Amiram Eldar, Apr 20 2022 *)
  • PARI
    lista(nn) = {for (n=1, nn, my(x=n^2+n+1); if (! isprime(x), my(fa=factor(x), ok=1); for (k=1, #fa~, my(fk=fa[k,1]); if (! issquare(4*fk-3), ok = 0);); if (ok, print1(x, ", "));););}
    
  • Python
    from sympy import isprime, factorint
    from itertools import count, takewhile
    def agento(N): # generator of terms up to limit N
        form = set(takewhile(lambda x: x<=N, (k**2 + k + 1 for k in count(1))))
        for t in sorted(form):
            if not isprime(t) and all(p in form for p in factorint(t)):
                yield t
    print(list(agento(10**8))) # Michael S. Branicky, Apr 20 2022

A176071 Numbers of the form 2^k + k + 1 that are the product of two distinct primes.

Original entry on oeis.org

21, 38, 265, 4109, 65553, 262163, 1048597, 67108891, 274877906983, 4503599627370549, 73786976294838206531, 75557863725914323419213, 302231454903657293676623, 5192296858534827628530496329220209, 10889035741470030830827987437816582766726, 95780971304118053647396689196894323976171195136475313
Offset: 1

Views

Author

Keywords

Examples

			21 = 3 * 7 = 2^4 + 4 + 1
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=Last/@FactorInteger[n]=={1,1};Select[Array[2^#+#+1&,140,0],f[ # ]&]
    Select[Table[2^k+k+1,{k,0,200}],PrimeNu[#]==PrimeOmega[#]==2&] (* Harvey P. Dale, Jul 11 2023 *)
  • PARI
    is(n) = my(f = factor(n), e = logint(n, 2)); f[,2] == [1, 1]~ && n == 1<David A. Corneth, May 27 2023

Extensions

Name corrected by David A. Corneth, May 27 2023
Showing 1-4 of 4 results.