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.

Previous Showing 21-30 of 54 results. Next

A230252 Number of ways to write n = x + y (x, y > 0) with 2*x + 1, x^2 + x + 1 and y^2 + y + 1 all prime.

Original entry on oeis.org

0, 1, 2, 3, 2, 3, 4, 4, 4, 3, 4, 1, 3, 3, 3, 5, 5, 4, 3, 6, 4, 7, 7, 2, 4, 6, 4, 4, 6, 3, 1, 4, 2, 4, 7, 4, 1, 4, 4, 2, 6, 4, 3, 4, 2, 3, 5, 3, 2, 1, 2, 3, 6, 2, 6, 6, 3, 5, 4, 5, 3, 7, 2, 4, 6, 2, 4, 5, 3, 5, 8, 5, 2, 10, 4, 4, 8, 5, 6, 7, 8, 4, 11, 4, 3, 6, 4, 2, 4, 8, 8, 11, 5, 3, 11, 5, 3, 6, 4, 5
Offset: 1

Views

Author

Zhi-Wei Sun, Oct 13 2013

Keywords

Comments

Conjecture: (i) a(n) > 0 for all n > 1.
(ii) Any integer n > 3 can be written as p + q with p, 2*p - 3 and q^2 + q + 1 all prime. Also, each integer n > 3 not equal to 30 can be expressed as p + q with p, q^2 + q - 1 and q^2 + q + 1 all prime.
(iii) Any integer n > 1 can be written as x + y (x, y > 0) with x^2 + 1 (or 4*x^2+1) and y^2 + y + 1 (or 4*y^2 + 1) both prime.
(iv) Each integer n > 3 can be expressed as p + q (q > 0) with p, 2*p - 3 and 4*q^2 + 1 all prime.
(v) Any even number greater than 4 can be written as p + q with p, q and p^2 + 4 (or p^2 - 2) all prime. Also, each even number greater than 2 and not equal to 122 can be expressed as p + q with p, q and (p-1)^2 + 1 all prime.
We have verified the first part for n up to 10^8.

Examples

			a(5) = 2 since 5 = 2 + 3 = 3 + 2, and 2*2+1 = 5, 2*3+1 = 7, 2^2+2+1 = 7, 3^2+3+1 = 13 are all prime.
a(31) = 1 since 31 = 14 + 17, and 2*14+1 = 29, 14^2+14+1 = 211 and 17^2+17+1 = 307 are all prime.
		

Crossrefs

Programs

  • Mathematica
    a[n_]:=Sum[If[PrimeQ[2i+1]&&PrimeQ[i^2+i+1]&&PrimeQ[(n-i)^2+n-i+1],1,0],{i,1,n-1}]
    Table[a[n],{n,1,100}]

A174969 Composites of form n^2 + n + 1.

Original entry on oeis.org

21, 57, 91, 111, 133, 183, 273, 343, 381, 507, 553, 651, 703, 813, 871, 931, 993, 1057, 1191, 1261, 1333, 1407, 1561, 1641, 1807, 1893, 1981, 2071, 2163, 2257, 2353, 2451, 2653, 2757, 2863, 3081, 3193, 3423, 3661, 3783, 4033, 4161, 4291, 4557, 4693, 4971
Offset: 1

Views

Author

Michel Lagneau, Apr 02 2010

Keywords

Examples

			n=1 gives 1^2+1+1=3, which is prime and so not a term, and similarly for n=2,3; n=4 gives 21=3*7, which is a(1).
		

References

  • L. Poletti, Le serie dei numeri primi appartenente alle due forme quadratiche (A) n^2+n+1 e (B) n^2+n-1 per l'intervallo compreso entro 121 milioni, e cioè per tutti i valori di n fino a 11000, Atti della Reale Accademia Nazionale dei Lincei, Memorie della Classe di Scienze Fisiche, Matematiche e Naturali, s. 6, v. 3 (1929), pages 193-218.

Crossrefs

