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

A065508 Primes p such that p^2 - p + 1 is prime.

Original entry on oeis.org

2, 3, 7, 13, 67, 79, 139, 151, 163, 193, 337, 349, 379, 457, 541, 613, 643, 727, 769, 919, 991, 1021, 1093, 1117, 1201, 1231, 1381, 1423, 1549, 1567, 1597, 1621, 1693, 1747, 1789, 1801, 1933, 1987, 2011, 2017, 2113, 2137, 2143, 2239, 2281, 2557, 2647
Offset: 1

Views

Author

Vladeta Jovovic, Nov 26 2001

Keywords

Comments

The primes p^2 - p + 1 are in A074268.

Crossrefs

Programs

  • Magma
    [n: n in [0..10000]| IsPrime(n) and IsPrime(n^2 - n + 1)] // Vincenzo Librandi, Aug 07 2010
  • Mathematica
    Select[Prime[Range[500]],PrimeQ[#^2-#+1]&] (* Harvey P. Dale, Oct 06 2015 *)
  • PARI
    { n=0; for (m=1, 10^9, p=prime(m); if (isprime(p^2 - p + 1), write("b065508.txt", n++, " ", p); if (n==1000, return)) ) } \\ Harry J. Smith, Oct 20 2009
    

A127724 k-imperfect numbers for some k >= 1.

Original entry on oeis.org

1, 2, 6, 12, 40, 120, 126, 252, 880, 2520, 2640, 10880, 30240, 32640, 37800, 37926, 55440, 75852, 685440, 758520, 831600, 2600640, 5533920, 6917400, 9102240, 10281600, 11377800, 16687440, 152182800, 206317440, 250311600, 475917120, 715816960, 866829600
Offset: 1

Views

Author

T. D. Noe, Jan 25 2007

Keywords

Comments

For prime powers p^e, define a multiplicative function rho(p^e) = p^e - p^(e-1) + p^(e-2) - ... + (-1)^e. A number n is called k-imperfect if there is an integer k such that n = k*rho(n). Sequence A061020 gives a signed version of the rho function. As with multiperfect numbers (A007691), 2-imperfect numbers are also called imperfect numbers. As shown by Iannucci, when rho(n) is prime, there is sometimes a technique for generating larger imperfect numbers.
Zhou and Zhu find 5 more terms, which are in the b-file. - T. D. Noe, Mar 31 2009
Does this sequence follow Benford's law? - David A. Corneth, Oct 30 2017
If a term t has a prime factor p from A065508 with exponent 1 and does not have the corresponding prime factor q from A074268, then t*p*q is also a term. - Michel Marcus, Nov 22 2017
For n >= 1, the least n-imperfect numbers are 1, 2, 6, 993803899780063855042560. - Michel Marcus, Feb 13 2018
For any m > 0, if n*p^(2m-1) is k-imperfect, q = rho(p^(2m)) is prime and gcd(pq,n) = 1, then n*p^(2m)*q is also k-imperfect. - M. F. Hasler, Feb 13 2020

Examples

			126 = 2*3^2*7, rho(126) = (2-1)*(9-3+1)*(7-1) = 42.  3*42 = 126, so 126 is 3-imperfect. - _Jud McCranie_ Sep 07 2019
		

References

  • R. K. Guy, Unsolved Problems in Theory of Numbers, Springer, 1994, B1.

Crossrefs

Cf. A127725 (2-imperfect numbers), A127726 (3-imperfect numbers), A127727 (related primes), A309806 (the k values).
Cf. A061020 (signed version of rho function), A206369 (the rho function).

Programs

  • Mathematica
    f[p_,e_]:=Sum[(-1)^(e-k) p^k, {k,0,e}]; rho[n_]:=Times@@(f@@@FactorInteger[n]); Select[Range[10^6], Mod[ #,rho[ # ]]==0&]
  • PARI
    isok(n) = denominator(n/sumdiv(n, d, d*(-1)^bigomega(n/d))) == 1; \\ Michel Marcus, Oct 28 2017
    
  • PARI
    upto(ulim) = {res = List([1]); rhomap = Map(); forprime(p = 2, 3, for(i = 1, logint(ulim, p), mapput(rhomap, p^i, rho(p^i)); iterate(p^i, mapget(rhomap, p^i), ulim))); listsort(res, 1); res}
    iterate(m, rhoo, ulim) = {my(c); if(m / rhoo == m \ rhoo, listput(res, m); my(frho = factor(rhoo)); for(i = 1, #frho~, if(m%frho[i, 1] != 0, for(e = 1, logint(ulim \ m, frho[i, 1]), if(mapisdefined(rhomap, frho[i, 1]^e) == 0, mapput(rhomap, frho[i, 1]^e, rho(frho[i, 1]^e))); iterate(m * frho[i, 1]^e, rhoo * mapget(rhomap, frho[i, 1]^e), ulim)); next(2))))}
    rho(n) = {my(f = factor(n), res = q = 1); for(i=1, #f~, q = 1; for(j = 1, f[i, 2], q = -q + f[i, 1]^j); res * =q); res} \\ David A. Corneth, Nov 02 2017
    
  • PARI
    A127724_vec=concat(1, select( {is_A127724(n)=!(n%A206369(n))}, [1..10^5]*2))
      /* It is known that the least odd term > 1 is > 10^49. This code defines an efficient function is_A127724, but A127724_vec is better computed with upto(.) */
      A127724(n)=A127724_vec[n] \\ Used in other sequences. - M. F. Hasler, Feb 13 2020

Extensions

Small correction in name from Michel Marcus, Feb 13 2018

A119959 p^2-p+1 central polygonal numbers with prime indices A002061(prime(n)).

Original entry on oeis.org

3, 7, 21, 43, 111, 157, 273, 343, 507, 813, 931, 1333, 1641, 1807, 2163, 2757, 3423, 3661, 4423, 4971, 5257, 6163, 6807, 7833, 9313, 10101, 10507, 11343, 11773, 12657, 16003, 17031, 18633, 19183, 22053, 22651, 24493, 26407, 27723, 29757, 31863
Offset: 1

Views

Author

Alexander Adamchuk, Aug 02 2006

Keywords

Comments

Prime terms belong to A074268, which is a subset of A002383, A087126, A034915, A085104.
In every interval of prime(n)^2 integers, a(n) is the number that are not divisible by prime(n) plus the number that are divisible by prime(n)^2. - Peter Munn, Dec 12 2020

Crossrefs

Programs

  • Mathematica
    Table[Prime[n]^2-Prime[n]+1,{n,1,100}]
  • PARI
    a(n) = {my(p = prime(n)); p^2 - p + 1; } \\ Amiram Eldar, Nov 07 2022

Formula

a(n) = prime(n)^2 - prime(n) + 1.
a(n) = A036689(n)+1. - R. J. Mathar, Aug 13 2019
Product_{n>=1} (1 - 1/a(n)) = zeta(6)/(zeta(2)*zeta(3)) (A068468). - Amiram Eldar, Nov 07 2022

A258435 Primes of form x^2 - phi(x) in increasing order.

Original entry on oeis.org

3, 7, 43, 157, 1069, 1201, 4177, 4423, 5869, 6163, 8209, 17581, 19183, 22651, 26407, 37057, 48649, 60793, 61837, 82129, 89137, 102829, 113233, 115981, 121453, 141793, 143263, 190573, 208393, 230929, 283609, 292141, 303097, 314401, 337069
Offset: 1

Views

Author

Keywords

Examples

			a(1) = 3, because  2^2 - 1 = 3, and 1^2 - 1 = 0 is not a prime.
a(2) = 7, since 3^2 = 9, phi(3) = 2, so 9-2 = 7 (prime).
a(3) = 43, since 7^2 = 49, phi(7) = 6, so 49-6 = 43 (prime).
a(6) = 1201, since 35^2 = 1225, phi(35) = 24, so 1225-24 = 1201 (prime).
		

Crossrefs

Subset of A258434.
For phi see A000010.
A074268 is a subsequence. - Michel Marcus, Jun 19 2015
Cf. A259145.

Programs

  • Magma
    [a: n in [1..1000] | IsPrime(a) where a is n^2-EulerPhi(n) ]; // Vincenzo Librandi, Jun 03 2015
    
  • Mathematica
    lst = Table[n^2 - EulerPhi[n], {n, 1000}]; Select[lst, PrimeQ]
    Select[Table[n^2 - EulerPhi[n], {n, 1000}], PrimeQ] (* Vincenzo Librandi, Jun 03 2015 *)
  • PARI
    lista(nn) = {for (n=1, nn, if (isprime(p=n^2 -eulerphi(n)), print1(p, ", ")););} \\ Michel Marcus, Jul 08 2015

Extensions

More terms from Vincenzo Librandi, Jun 03 2015
Edited by Wolfdieter Lang, Jun 16 2015

A034915 Primes of the form p^k - p + 1 for prime p.

Original entry on oeis.org

3, 7, 31, 43, 79, 127, 157, 241, 337, 727, 1321, 3121, 4423, 6163, 6841, 8191, 19183, 19681, 22651, 26407, 28549, 29761, 37057, 68881, 78121, 113233, 117643, 121453, 130303, 131071, 143263, 208393, 292141, 371281, 375157, 412807, 524287, 527803
Offset: 1

Views

Author

Keywords

Comments

Related to hyperperfect numbers of a certain form.
Since x^k-x+1 is divisible by x^2-x+1 for k==2 (mod 6), none of k=8,14,20,... occur. - Robert Israel, Mar 20 2018

Examples

			11^3 - 11 + 1 = 1321 is prime, so 1321 is a term.
		

Crossrefs

Contains A074268.

Programs

  • Maple
    N:= 10^6: # to get all terms <= N
    Res:= NULL;
    p:= 1:
    do
      p:= nextprime(p);
      if p^2-p+1>N then break fi;
      for i from 2 to floor(log[p](N+p-1)) do
        if isprime(p^i-p+1) then Res:= Res, p^i-p+1 fi
      od
    od:
    sort(convert({Res},list)); # Robert Israel, Mar 20 2018

A136240 Numbers n among A006093 such that n^2 + n + 1 is prime.

Original entry on oeis.org

1, 2, 6, 12, 66, 78, 138, 150, 162, 192, 336, 348, 378, 456, 540, 612, 642, 726, 768, 918, 990, 1020, 1092, 1116, 1200, 1230, 1380, 1422, 1548, 1566, 1596, 1620, 1692, 1746, 1788, 1800, 1932, 1986, 2010, 2016, 2112, 2136, 2142, 2238, 2280, 2556, 2646
Offset: 1

Views

Author

Lekraj Beedassy, Dec 23 2007

Keywords

Comments

See A074268 for the primes associated with a(n).

Crossrefs

Cf. A136241.

Programs

  • Mathematica
    Select[Prime[Range[400]]-1,PrimeQ[#^2+#+1]&] (* Harvey P. Dale, Feb 11 2022 *)
  • PARI
    isA136240(n) = {isprime(n+1) && isprime(n^2+n+1)} \\ Michel Marcus, Jul 28 2013

Formula

a(n) = A065508(n) - 1.

A290817 Primes of at least one of the forms p^2 +- p +- 1, where p is prime.

Original entry on oeis.org

3, 5, 7, 11, 13, 19, 29, 31, 41, 43, 109, 131, 157, 181, 271, 307, 379, 811, 929, 991, 1721, 1723, 2161, 2861, 3539, 3541, 3659, 4421, 4423, 4969, 5113, 6163, 6971, 8009, 8011, 9311, 10099, 10301, 10303, 10711, 16001, 17029, 17291, 17293, 19181, 19183, 22051, 22349, 22651
Offset: 1

Views

Author

Ralf Steiner, Aug 11 2017

Keywords

Comments

This sequence contains prime chains and prime trees using an appropriate mapping form p^2 +- p +- 1 in each step, such as the chain: 3 -> 5 -> 19 -> 379 -> 143263 -> 20524143907 and the tree: 41 -> {1721, 1723}.

Crossrefs

Programs

  • Magma
    {p^2+(-1)^k*p+(-1)^s:p in PrimesUpTo(150), s,k in [1..2]|IsPrime(p^2+(-1)^k*p+(-1)^s)}; //  Marius A. Burtea, Nov 28 2019
  • Maple
    select(isprime, [3,seq(op([p^2-p-1,p^2-p+1,p^2+p-1,p^2+p+1]),p=select(isprime,[seq(i,i=3..1000,2)]))]); # Robert Israel, Nov 27 2019
  • Mathematica
    Select[Union[Flatten[{(#^2 + # + 1 ), (#^2 + # - 1 ), (#^2 - # + 1 ), (#^2 - # - 1 )}] &[Prime[Range[100]]]], (PrimeQ[#]) &]

A297868 Prime powers p^e with odd exponent e such that rho(p^(e+1)) is prime, where rho is A206369.

Original entry on oeis.org

8, 27, 32, 125, 243, 512, 1331, 2048, 32768, 50653, 79507, 103823, 131072, 161051, 177147, 357911, 1419857, 2097152, 2248091, 3869893, 11089567, 15813251, 16974593, 20511149, 28934443, 69343957, 115501303, 147008443, 263374721, 536870912, 844596301, 1284365503, 1305751357
Offset: 1

Views

Author

Michel Marcus, Jan 07 2018

Keywords

Comments

Along with A065508, these are the integers mentioned at the bottom of page 4 of the Iannucci link. Let x = p^e, and q = rho(p^(e+1)), then x/rho(x) = (x*p*q)/rho(x*p*q). An example with A065508 is 3, for which rho(3) is 7, so 3 and 3*3*7 have the same x/rho(x) ratio, 3/2.
Note that there are other "rho-friendly pairs" that have a different, yet simple, form like for instance 7^5 and 7^8*117307.
Number of terms < 10^k: 1, 3, 6, 8, 11, 16, 20, 26, 31, 46, 73, 110, 198, 327, 611, 1157, 2135, 4107, 7724, 14771, 28610, etc. - Robert G. Wilson v, Jan 07 2018

Examples

			8=2^3 is a term because rho(2*8)=11 is prime, so 8 and 8*2*11 have the same x/rho(x) ratio, 8/5.
		

Crossrefs

Programs

  • Mathematica
    rho[n_] := n*DivisorSum[n, LiouvilleLambda[#]/# &]; fQ[n_] := Block[{p = FactorInteger[n][[1, 1]]}, PrimeQ[ rho[p n]]]; mx = 10^9; lst = Sort@ Flatten@ Table[ Prime[n]^e, {n, PrimePi[mx^(1/3)]}, {e, 3, Floor@ Log[ Prime@ n, mx], 2}]; Select[lst, fQ] (* Robert G. Wilson v, Jan 07 2018 *)
  • PARI
    rhope(p, e) = my(s=1); for(i=1, e, s=s*p + (-1)^i); s;
    lista(nn) = {for (n=1, nn, if ((e = isprimepower(n,&p)) && (e > 1) && (e % 2) && isprime(rhope(p,e+1)), print1(n, ", ");););}
Showing 1-8 of 8 results.