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

A097375 Duplicate of A089189.

Original entry on oeis.org

2, 3, 5, 7, 11, 13, 19, 23, 29, 31, 37, 43, 47, 53, 59, 61, 67, 71, 79, 83, 101, 103, 107, 127, 131, 139, 149, 151, 157, 167, 173, 179, 181, 191, 197, 199, 211, 223, 227, 229, 239, 263, 269, 277, 283, 293, 307, 311, 317, 331, 347, 349, 359, 367, 373, 383, 389
Offset: 1

Views

Author

Keywords

A089194 Primes p such that p-1 and p+1 are cube- or higher power-free.

Original entry on oeis.org

2, 3, 5, 11, 13, 19, 29, 37, 43, 59, 61, 67, 83, 101, 131, 139, 149, 157, 173, 179, 181, 197, 211, 227, 229, 277, 283, 293, 307, 317, 331, 347, 349, 373, 389, 397, 419, 421, 443, 461, 467, 491, 509, 523, 547, 557, 563, 571, 587, 613, 619, 643, 653, 659, 661
Offset: 1

Views

Author

Cino Hilliard, Dec 08 2003

Keywords

Comments

A212793(a(n) - 1) = A212793(a(n) + 1) = 1. - Reinhard Zumkeller, May 27 2012

Examples

			43 is included because 43 - 1 = 2 * 3 * 7 and 43 + 1 = 2^2 * 11 are both cubefree.
71 is omitted because the p+1 side, 72 = 2^3 * 3^2, has a cube factor.
		

Crossrefs

Cf. A004709. Subsequence of A089189.

