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 31 results. Next

A166010 a(n) = prime(n)^2-4.

Original entry on oeis.org

0, 5, 21, 45, 117, 165, 285, 357, 525, 837, 957, 1365, 1677, 1845, 2205, 2805, 3477, 3717, 4485, 5037, 5325, 6237, 6885, 7917, 9405, 10197, 10605, 11445, 11877, 12765, 16125, 17157, 18765, 19317, 22197, 22797, 24645, 26565, 27885, 29925, 32037
Offset: 1

Views

Author

Keywords

Comments

Least common multiple of prime(n)-2 and prime(n)+2.

Crossrefs

Programs

  • Magma
    [NthPrime(n)^2-4: n in [1..41]]; // Bruno Berselli, Apr 17 2012
    
  • Mathematica
    f[n_]:=LCM[n-2,n+2]; lst={};Do[p=Prime[n];AppendTo[lst,f[p]],{n,5!}]; lst
    Prime[Range[5!]]^2 - 4 (* Zak Seidov, Apr 17 2012 *)
  • PARI
    a(n)=prime(n)^2-4 \\ Charles R Greathouse IV, Apr 17 2012

Formula

a(n) = A001248(n)-4 = A040976(n)*A052147(n). [Bruno Berselli, Apr 17 2012]

Extensions

Definition rewritten by Bruno Berselli, Apr 17 2012

A321348 a(n) = Sum_{d|n} tau(d^n), where tau() is the number of divisors (A000005).

Original entry on oeis.org

1, 4, 5, 15, 7, 64, 9, 52, 30, 144, 13, 546, 15, 256, 289, 165, 19, 1140, 21, 1386, 529, 576, 25, 3848, 78, 784, 166, 2610, 31, 32768, 33, 486, 1225, 1296, 1369, 12321, 39, 1600, 1681, 10248, 43, 85184, 45, 6210, 6486, 2304, 49, 24250, 150, 7956
Offset: 1

Views

Author

Ilya Gutkovskiy, Nov 06 2018

Keywords

Comments

a(n) is prime iff n is in A001359, which makes the sequence a supersequence of A006512. - Ivan N. Ianakiev, Nov 07 2018

Crossrefs

