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

A115103 Primes p such that p-1 and p+1 have the same number of prime factors with multiplicity.

Original entry on oeis.org

5, 19, 29, 43, 67, 89, 151, 173, 197, 233, 271, 283, 307, 317, 349, 461, 491, 569, 571, 593, 653, 701, 739, 751, 787, 857, 859, 907, 919, 1013, 1061, 1097, 1277, 1291, 1303, 1483, 1667, 1747, 1831, 1867, 1889, 1913, 1973, 2003, 2083, 2131, 2311, 2357, 2393
Offset: 1

Views

Author

Cino Hilliard, Mar 02 2006

Keywords

Examples

			19-1 = 2*3*3 has 3 factors. 19+1 = 2*2*5 has 3 factors. So 19 is in the table.
		

Crossrefs

Cf. A067386 (without multiplicity), A323498, A323536, A323537.

Programs

  • Maple
    isA115103 := proc(n)
        if not type(n,prime) then
            return false;
        end if;
        if numtheory[bigomega](n-1) <> numtheory[bigomega](n+1) then
            false;
        else
            true ;
        end if ;
    end proc:
    for n from 2 to 3000 do
        if isA115103(n) then
            printf("%d,",n) ;
        end if;
    end do: # R. J. Mathar, Feb 13 2019
    # second Maple program:
    q:= p-> isprime(p) and (f-> f(p+1)=f(p-1))(numtheory[bigomega]):
    select(q, [$1..3000])[];  # Alois P. Heinz, May 08 2022
  • Mathematica
    Select[Prime[Range[400]],PrimeOmega[#-1]==PrimeOmega[#+1]&] (* Harvey P. Dale, Apr 26 2014 *)
  • PARI
    g(n) = forprime(x=1,n,p1=bigomega(x-1);p2=bigomega(x+1);if(p1==p2,print1(x",")))

A284037 Primes p such that p-1 and p+1 have two distinct prime factors.

Original entry on oeis.org

11, 13, 19, 23, 37, 47, 53, 73, 97, 107, 163, 193, 383, 487, 577, 863, 1153, 2593, 2917, 4373, 8747, 995327, 1492993, 1990657, 5308417, 28311553, 86093443, 6879707137, 1761205026817, 2348273369087, 5566277615617, 7421703487487, 21422803359743, 79164837199873
Offset: 1

Views

Author

Giuseppe Coppoletta, Mar 28 2017

Keywords

Comments

Either p-1 or p+1 must be of the form 2^i * 3^j, since among three consecutive numbers exactly one is a multiple of 3. - Giovanni Resta, Mar 29 2017
Subsequence of A219528. See the previous comment. - Jason Yuen, Mar 08 2025

Examples

			7 is not a term because n + 1 = 8 has only one prime factor.
23 is a term because it is prime and n - 1 = 22 has two distinct prime factors (2, 11) and n + 1 = 24 has two distinct prime factors (2, 3).
43 is not a term because n - 1 = 42 has three distinct prime factors (2, 3, 7).
		

Crossrefs

Programs

  • Maple
    N:= 10^20: # To get all terms <= N
    Res:= {}:
    for i from 1 to ilog2(N) do
      for j from 1 to floor(log[3](N/2^i)) do
        q:= 2^i*3^j;
        if isprime(q-1) and nops(numtheory:-factorset((q-2)/2^padic:-ordp(q-2,2)))=1 then Res:= Res union {q-1} fi;
        if isprime(q+1) and nops(numtheory:-factorset((q+2)/2^padic:-ordp(q+2,2)))=1 then Res:= Res union {q+1} fi
    od od:
    sort(convert(Res,list)); # Robert Israel, Apr 16 2017
  • Mathematica
    mx = 10^30; ok[t_] := PrimeQ[t] && PrimeNu[t-1]==2==PrimeNu[t+1]; Sort@ Reap[Do[ w = 2^i 3^j; Sow /@ Select[ w+ {1,-1}, ok], {i, Log2@ mx}, {j, 1, Log[3, mx/2^i]}]][[2, 1]] (* terms up to mx, Giovanni Resta, Mar 29 2017 *)
  • PARI
    isok(n) = isprime(n) && (omega(n-1)==2) && (omega(n+1)==2); \\ Michel Marcus, Apr 17 2017
  • Sage
    omega=sloane.A001221; [n for n in prime_range(10^6) if 2==omega(n-1)==omega(n+1)]
    
  • Sage
    sorted([2^i*3^j+k for i in (1..40) for j in (1..20) for k in (-1,1) if is_prime(2^i*3^j+k) and sloane.A001221(2^i*3^j+2*k)==2])
    

Formula

A001221(a(n)) = 1 and A001221(a(n) - 1) = A001221(a(n) + 1) = 2.

Extensions

a(33)-a(34) from Giovanni Resta, Mar 29 2017

A353123 a(n) is the first prime p for which the absolute value of the difference between the numbers of distinct prime factors of p+1 and p-1 is exactly n.

Original entry on oeis.org

3, 2, 31, 2309, 8191, 746129, 16546531, 300690389, 11823922111, 239378649509, 11003163441269, 304250263527209, 23293697005168589
Offset: 0

Views

Author

Yusuf Gurtas, May 08 2022

Keywords

Comments

If a given prime p is less than a(n) then the numbers of distinct prime factors of p+1 and p-1 have a difference less than n.
From Daniel Suteu, May 11 2022: (Start)
a(13) <= 693386350578511591,
a(14) <= 42296567385289206991,
a(15) <= 3291505006196194517729,
a(16) <= 222099275340153625904489,
a(17) <= 12592092354842984193179971,
a(18) <= 873339227295479848905071071,
a(19) <= 54536351988824964540662450069,
a(20) <= 5513390541916364286137713664909. (End)
From Jon E. Schoenfield, May 11 2022: (Start)
For n > 1, if there exists any prime p < 2*prime(n+2)# such that the absolute difference of the numbers of distinct prime factors of p+1 and p-1 is exactly n, then (since a(n) <= p) it follows that a(n)+1 and a(n)-1, in some order, are either (1) a power of 2, and 2 times an odd number with n distinct prime factors, or (2) an odd prime times a power of 2, and the product of n+2 distinct primes. (In the first case, the numbers of distinct prime factors are 1 and n+1; in the second, they are 2 and n+2.)
E.g., for n = 6, given that p = 18888871 is a prime < 19399380 = 2*(2*3*5*7*11*13*17*19) and the prime factorizations of p+1 and p-1 are 2^3 * 2361109 and 2*3*5*7*11*13*17*37, then a(6)+1 must be too small to have more than 8 distinct prime factors, and also too small to have exactly 8 distinct prime factors with any factor having a multiplicity greater than 1. Thus, a(6) is the smallest prime p such that p+1 and p-1, in some order, are either (1) a power of 2, and 2 times an odd number with 6 distinct prime factors, or (2) a prime times a power of 2, and the product of 8 distinct primes. (As it turns out, a(6) = 16546531, so a(6) + 1 = 2^2 * 4136633 (2 distinct prime factors) and a(6) - 1 = 2*3*5*7*11*13*19*29 (8 distinct prime factors).)
For each n in 2..100, there exists such a prime p < 2*prime(n+2)#, so the numbers of distinct prime factors of a(n)+1 and a(n)-1 are, in some order, 1 and n+1 or 2 and n+2.
For n <= 100, the maximum value of a(n)/prime(n+2)# is a(16)/prime(18)# = 1.893617....
(End)

Examples

			a(2) = 31 because the number of distinct prime factors of 32 is 1 and the number of distinct prime factors of 30 is 3, giving a difference of 2. No prime less than 31 has this property.
		

Crossrefs

Cf. A067386.

Programs

  • PARI
    isok(p, n) = abs(omega(p-1)-omega(p+1)) == n;
    a(n) = my(p=2); while (!isok(p,n), p=nextprime(p+1)); p; \\ Michel Marcus, May 09 2022

Extensions

a(7)-a(8) from Amiram Eldar, May 08 2022
a(9)-a(10) from Yusuf Gurtas, May 08 2022
a(11) from Yusuf Gurtas, May 09 2022
a(9) corrected by Yusuf Gurtas, May 09 2022
a(12) from Yusuf Gurtas, May 09 2022
Showing 1-3 of 3 results.