Programs

  • Maple
    with(numtheory):for n from 0 to 200 do:x:=n^2+n+1: if type(x,prime)=false then print (x):else fi:od:
  • Mathematica
    Select[Array[ #^2+#+1&,6!,2],!PrimeQ[ # ]&] (* Vladimir Joseph Stephan Orlovsky, Apr 07 2010 *)
  • PARI
    isok(k) = (k>1) && !isprime(k) && issquare(4*k-3); \\ Michel Marcus, Apr 20 2022

Extensions

Example edited and keyword uned removed by D. S. McNeil, Nov 17 2010

A182253 Nonprime numbers n such that n^2 + n + 1 is prime.

Original entry on oeis.org

1, 6, 8, 12, 14, 15, 20, 21, 24, 27, 33, 38, 50, 54, 57, 62, 66, 69, 75, 77, 78, 80, 90, 99, 105, 110, 111, 117, 119, 138, 141, 143, 147, 150, 153, 155, 161, 162, 164, 168, 176, 188, 189, 192, 194, 203, 206, 209, 215, 218, 231, 236, 245, 246, 266, 272, 278
Offset: 1

Views

Author

Bernard Schott, Dec 18 2012

Keywords

Comments

All these numbers are in A002384 but not in A053182.
The generated prime numbers n^2 + n + 1 are in A185632.
All the generated numbers n^2 + n + 1 = 111_n are by definition Brazilian numbers: A125134. See Links: "Les nombres brésiliens" - Section V.5 page 35.

Crossrefs

Programs

  • Mathematica
    Select[Range@ 280, And[! PrimeQ@ #, PrimeQ[#^2 + # + 1]] &] (* Michael De Vlieger, Jul 30 2017 *)
  • PARI
    isok(n) = ! isprime(n) && isprime(n^2 + n + 1); \\ Michel Marcus, Sep 04 2013

A088503 Numbers n such that (n^2 + 3)/4 is prime.

Original entry on oeis.org

3, 5, 7, 11, 13, 17, 25, 29, 31, 35, 41, 43, 49, 55, 67, 77, 83, 101, 109, 115, 119, 125, 133, 139, 143, 151, 155, 157, 161, 179, 181, 199, 203, 211, 221, 223, 235, 239, 263, 277, 283, 287, 295, 301, 307, 311, 323, 325, 329, 335, 337, 347, 353, 377, 379, 385
Offset: 1

Views

Author

Pierre CAMI, Nov 13 2003

Keywords

Comments

Under Bunyakovsky's conjecture this sequence is infinite. - Charles R Greathouse IV, Dec 28 2011

Examples

			(25*25 + 3)/4 = 157, 157 is prime, 25 is the 7th term of the sequence.
		

Crossrefs

Programs

Formula

a(n) = 2*A002384(n) + 1 = sqrt(A110284(n)). - Ray Chandler, Sep 07 2005

Extensions

Corrected and extended by Ray Chandler, Nov 16 2003

A144851 a(n) = number of distinct prime divisors (taken together) of numbers of the form 2x^2+1 for x<=10^n.

Original entry on oeis.org

8, 76, 760, 7445, 73477, 726948, 7218256, 71801859, 715087632, 7127665635, 71089166879, 709344259821
Offset: 1

Views

Author

Artur Jasinski & Bernhard Helmes (bhelmes(AT)gmx.de), Sep 22 2008

Keywords

Crossrefs

Programs

  • Mathematica
    d = 10; l = 0; p = 2; c = {}; a = {}; Do[k = p x^2 + 1; b = Divisors[k]; Do[If[PrimeQ[b[[n]]], AppendTo[a, b[[n]]]], {n, 1, Length[b]}]; If[x == d, a = Union[a]; l = Length[a]; d = 10 d; Print[l]; AppendTo[c, l]], {x, 1, 10000}]; c (*Artur Jasinski*)

Extensions

Fixed broken link, corrected and extended to agree with website. - Ray Chandler, Jun 30 2015

A083520 Primes p such that p-1 is a product of two or more consecutive integers. Or (p-1) is a permutation of m items chosen from n, for some m and n. p-1 = k*(k+1)(k+2)...(k+r) for some k and r, r>0.

Original entry on oeis.org

3, 7, 13, 31, 43, 61, 73, 157, 211, 241, 307, 337, 421, 463, 601, 757, 991, 1123, 1321, 1483, 1723, 2521, 2551, 2731, 2971, 3307, 3361, 3541, 3907, 4423, 4831, 5113, 5701, 6007, 6163, 6481, 6841, 8011, 8191, 9241, 9901, 10303, 10627, 11131, 12211, 12433
Offset: 1

Views

Author

Amarnath Murthy and Meenakshi Srikanth (menakan_s(AT)yahoo.com), May 05 2003

Keywords

Examples

			61 is in this sequence as 60 = 3*4*5. 73 is in this sequence as 72 = 8*9.
		

Crossrefs

Programs

  • Maple
    isA083520 := proc(p)
        local k,r,i,po;
        for k from 1 to floor(sqrt(p)) do
            for r from 1 do
                po := product(k+i,i=0..r) ;
                if po  = p-1 then
                    return true;
                elif po > p-1 then
                    break;
                end if;
            end do:
        end do:
        false ;
    end proc:
    n := 1 :
    for c from 1 do
        p := ithprime(c) ;
        if isA083520(p) then
            printf("%d %d\n",n,p) ;
            n := n+1 ;
        end if;
    end do: # R. J. Mathar, Aug 23 2014

Extensions

More terms from David Wasserman, Nov 19 2004

A087126 Primes of the form p^k - p^(k-1) + 1 for some prime p and integer k > 1.

Original entry on oeis.org

3, 5, 7, 17, 19, 43, 101, 157, 163, 257, 487, 1459, 2029, 4423, 6163, 14407, 19183, 22651, 23549, 26407, 37057, 39367, 62501, 65537, 77659, 113233, 121453, 143263, 208393, 292141, 342733, 375157, 412807, 527803, 564899, 590593, 697049, 843643
Offset: 1

Views

Author

T. D. Noe, Aug 15 2003

Keywords

Comments

It is usually the case that, for prime p and k > 1, the first time the totient function phi(n) has value p^k - p^(k-1) is for n = p^k. However, this is not true when p^k - p^(k-1) + 1 is prime.

Crossrefs

Cf. A002383 (primes of the form n^2 + n + 1, which is the same as n^2 - n + 1).
Cf. A019434 (Fermat primes), A003306 (2*3^n + 1 is prime), A056799 (8*9^n + 1 is prime), A056797 (9*10^n + 1 is prime), A087139 (least k such that p^k - p^(k-1) + 1 is prime for p = prime(n)).

Programs

  • Mathematica
    lst={}; maxNum=10^6; n=1; While[p=Prime[n]; p^2-p+1
    				

A144850 a(n) = number of distinct prime divisors (taken together) of numbers of the form x^2+x+1 for x<=10^n.

Original entry on oeis.org

8, 74, 734, 7233, 71653, 712026, 7090655, 70686855, 705173825, 7038475146, 70278276834, 701910715473
Offset: 1

Views

Author

Artur Jasinski & Bernhard Helmes (bhelmes(AT)gmx.de), Sep 22 2008

Keywords

Crossrefs

Programs

  • Mathematica
    d = 10; l = 0; p = 1; c = {}; a = {}; Do[k = p x^2 + x + 1; b = Divisors[k]; Do[If[PrimeQ[b[[n]]], AppendTo[a, b[[n]]]], {n, 1, Length[b]}]; If[x == d, a = Union[a]; l = Length[a]; d = 10 d; Print[l]; AppendTo[c, l]], {x, 1, 10000}]; c (*Artur Jasinski*)

Extensions

Fixed broken link, corrected and extended to agree with website. - Ray Chandler, Jun 30 2015

A236386 Numbers m such that phi(m) is an oblong number.

Original entry on oeis.org

3, 4, 6, 7, 9, 13, 14, 18, 21, 25, 26, 28, 31, 33, 36, 42, 43, 44, 49, 50, 62, 66, 73, 86, 87, 91, 95, 98, 111, 116, 117, 121, 135, 146, 148, 152, 157, 161, 169, 174, 182, 190, 201, 207, 211, 216, 222, 228, 234, 237, 241, 242, 252, 268, 270, 287, 289, 305
Offset: 1

Views

Author

Joseph L. Pe, Jan 24 2014

Keywords

Comments

An oblong number (A002378) is of the form k*(k+1) where k is a natural number.
From Bernard Schott, Feb 27 2023: (Start)
Subsequence of primes is A002383 because in this case phi(k^2+k+1) = k*(k+1).
Subsequence of oblong numbers is A359847 where k and phi(k) are both oblong numbers. (End)

Examples

			phi(13) = 12 = 3*4, an oblong number; so 13 is a term of the sequence.
		

Crossrefs

Similar, but where phi(m) is: A039770 (square), A039771 (cube), A078164 (biquadrate), A096503 (repdigit), A117296 (palindrome), A360944 (triangular).

Programs

  • Maple
    filter := m -> issqr(1 + 4*phi(m)) : select(filter, [$(1 .. 700)]); # Bernard Schott, Feb 26 2023
  • Mathematica
    Select[Range[500], IntegerQ@Sqrt[1 + 4*EulerPhi[#]] &] (* Giovanni Resta, Jan 24 2014 *)
  • PARI
    isok(m) = my(t=eulerphi(m)); !(t%2) && ispolygonal(t/2, 3); \\ Michel Marcus, Feb 27 2023
    
  • Python
    from itertools import count, islice
    from sympy.ntheory.primetest import is_square
    from sympy import totient
    def A236386_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:is_square((totient(n)<<2)+1), count(max(1,startvalue)))
    A236386_list = list(islice(A236386_gen(),20)) # Chai Wah Wu, Feb 28 2023

Extensions

a(16)-a(58) from Giovanni Resta, Jan 24 2014

A237360 Numbers n of the form p^2+p+1 (for prime p) such that n^2+n+1 is also prime.

Original entry on oeis.org

57, 381, 993, 4557, 16257, 32943, 49953, 58323, 109893, 135057, 167691, 214833, 237657, 453603, 503391, 564753, 658533, 678153, 780573, 995007, 1248807, 1516593, 1746363, 2218611, 2400951, 3465183, 3738423, 4340973, 4750221, 5232657, 6118203
Offset: 1

Views

Author

Derek Orr, Feb 06 2014

Keywords

Examples

			57 = 7^2+7+1 (7 is prime) and 57^2+57+1 = 3307 is also prime. Thus, 57 is a member of this sequence.
		

Crossrefs

Programs

  • Maple
    for k from 1 do
        p := ithprime(k) ;
        n := numtheory[cyclotomic](3,p) ;
        pn := numtheory[cyclotomic](3,n) ;
        if isprime( pn) then
            print(n) ;
        end if;
    end do: # R. J. Mathar, Feb 07 2014
  • Mathematica
    Select[Table[p^2+p+1,{p,Prime[Range[500]]}],PrimeQ[#^2+#+1]&] (* Harvey P. Dale, Feb 09 2014 *)
  • PARI
    s=[]; forprime(p=2, 4000, if(isprime(p^4+2*p^3+4*p^2+3*p+3), s=concat(s, p^2+p+1))); s \\ Colin Barker, Feb 07 2014
  • Python
    import sympy
    from sympy import isprime
    {print(n**2+n+1) for n in range(10**4) if isprime(n) and isprime((n**2+n+1)**2+(n**2+n+1)+1)}
    
Previous Showing 21-30 of 54 results. Next