Programs

  • Magma
    [&+[NumberOfDivisors(d^n): d in Divisors(n)]: n in [1..50]]; // Vincenzo Librandi, Nov 08 2018
    
  • Maple
    with(numtheory): seq(coeff(series(add(tau(k^n)*x^k/(1-x^k),k=1..n),x,n+1), x, n), n = 1 .. 50); # Muniru A Asiru, Nov 25 2018
  • Mathematica
    Table[Sum[DivisorSigma[0, d^n], {d, Divisors[n]}], {n, 50}]
    a[n_] := Times @@ ((#[[2]] + 1) (n #[[2]] + 2)/2 & /@ FactorInteger[n]); a[1] = 1; Table[a[n], {n, 50}]
  • PARI
    a(n) = sumdiv(n, d, numdiv(d^n)); \\ Michel Marcus, Nov 06 2018
    
  • Python
    from math import prod
    from sympy import factorint
    def A321348(n): return prod((e+1)*(n*e+2)>>1 for e in factorint(n).values()) # Chai Wah Wu, Dec 13 2022

Formula

a(n) = [x^n] Sum_{k>=1} tau(k^n)*x^k/(1 - x^k).
If n = Product (p_j^k_j) then a(n) = Product ((k_j + 1)*(n*k_j + 2)/2).
a(prime(n)) = prime(n) + 2 = A052147(n). - Michel Marcus, Nov 25 2018

A049236 a(n) is the number of distinct prime factors of prime(n) + 2.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2, 1, 2, 1, 2, 1, 2, 2, 1, 2, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 2, 1, 2, 1, 2, 2, 3, 1, 2, 1, 2, 1, 3, 1, 2, 2, 2, 1, 3, 2, 1, 1, 2, 2, 2, 1, 3, 2, 1, 3, 2, 2, 1, 3, 2, 2, 2, 1, 2, 2, 1, 2, 2, 2, 3, 2, 3, 2, 2, 1, 2, 1, 3, 2, 2, 2, 2, 1, 3, 2, 2, 2, 2, 2, 2, 2, 1, 3, 2, 2, 2, 2, 1, 2
Offset: 1

Views

Author

Keywords

Examples

			prime(27) = 103, prime(27) + 2 = 105 = 3*5*7 has 3 prime factors, so a(27) = 3.
		

Crossrefs

Programs

  • Mathematica
    Table[Length[FactorInteger[Prime[n] + 2]], {n, 1, 50}] (* G. C. Greubel, May 12 2017 *)
  • PARI
    a(n) = omega(prime(n) + 2); \\ Amiram Eldar, Sep 16 2024

Formula

a(n) = A001221(A052147(n)). - Amiram Eldar, Sep 16 2024

A180172 a(n) = gcd(prime(n)+2, n).

Original entry on oeis.org

1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 11, 3, 1, 1, 1, 1, 1, 9, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 5, 1, 1, 1, 1, 1, 9, 1, 1, 13, 5, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, 5, 11, 1, 1, 1, 1, 71, 1, 1, 1, 3, 1, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 15, 7, 1, 3, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1
Offset: 1

Views

Author

Zak Seidov, Aug 15 2010

Keywords

Crossrefs

Programs

  • Magma
    [GCD(n,NthPrime(n) +2): n in [1..110]]; // G. C. Greubel, Mar 12 2023
    
  • Mathematica
    Table[GCD[n,Prime[n]+2],{n,200}]
  • SageMath
    [gcd(nth_prime(n) + 2, n) for n in range(1,111)] # G. C. Greubel, Mar 12 2023

A329727 Numbers k such that k^3 +- 2 and k +- 2 are prime.

Original entry on oeis.org

129, 1491, 1875, 2709, 5655, 6969, 10335, 14325, 14421, 17319, 26559, 35109, 37509, 43719, 50229, 52629, 101871, 102795, 104325, 105501, 120429, 127599, 132699, 136395, 137829, 157521, 172425, 173685, 179481, 186189, 191829, 211371, 219681, 221199, 229215, 234195
Offset: 1

Views

Author

K. D. Bajpai, Nov 19 2019

Keywords

Comments

All terms in this sequence are divisible by 3.

Examples

			a(1) = 129:
  129^3 + 2 = 2146691;
  129^3 - 2 = 2146687;
  129   + 2 =     131;
  129   - 2 =     127; all four results are prime.
a(2) = 1491:
  1491^3 + 2 = 3314613773;
  1491^3 - 2 = 3314613769;
  1491   + 2 =       1493;
  1491   - 2 =       1489; all four results are prime.
		

Crossrefs

Intersection of A038599, A067200, and A087679.

Programs

  • Magma
    [k:k in [1..250000]|forall{m:m in [-2,2]|IsPrime(k+m) and IsPrime(k^3+m)}]; // Marius A. Burtea, Nov 20 2019
    
  • Mathematica
    Select[Range[500000], PrimeQ[#^3 + 2] && PrimeQ[#^3 - 2] && PrimeQ[# + 2] && PrimeQ[# - 2] &]
  • PARI
    isok(k) = isprime(k-2) && isprime(k+2) && isprime(k^3-2) && isprime(k^3+2); \\ Michel Marcus, Nov 24 2019
    
  • PARI
    list(lim)=my(v=List(),p=127,k); forprime(q=131,lim+2,if(q-p==4 && isprime((k=p+2)^3-2) && isprime(k^3+2), listput(v,k)); p=q); Vec(v) \\ Charles R Greathouse IV, May 06 2020

A049563 a(n) = ((prime(n)-1)! + 1) mod (prime(n) + 2).

Original entry on oeis.org

2, 3, 4, 1, 7, 1, 10, 1, 1, 16, 1, 1, 22, 1, 1, 1, 31, 1, 1, 37, 1, 1, 1, 1, 1, 52, 1, 55, 1, 1, 1, 1, 70, 1, 76, 1, 1, 1, 1, 1, 91, 1, 97, 1, 100, 1, 1, 1, 115, 1, 1, 121, 1, 1, 1, 1, 136, 1, 1, 142, 1, 1, 1, 157, 1, 1, 1, 1, 175, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 211, 1, 217, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Keywords

Comments

Residue of (prime(n)-1)!+1 modulo prime(n)+2.

Examples

			a(3) = 4 since prime(3) = 5, and 4! + 1 = 25 gives residue 4 when divided by prime(3) + 2 = 7.
		

Crossrefs

Programs

  • Magma
    [(Factorial(p-1)+1) mod (p+2): p in PrimesUpTo(500)]; // Bruno Berselli, Apr 10 2015
    
  • Mathematica
    Table[Mod[(Prime[k] - 1)! + 1, Prime[k] + 2], {k, 1, 200}]
  • PARI
    a(n) = ((prime(n)-1)! + 1) % (prime(n) + 2); \\ Michel Marcus, May 28 2018
  • Sage
    [Mod(factorial(p-1)+1,p+2) for p in primes(500)] # Bruno Berselli, Apr 10 2015
    

Formula

a(n) = A060371(n) mod A052147(n). - Amiram Eldar, Mar 13 2025

A132705 For an integer n with prime factorization (p_1)*(p_2)*(p_3)* ... *(p_k), a(n) = (p_1+2)*(p_2+2)*(p_3+2)* ... *(p_k+2).

Original entry on oeis.org

2, 3, 4, 5, 16, 7, 20, 9, 64, 25, 28, 13, 80, 15, 36, 35, 256, 19, 100, 21, 112, 45, 52, 25, 320, 49, 60, 125, 144, 31, 140, 33, 128, 65, 76, 63, 400, 49, 84, 75, 448, 43, 180, 45, 208, 175, 100, 49, 1280, 81, 196, 95, 240, 55, 500, 91, 576, 105, 124, 60
Offset: 0

Views

Author

Jonathan Vos Post, Nov 16 2007

Keywords

Comments

a(0)=2 and a(1)=3 by convention. For an integer n with prime factorization prime(i_1)*prime(i_2)*prime(i_3)* ... *prime(i_k), a(n) = A052147(i_1)*A052147(i_2)*A052147(i_3)* ... *A052147(i_k). This sequence is to p+2 as A064478 is to p+1 for primes p.
If a(1) were 1 rather than 3, the sequence would be completely multiplicative with a(p) = p + 2. - Charles R Greathouse IV, Sep 02 2009

Crossrefs

Programs

  • Python
    from math import prod
    from sympy import factorint
    def A132705(n): return prod((p+2)**e for p,e in factorint(n).items()) if n!=1 else 3 # Chai Wah Wu, Mar 26 2025

A216945 Numbers k such that k-2, k^2-2, k^3-2, k^4-2 and k^5-2 are all prime.

Original entry on oeis.org

15331, 289311, 487899, 798385, 1685775, 1790991, 1885261, 1920619, 1967925, 2304805, 2479735, 3049201, 3114439, 3175039, 3692065, 4095531, 4653649, 5606349, 5708235, 6113745, 6143235, 6697425, 7028035, 7461601, 8671585, 8997121, 9260131, 10084915, 10239529
Offset: 1

Views

Author

Michel Lagneau, Sep 20 2012

Keywords

Comments

k^6-2 is also prime for k = 1685775, 4095531, 4653649, 5606349, 13219339, 13326069, 18439561, ...
Sequence is infinite under Schinzel's Hypothesis H. a(n) >> n log^5 n. - Charles R Greathouse IV, Sep 20 2012

Crossrefs

Programs

  • Mathematica
    Select[Range[20000000], And@@PrimeQ/@(Table[n^i-2, {i, 1, 5}]/.n->#)&]
    Select[Prime[Range[680000]]+2,AllTrue[#^Range[2,5]-2,PrimeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Sep 11 2020 *)

Formula

Sequence is A052147 intersection A028870 intersection A038599 intersection A154831 intersection A154833.

A334971 a(n) is the least prime p such that p+2 is divisible by n-th prime.

Original entry on oeis.org

2, 7, 3, 5, 31, 11, 83, 17, 67, 317, 29, 109, 367, 41, 139, 157, 293, 59, 199, 211, 71, 709, 911, 443, 677, 503, 101, 2459, 107, 337, 379, 653, 409, 137, 743, 149, 1097, 487, 499, 863, 1609, 179, 571, 191, 983, 197, 631, 1559, 6581, 227, 1163, 1193, 239, 751
Offset: 1

Views

Author

Zak Seidov, May 18 2020

Keywords

Examples

			a(1) = 2 because 2+2=4 is divisible by 2 (1st prime),
a(2) = 7 because 7+2=9 is divisible by 3 (2nd prime),
a(3) = 3 because 3+2=5 is divisible by 5 (3rd prime).
		

Crossrefs

Cf. A052147.

Programs

  • PARI
    a(n) = my(p=2); while ((p+2) % prime(n), p=nextprime(p+1)); p; \\ Michel Marcus, May 18 2020

A384488 Numbers k having a divisor d such that d - k/d is prime.

Original entry on oeis.org

3, 4, 6, 8, 10, 12, 14, 15, 18, 20, 24, 26, 28, 30, 32, 35, 36, 38, 40, 42, 44, 48, 50, 54, 60, 62, 63, 66, 68, 70, 72, 74, 78, 80, 84, 86, 88, 90, 92, 96, 98, 99, 102, 104, 108, 110, 114, 120, 122, 126, 128, 130, 132, 138, 140, 143, 144, 146, 150, 152, 154, 158, 162, 164, 168, 170, 174, 176, 180
Offset: 1

Views

Author

Juri-Stepan Gerasimov, May 30 2025

Keywords

Comments

Presumably, all odd terms are in A000466.

Examples

			a(6) = 12 is a term because 12 = 1*12 with 12 - 1 = 11 prime.
		

Crossrefs

Cf. A000466, A005408, A355643. Includes A005563 and 2 * A052147.

Programs

  • Magma
    [k: k in [1..180] | not #[d: d in Divisors (k) | IsPrime(d-(k div d))] eq 0];
    
  • Maple
    filter:= k -> ormap(d -> d^2 > k and isprime(d - k/d), numtheory:-divisors(k)):
    select(filter, [$1..200]); # Robert Israel, Jun 30 2025
  • Mathematica
    A384488Q[k_] := AnyTrue[Divisors[k], PrimeQ[# - k/#] &];
    Select[Range[200], A384488Q] (* Paolo Xausa, Jun 30 2025 *)
  • PARI
    isok(k) = fordiv(k, d, if (isprime(d - k/d), return(1))); \\ Michel Marcus, Jun 01 2025
Previous Showing 21-30 of 31 results. Next