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.

User: Najeem Ziauddin

Najeem Ziauddin's wiki page.

Najeem Ziauddin has authored 9 sequences.

A380961 Primes prime(k) such that (prime(k) + prime(k+1)) mod (prime(k) - prime(k-1)) != 0.

Original entry on oeis.org

53, 97, 127, 157, 173, 191, 211, 223, 251, 257, 263, 307, 331, 347, 367, 373, 397, 401, 409, 431, 457, 467, 479, 487, 491, 499, 509, 541, 563, 593, 607, 641, 653, 673, 709, 719, 727, 733, 743, 751, 761, 769, 787, 797, 821, 839, 853, 877, 887, 907, 911, 929, 937, 947, 967, 977, 991, 997, 1009, 1031, 1061, 1069, 1103, 1123
Offset: 1

Author

Najeem Ziauddin, Feb 09 2025

Keywords

Comments

It seems that the proportion of primes in the sequence, among all primes, increases with larger terms (perhaps to the point where almost all primes are terms?).

Examples

			prime(16) = 53 is a term since (53+59) mod (53-47) != 0.
prime(3) = 5 is not a term since (5+7) mod (5-3) = 0.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[2,188]],Mod[#+NextPrime[#],(#-NextPrime[#,-1])]!=0&] (* James C. McMahon, Feb 23 2025 *)

A367479 a(n) is the number of steps required for prime(n) to reach 2 when iterating the following hailstone map: If P == 5 (mod 6), then P -> next_prime(P + ceiling(sqrt(P))), otherwise P -> previous_prime(ceiling(sqrt(P))); or a(n) = -1 if prime(n) never reaches 2.

Original entry on oeis.org

0, 1, 8, 2, 7, 2, 6, 9, 5, 4, 9, 3, 5, 3, 5, 4, 4, 3, 3, 5, 3, 3, 4, 11, 3, 10, 8, 9, 8, 9, 8, 5, 5, 8, 4, 3, 3, 3, 4, 5, 4, 3, 4, 3, 4, 3, 3, 3, 15, 3, 15, 9, 3, 14, 8, 9, 13, 7, 7, 8, 7, 12, 7, 11, 7, 11, 10, 10, 11, 10, 11, 11
Offset: 1

Author

Najeem Ziauddin, Nov 19 2023

Keywords

Comments

next_prime(x) is the next prime >= x, and previous_prime(x) is the next prime <= x.
Conjecture: This hailstone operation on prime numbers will always reach 2.
The map does not go into a loop for any starting prime.

Examples

			For n=1, prime(1)=2, requires a(1)=0 steps to reach 2.
For n=2, prime(2)=3, requires a(2)=1 step: 3 -> 2.
For n=3, prime(3)=5, requires a(3)=8 steps: 5 -> 11 -> 17 -> 23 -> 29 -> 37 -> 7 -> 3 -> 2.
		

Crossrefs

Cf. A007528.
Similar sequence: A365048.

Programs

  • Python
    from sympy import nextprime, prevprime
    from math import isqrt
    def hailstone(prime):
        if (prime + 1) % 6 == 0:
            jump = prime + isqrt(prime-1) + 1
            jump = nextprime(jump - 1)
        else:
            jump = isqrt(prime-1) + 1
            jump = prevprime(jump + 1)
        return jump
    def a(n):
        p = nextprime(1,n)
        count = 0
        while p != 2:
            p = hailstone(p)
            count += 1
        return count

A366644 Primes p such that p + q +- 1 and p^3 + q^3 +- 1 are twin prime pairs, where q = nextprime(p).

Original entry on oeis.org

1693, 3329, 3469, 13523, 23899, 24551, 33589, 37579, 44221, 47459, 75659, 81929, 91009, 103981, 136621, 195493, 365293, 637669, 652573, 787513, 842341, 902449, 1181053, 1290319, 1291603, 1349683, 1802641, 1858891, 1869709, 1870441, 1978411, 2295121, 2414771
Offset: 1

Author

Najeem Ziauddin, Oct 15 2023

Keywords

Examples

			1693 is in the sequence since
  1693   + 1697   - 1 =       3389 is prime,
  1693   + 1697   + 1 =       3391 is prime,
  1693^3 + 1697^3 - 1 = 9739595429 is prime, and
  1693^3 + 1697^3 + 1 = 9739595431 is prime.
3329 is in the sequence since
  3329   + 3331   - 1 =        6659 is prime,
  3329   + 3331   + 1 =        6661 is prime,
  3329^3 + 3331^3 - 1 = 73852093979 is prime, and
  3329^3 + 3331^3 + 1 = 73852093981 is prime.
		

Crossrefs

Cf. A000040.

Programs

  • PARI
    isok(p)={if(isprime(p), my(q=nextprime(p+1), y=p+q, z=p^3+q^3); isprime(y-1) && isprime(y+1) && isprime(z-1) && isprime(z+1), 0)}
    { forprime(p=1, 3*10^6, if(isok(p), print1(p, ", "))) } \\ Andrew Howroyd, Oct 15 2023

A365048 a(n) is the number of steps required for the n-th odd prime number to reach 3 when iterating the following hailstone map: If P+1 == 0 (mod 6), then the next number = smallest prime >= P + (P-1)/2; otherwise the next number = largest prime <= (P+1)/2.

Original entry on oeis.org

0, 2, 1, 6, 2, 5, 2, 4, 4, 3, 3, 5, 3, 8, 5, 13, 4, 4, 7, 4, 4, 6, 12, 9, 6, 9, 6, 6, 14, 5, 8, 11, 5, 8, 5, 5, 5, 16, 13, 13, 13, 13, 10, 7, 10, 10, 7, 15, 15, 15, 12, 15, 15, 12, 12, 12, 9, 6, 12, 6, 12, 6, 17, 6, 14, 6, 17, 14, 14, 11, 11, 14, 14, 14, 8, 11, 11, 14, 11, 8, 11, 16
Offset: 1

Author

Najeem Ziauddin, Oct 21 2023

Keywords

Comments

Conjecture: This hailstone operation on odd prime numbers will always reach 3.
If the condition "(P + (P-1)/2)" is changed to "(P + (P+1)/2)" then some prime numbers will go into a loop. For example, 449 will loop through 2609.
If the condition "(P+1)/2" is changed to "(P+3)/2" then some prime numbers will go into a loop. For example, 5 will go into the loop 5,7,5,7,....

Examples

			Case 3: 0 steps required.
Case 5: 2 steps required: 5,7,3.
Case 7: 1 step required: 7,3.
Case 11: 6 steps required: 11,17,29,43,19,7,3.
case 17: 5 steps required: 17,29,43,19,7,3.
		

Crossrefs

Cf. A007528, A065091 (odd primes).

Programs

  • Mathematica
    A365048[n_]:=Length[NestWhileList[If[Divisible[#+1,6],NextPrime[#+(#-1)/2-1],NextPrime[(#+1)/2+1,-1]]&,Prime[n+1],#>3&]]-1;Array[A365048,100] (* Paolo Xausa, Nov 13 2023 *)
  • Python
    from sympy import nextprime, prevprime
    def hailstone(prime):
      if (prime + 1) % 6 == 0:
         jump = prime + ((prime - 1) / 2)
         jump = nextprime(jump - 1)
      else:
         jump = ((prime + 1) / 2)
         jump = prevprime(jump + 1)
      return jump
    q = 2
    lst = []
    while q < 3000:
       count = 0
       p = nextprime(q)
       q = p
       while p != 3:
          p = hailstone(p)
          count = count + 1
       lst.append(count)

A360542 Primes prime(k) such that ( 9*(prime(k-1) - prime(k-2)) ) | (prime(k)^3 + 1).

Original entry on oeis.org

5, 11, 17, 23, 47, 71, 107, 113, 131, 149, 179, 191, 197, 233, 239, 251, 269, 293, 311, 317, 353, 359, 431, 467, 479, 503, 521, 557, 647, 683, 719, 797, 809, 821, 827, 839, 857, 863, 881, 887, 947, 953, 971, 1019, 1031, 1061, 1097, 1103, 1151, 1163, 1223, 1259
Offset: 1

Author

Najeem Ziauddin, Feb 11 2023

Keywords

Examples

			11 is a term since (11^3 + 1)/(9*(7-5)) = 1332/18 = 74.
131 is a term since (131^3 + 1)/(9*(127-113)) = 2248092/126 = 17842.
		

Crossrefs

Programs

  • Mathematica
    Select[Partition[Prime[Range[210]], 3, 1], Divisible[(#[[3]]^3 + 1)/9, #[[2]] - #[[1]]] &][[;; , 3]] (* Amiram Eldar, Feb 11 2023 *)

A359297 Primes prime(k) such that ( 8*(prime(k-1) - prime(k-2)) ) | (prime(k)^2 - 1).

Original entry on oeis.org

5, 7, 17, 23, 31, 41, 47, 71, 79, 97, 113, 127, 151, 167, 191, 223, 233, 239, 241, 263, 271, 281, 337, 353, 367, 383, 431, 439, 449, 457, 463, 479, 521, 569, 577, 599, 601, 607, 617, 631, 641, 647, 673, 743, 751, 761, 769, 809, 839, 863, 881, 887, 911, 929, 953
Offset: 1

Author

Najeem Ziauddin, Feb 11 2023

Keywords

Examples

			5 is a term since (5^2 - 1) / (8*(3-2)) = 24/8 = 3.
97 is a term since (97^2 - 1) / 8*(89-83)= 9408/48 = 196.
		

Crossrefs

Programs

  • Mathematica
    Select[Partition[Prime[Range[200]], 3, 1], Divisible[(#[[3]]^2 - 1)/8, #[[2]] - #[[1]]] &][[;; , 3]] (* Amiram Eldar, Feb 11 2023 *)

A360385 prime(k) such that (k BitXOR prime(k)) is prime, where BitXOR is the binary bitwise XOR.

Original entry on oeis.org

2, 7, 13, 29, 37, 43, 53, 61, 71, 79, 101, 131, 151, 199, 223, 281, 293, 317, 337, 349, 383, 409, 421, 457, 521, 557, 569, 641, 683, 733, 911, 983, 1013, 1049, 1151, 1223, 1249, 1373, 1429, 1511, 1531, 1721, 1747, 1759, 1789, 1831, 1931, 2017, 2029, 2213, 2311
Offset: 1

Author

Najeem Ziauddin, Feb 05 2023

Keywords

Examples

			2 is a term since k = primepi(2) = 1 and (1 BitXOR 2) = 3 is a prime number.
151 is a term since k = primepi(151) = 36 and (36 BitXOR 151) = 179 is a prime number.
		

Crossrefs

Programs

  • Maple
    q:= p-> andmap(isprime, [p, Bits[Xor](p, numtheory[pi](p))]):
    select(q, [$2..3000])[];  # Alois P. Heinz, Feb 05 2023
  • Mathematica
    Select[Prime[Range[400]], PrimeQ[BitXor[#, PrimePi[#]]] &] (* Amiram Eldar, Feb 05 2023 *)
  • PARI
    { p = primes([1,2311]); for (k=1, #p, if (isprime(bitxor(k,p[k])), print1 (p[k]", "))) } \\ Rémy Sigrist, Feb 05 2023
    
  • Python
    from sympy import isprime, primerange
    print([p for i, p in enumerate(primerange(2, 10**4), 1) if isprime(i^p)]) # Michael S. Branicky, Feb 05 2023

A360277 Primes p that are congruent to 1 mod 2*k, where k = primepi(p) is the index of the prime.

Original entry on oeis.org

11, 13, 1087, 64591, 64601, 64661, 3523969, 3524249, 189963073, 189963091, 189963847, 189968887, 189969319, 189969337, 1394194181, 1394194481, 1394194561, 1394197381, 1394199221, 1394199241, 10246935931, 10246936019, 10246936481, 75370121689, 75370121857, 75370122409
Offset: 1

Author

Najeem Ziauddin, Feb 01 2023

Keywords

Examples

			11 is a term since k = primepi(11) = 5 and 11 == 1 (mod 2*5).
13 is a term since k = primepi(13) = 6 and 13 == 1 (mod 2*6).
64661 is a term since k = primepi(64661) = 6466 and 64661 == 1 (mod 2*6466).
		

Crossrefs

Subsequence of A048891.

Programs

  • PARI
    lista(pmax) = {my(k = 0); forprime(p = 1, pmax, k+=2; if((p-1)%k==0, print1(p,", "))); } \\ Amiram Eldar, Feb 01 2023

Extensions

a(7)-a(8) from Michel Marcus, Feb 01 2023
a(9)-a(23) from Jon E. Schoenfield, Feb 01 2023
a(24)-a(26) from Amiram Eldar, Feb 01 2023

A360383 prime(k) such that (k BitOR prime(k)) is prime, where BitOR is the binary bitwise OR.

Original entry on oeis.org

2, 3, 5, 7, 17, 23, 29, 31, 43, 47, 53, 59, 67, 89, 101, 103, 107, 113, 127, 131, 163, 167, 173, 181, 191, 199, 233, 257, 269, 281, 317, 331, 353, 359, 367, 373, 379, 383, 389, 397, 401, 419, 421, 439, 463, 479, 503, 509, 521, 523, 563, 577, 587, 631, 641, 719
Offset: 1

Author

Najeem Ziauddin, Feb 04 2023

Keywords

Comments

All Mersenne primes (A000668) belong to the sequence. - Rémy Sigrist, Feb 05 2023

Examples

			2 is a term since k = primepi(2) = 1 and (1 BitOR 2) = 3 is a prime number.
101 is a term since k = primepi(101) = 26 and (26 BitOR 101) = 127 is a prime number.
		

Crossrefs

Programs

  • Maple
    q:= p-> andmap(isprime, [p, Bits[Or](p, numtheory[pi](p))]):
    select(q, [$2..1000])[];  # Alois P. Heinz, Feb 05 2023
  • Mathematica
    Select[Prime[Range[130]], PrimeQ[BitOr[#, PrimePi[#]]] &] (* Amiram Eldar, Feb 05 2023 *)
  • PARI
    { p = primes([1,719]); for (k=1, #p, if (isprime(bitor(k,p[k])), print1 (p[k]", "))) } \\ Rémy Sigrist, Feb 05 2023
    
  • Python
    from sympy import isprime, primerange
    print([p for i, p in enumerate(primerange(2, 800), 1) if isprime(i|p)]) # Michael S. Branicky, Feb 05 2023