Programs

  • Haskell
    a089194 n = a089194_list !! (n-1)
    a089194_list = filter ((== 1) . a212793 . (+ 1)) a097375_list
    -- Reinhard Zumkeller, May 27 2012
  • Maple
    isA089194 := proc(n)
        if isprime(n) then
            isA004709(n-1) and isA004709(n+1) ;
        else
            false;
        end if;
    end proc: # R. J. Mathar, Dec 08 2015
  • Mathematica
    f[n_]:=Module[{a=m=0},Do[If[FactorInteger[n][[m,2]]>2,a=1],{m,Length[FactorInteger[n]]}];a]; lst={};Do[p=Prime[n];If[f[p-1]==0&&f[p+1]==0,AppendTo[lst,p]],{n,6!}];lst (* Vladimir Joseph Stephan Orlovsky, Jul 15 2009 *)
    p3fQ[n_]:=Max[Transpose[FactorInteger[n]][[2]]]<3; Select[Prime[Range[ 200]], AllTrue[#+{1,-1},p3fQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Apr 08 2015 *)
  • PARI
    \\ input number of iterations n, power p and the number to subtract k.
    powerfreep2(n,p,d) = { c=0; pc=0; forprime(x=2,n, pc++; if(ispowerfree(x-d,p) && ispowerfree(x+d,p), c++; print1(x","); ) ); print(); print(c","pc","c/pc+.0) }
    ispowerfree(m,p1) = { flag=1; y=component(factor(m),2); for(i=1,length(y), if(y[i] >= p1,flag=0;break); ); return(flag) }
    

Formula

{p in A000040: p+1 in A004709 and p-1 in A004709}. - R. J. Mathar, Dec 08 2015

A162870 Primes p such that p-1 and p+1 each contain at least one cubed prime in their prime factorization.

Original entry on oeis.org

919, 1999, 2647, 2663, 2969, 3511, 3833, 3943, 4751, 6857, 9127, 10313, 11287, 11719, 12041, 12583, 13033, 13337, 13879, 14249, 14633, 15497, 15607, 16903, 18089, 18199, 18251, 18521, 19751, 20249, 20359, 20681, 21751, 21977, 22409
Offset: 1

Views

Author

Keywords

Comments

The selection criterion is that p-1 and p+1 are in the subsequence 8=2^3, 24=2^3*3, 27=3^3, 40=2^3*5, 54=2*3^3,... of cubeful numbers (A046099) which actually display at least one cube in their standard prime factorization (A176297).
So at least one of the e_i in p-1=product p_i^e_i, and at least one of the e_j in p+1=product p_j^e_j must equal 3. This is more restrictive than being cubeful, so the sequence becomes a subsequence of A086708.

Examples

			271 is not in the sequence although 271 - 1 = 2*3^3*5 contains a third cube in the prime factorization, because 271 + 1 = 2^4*17 does not.
919 is in the sequence because 919 - 1 = 2*3^3*17 contains a third cube in the prime factorization and so does 919 + 1 = 2^3*5*23.
		

Crossrefs

Programs

  • Maple
    isA162870 := proc(n)
        if isprime(n) then
            isA176297(n-1) and isA176297(n+1) ;
        else
            false;
        end if;
    end proc:
    for n from 1 to 40000 do
        if isA162870(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Dec 08 2015
    N:= 10^6: # to get all terms < N, where N is even
    V:= Vector(N/2):
    for i from 1 do
      p:= ithprime(i);
      if p^3 > N+1 then break fi;
      if p = 2 then inds:= 4*[seq(i,i=1..floor(N/8),2)]
      else inds:= p^3*select(t -> t mod p <> 0, [$1..floor(N/2/p^3)])
      fi;
      V[inds]:= 1;
    od:
    select(t -> V[(t-1)/2] = 1 and V[(t+1)/2] = 1 and isprime(t), [seq(t,t=3..N,2)]); # Robert Israel, Dec 08 2015
  • Mathematica
    f[n_]:=Module[{a=m=0},Do[If[FactorInteger[n][[m,2]]==3,a=1],{m,Length[FactorInteger[n]]}]; a]; lst={};Do[p=Prime[n];If[f[p-1]==1&&f[p+1]==1,AppendTo[lst,p]], {n,7!}];lst

Extensions

Role of cubefree numbers clarified by R. J. Mathar, Jul 31 2007

A097380 Numbers m such that 1+CubeFreeKernel(m) is prime.

Original entry on oeis.org

1, 2, 4, 6, 8, 10, 12, 16, 18, 22, 24, 28, 30, 32, 36, 42, 46, 48, 52, 54, 56, 58, 60, 64, 66, 70, 72, 78, 82, 96, 100, 102, 104, 106, 108, 112, 120, 126, 128, 130, 138, 144, 148, 150, 156, 162, 166, 172, 178, 180, 190, 192, 196, 198, 200, 208, 210, 216, 222, 224, 226
Offset: 1

Views

Author

Reinhard Zumkeller, Aug 11 2004

Keywords

Examples

			m = 216 = (2*3)^3 -> A097377(216) = 1+(2*3)^2 = 37 = A000040(12), therefore 216 is a term.
		

Crossrefs

Programs

  • Mathematica
    f[p_, e_] := p^Min[e, 2]; s[1] = 2; s[n_] := 1 + Times @@ f @@@ FactorInteger[n]; Select[Range[230], PrimeQ[s[#]] &] (* Amiram Eldar, Feb 01 2024 *)
  • PARI
    is(n) = {my(f = factor(n)); isprime(1 + prod(i = 1, #f~, f[i, 1]^min(f[i, 2], 2)));} \\ Amiram Eldar, Feb 01 2024

Formula

A097377(a(n)) = A007948(a(n))+1 is prime.

A162873 List of pairs (p,r) of twin primes p and r=p+2 such that p-1, p+1 and r+1 are all divisible by squares > 1.

Original entry on oeis.org

17, 19, 149, 151, 197, 199, 269, 271, 521, 523, 809, 811, 881, 883, 1049, 1051, 1061, 1063, 1277, 1279, 1949, 1951, 1997, 1999, 2141, 2143, 2549, 2551, 2789, 2791, 2969, 2971, 3257, 3259, 3329, 3331, 3581, 3583, 3821, 3823, 4049, 4051, 4157, 4159, 4229, 4231
Offset: 1

Views

Author

Keywords

Examples

			(197,199) is a pair because all of 196, 198, and 200 are divisible by squares.
		

Crossrefs

Programs

  • Mathematica
    dsQ[n_] := Length[Select[FactorInteger[n][[All, 2]], # > 1 &]] > 0; Select[ Partition[ Prime[ Range[ 250]],2,1],#[[2]]-#[[1]]==2&&AllTrue[ #[[1]]+ {-1,1,3},dsQ]&]//Flatten (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Nov 28 2018 *)

Extensions

Corrected and previous (incorrect) Mathematica program replaced by Harvey P. Dale, Nov 28 2018

A113823 Tribonacci analog of A055502.

Original entry on oeis.org

0, 2, 3, 7, 13, 29, 53, 97, 181, 337, 617, 1151, 2111, 3881, 7151, 13147, 24181, 44483, 81817, 150497, 276817, 509137, 936469, 1722431, 3168097, 5827001, 10717561, 19712669, 36257237, 66687469, 122657377, 225602099, 414946951, 763206467, 1403755531, 2581909003
Offset: 0

Views

Author

Jonathan Vos Post, Jan 23 2006

Keywords

Comments

This is to the tribonacci sequence as A055502 is to the Fibonacci sequence (i.e. least prime greater than the sum of the previous 2 terms in A055502, least prime greater than the sum of the previous 3 terms in this sequence).
The first 9 positive terms are also elements of A089189 but that coincidence breaks down as a(10) = 617 is a prime p, but p-1 = 616 = 2^3 * 7 * 11 is not cubefree.

Crossrefs

Programs

  • Mathematica
    a[0] = 0; a[1] = 2; a[2] = 3; a[n_] := a[n] = NextPrime[a[n-1] + a[n-2] + a[n-3]]; Array[a, 40, 0] (* Amiram Eldar, Sep 24 2023 *)

Formula

a(0) = 0, a(1) = 2, for n>2: a(n) = smallest prime > a(n-1)+a(n-2)+a(n-3).

Extensions

More terms from Amiram Eldar, Sep 24 2023

A162874 Twin primes p and r (p < r) such that p-1, p+1 and r+1 are not cubefree.

Original entry on oeis.org

69497, 69499, 416501, 416503, 474497, 474499, 632501, 632503, 960497, 960499, 1068497, 1068499, 1226501, 1226503, 1402871, 1402873, 1464101, 1464103, 1635497, 1635499, 1716497, 1716499, 1919429, 1919431, 1986497, 1986499
Offset: 1

Views

Author

Keywords

Comments

A variant of A162989, which is the main entry. - N. J. A. Sloane, Aug 12 2009
Note that p+1 = r-1. Thus, the sequence describes twin primes whose immediate neighbors are not cubefree. - Tanya Khovanova, Aug 22 2021

Examples

			69497 and 69499 twin primes. Moreover, 69496 is divisible by 2^3, 69498 is divisible by 3^3, and 69500 is divisible by 5^3. Thus, 69497 and 69499 are in the sequence. - _Tanya Khovanova_, Aug 22 2021
		

Crossrefs

Programs

  • Mathematica
    s=Select[Prime@Range[200000],PrimeQ[#+2]&&Min[Max[Last/@FactorInteger[#]]&/@{#-1,#+1,#+3}]>2&];Sort@Join[s,s+2] (* Giorgos Kalogeropoulos, Aug 22 2021 *)
  • Python
    from sympy import nextprime, factorint
    def cubefree(n): return max(e for e in factorint(n).values()) <= 2
    def auptop(limit):
        alst, p, r = [], 3, 5
        while p < limit:
            if r - p == 2 and not any(cubefree(i) for i in [p-1, p+1, r+1]):
                alst.extend([p, r])
            p, r = r, nextprime(p)
        return alst
    print(auptop(2*10**6)) # Michael S. Branicky, Aug 22 2021

Extensions

Terms corrected by Zak Seidov, Jul 19 2009
Edited by N. J. A. Sloane, Aug 12 2009

A162875 Twin primes p and r such that p - 1, p + 1 and r + 1 are cubefree.

Original entry on oeis.org

3, 5, 11, 13, 59, 61, 179, 181, 227, 229, 347, 349, 419, 421, 659, 661, 827, 829, 1019, 1021, 1091, 1093, 1427, 1429, 1451, 1453, 1667, 1669, 1787, 1789, 1931, 1933, 2027, 2029, 2339, 2341, 3299, 3301, 3371, 3373, 3467, 3469, 3539, 3541, 3851, 3853, 4019
Offset: 1

Views

Author

Keywords

Comments

Apart from the first two terms, a(2n+1) = 11 mod 24 and a(2n) = 13 (mod 24). - Charles R Greathouse IV, Oct 12 2009

Examples

			179 and 181 are in the sequence because they are twin primes and 178 = 2*89, 180 = 2^2*3^2*5, 182 = 2*7*13 have no factors that are cubes.
		

Crossrefs

Programs

  • Mathematica
    f[n_]:=Module[{a=m=0},Do[If[FactorInteger[n][[m,2]]>2,a=1],{m,Length[FactorInteger[n]]}];a]; lst={};Do[p=Prime[n];r=p+2;If[PrimeQ[r],If[f[p-1]==0&&f[p+1]==0&&f[r+1]==0,AppendTo[lst,p];AppendTo[lst,r]]],{n,2*6!}];lst

A089191 Primes p such that p+1 is cubefree.

Original entry on oeis.org

2, 3, 5, 11, 13, 17, 19, 29, 37, 41, 43, 59, 61, 67, 73, 83, 89, 97, 101, 109, 113, 131, 137, 139, 149, 157, 163, 173, 179, 181, 193, 197, 211, 227, 229, 233, 241, 251, 257, 277, 281, 283, 293, 307, 313, 317, 331, 337, 347, 349, 353, 373, 379, 389, 397, 401, 409
Offset: 1

Views

Author

Cino Hilliard, Dec 08 2003

Keywords

Comments

The ratio of the count of primes p <= n such that p+1 is cubefree to the count of primes <= n converges to 0.69+ slightly higher than the p-1 variety.
More accurately, the density of this sequence within the primes is Product_{p prime} (1-1/(p^2*(p-1))) = 0.697501... (A065414) (Mirsky, 1949). - Amiram Eldar, Feb 16 2021

Examples

			43 is included because 43+1 = 2^2*11.
71 is omitted because 71+1 = 2^3*3^2.
		

Crossrefs

Programs

  • Maple
    filter:= t -> isprime(t) and max(map(s -> s[2], ifactors(t+1)[2]))<3:
    select(filter, [2,seq(i,i=3..1000,2)]); # Robert Israel, Mar 18 2018
  • Mathematica
    Select[Prime[Range[100]],Max[Transpose[FactorInteger[#+1]][[2]]]<3&] (* Harvey P. Dale, Jun 06 2013 *)
  • PARI
    is(n) = isprime(n) && vecmax(factor(n+1)[,2]) < 3 \\ Amiram Eldar, Feb 16 2021

A162876 Twin prime pairs p, p+2 such that p-1 and p+3 are both squarefree.

Original entry on oeis.org

3, 5, 11, 13, 59, 61, 71, 73, 107, 109, 179, 181, 191, 193, 227, 229, 311, 313, 419, 421, 431, 433, 599, 601, 659, 661, 827, 829, 1019, 1021, 1031, 1033, 1091, 1093, 1319, 1321, 1427, 1429, 1487, 1489, 1607, 1609, 1619, 1621, 1787, 1789, 1871, 1873, 1931
Offset: 1

Views

Author

Keywords

Comments

By definition, the lower member, here at the odd-indexed positions, is in A089188.
p+1 must be divisible by 4. - Robert Israel, Jul 24 2015

Examples

			(179,181) are in the sequence because 179-1=2*89 is squarefree and 181+1=2*7*13 is also squarefree.
		

Crossrefs

Programs

  • Maple
    f:= p -> if isprime(p) and isprime(p+2) and numtheory:-issqrfree(p-1) and numtheory:-issqrfree(p+3) then (p,p+2) else NULL fi:
    map(f, [4*k-1 $ k=1..1000]); # Robert Israel, Jul 24 2015
  • Mathematica
    f[n_]:=Module[{a=m=0},Do[If[FactorInteger[n][[m,2]]>1,a=1],{m,Length[FactorInteger[n]]}]; a]; lst={};Do[p=Prime[n];r=p+2;If[PrimeQ[r],If[f[p-1]==0&&f[r+1]==0, AppendTo[lst,p];AppendTo[lst,r]]],{n,7!}];lst

Formula

{(p,p+2) : p in A001359, and p-1 in A005117, and p+3 in A005117}.

Extensions

Definition rephrased by R. J. Mathar, Jul 27 2009
Showing 1-10 of 10 results.