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: Pierre CAMI

Pierre CAMI's wiki page.

Pierre CAMI has authored 816 sequences. Here are the ten most recent ones:

A329941 Least prime, p, such that 2*p*3^n - 1 and 2*p*3^n + 1 are twin primes.

Original entry on oeis.org

2, 11, 2, 5, 43, 29, 53, 311, 113, 109, 367, 859, 647, 11, 2, 619, 13, 1051, 157, 2801, 3767, 5, 337, 1721, 3517, 41, 4013, 1879, 1873, 13649, 4637, 2909, 8387, 6521, 1453, 6599, 1277, 4801, 167, 1031, 11213, 4129, 4933, 199, 1427, 859, 9227, 5581, 863, 11959, 10453
Offset: 1

Author

Pierre CAMI, Nov 24 2019

Keywords

Examples

			2*2*3^1 - 1 = 11; 11 and 13 are twin primes so a(1)=2.
2*11*3^2 - 1 = 197; 197 and 199 are twin primes so a(2)=11 as no other prime p < 11 gives twin primes.
		

Crossrefs

Cf. A130327.

Programs

  • Mathematica
    Array[Block[{p = 2}, While[! AllTrue[2 p 3^# + {-1, 1}, PrimeQ], p = NextPrime@ p]; p] &, 51] (* Michael De Vlieger, Dec 24 2019 *)
  • PARI
    a(n) = {my(p=2); while (!isprime(2*p*3^n - 1) || !isprime(2*p*3^n + 1), p = nextprime(p+1)); p;} \\ Michel Marcus, Nov 25 2019

A329920 Smallest k such that 6*k*A121940(n)-1 and 6*k*A121940(n)+1 are twin primes.

Original entry on oeis.org

1, 2, 2, 15, 36, 10, 13, 26, 30, 228, 24, 138, 520, 59, 110, 456, 700, 670, 146, 300, 390, 53, 2335, 340, 159, 340, 65, 475, 785, 1145, 759, 3557, 490, 169, 990, 1527, 704, 3379, 1426, 1927, 2397, 600, 1603, 4809, 9815, 58, 35, 364, 361, 123, 2197, 4054, 1867, 1827, 5048
Offset: 1

Author

Pierre CAMI, Nov 24 2019

Keywords

Examples

			A121940(1)=7, 6*1*7-1=41, 41 and 43 are twin primes so a(1)=1.
A121940(2)=91, 6*2*91-1=1091, 1091 and 1093 are twin primes so a(2)=2.
		

Programs

  • PARI
    lista(nn) = {my(pp = 1); forprime (p = 1, nn, if (Mod(p, 6) == +1, pp *= p; my(k=1); while (!isprime(6*k*pp-1) || !isprime(6*k*pp+1), k++); print1(k, ", ");););} \\ Michel Marcus, Nov 25 2019

A330304 Prime numbers P such that Q=2*P-1, R=4*Q+1, S=6*R+1, T=8*S-1, U=10*T+1 and V=12*U-1 are all prime numbers.

Original entry on oeis.org

2, 34057, 36847, 207997, 612967, 11035807, 14015167, 19251097, 19587577, 25602547, 26953957, 28060717, 29722177, 29808277, 32894437, 40874857, 41691607, 49713127, 53064877, 54539827, 69143017, 85320577, 101516137, 110327797, 110712247, 123088117, 131584417, 140028607, 150780517
Offset: 1

Author

Pierre CAMI, Dec 13 2019

Keywords

Comments

Subsequence of A005382.
a(1) = A005382(1), a(2) = A005382(505), a(3) = A005382(536), a(4) = A005382(2084), a(5) = A005382(5105); a(6) > A005382(10000).
P, Q, R, S, T, U, V are 7 primes in near-geometric progression (2, 4, 6, 8, 10, 12 plus or minus one) starting P = a(n).

Examples

			2*2-1=3, 4*3+1=13, 6*13+1=79, 8*79-1=631, 10*631+1=6311, 12*6311-1=75731, where 2, 3, 13, 79, 631, 6311 and 75731 are all prime numbers; so 2 is the first term.
		

Crossrefs

Cf. A005382.

Programs

  • PARI
    forprime(P=2,130000000,my(Q=2*P-1,R=4*Q+1,S=6*R+1,T=8*S-1,U=10*T+1,V=12*U-1);if(isprime(Q)&&isprime(R)&&isprime(S)&&isprime(T)&&isprime(U)&&isprime(V),print1(P,", "))) \\ Hugo Pfoertner, Dec 17 2019

Extensions

a(12) and a(15) corrected by Chai Wah Wu, Jan 17 2020

A329916 Smallest k such that 6*k*A057130(n)-1 and 6*k*A057130(n)+1 are twin primes.

Original entry on oeis.org

1, 2, 3, 23, 11, 18, 77, 46, 84, 76, 22, 30, 3, 107, 26, 198, 136, 23, 236, 284, 167, 269, 381, 405, 379, 374, 620, 481, 606, 505, 163, 1414, 348, 639, 1696, 1429, 850, 2050, 740, 117, 362, 35, 3961, 72, 1307, 1816, 9410, 5705, 972, 368, 5083, 4387, 3296, 6039
Offset: 1

Author

Pierre CAMI, Nov 24 2019

Keywords

Comments

A057130 gives the product of prime numbers (-1 mod 6) in the order of occurrence.

Examples

			A057130(1)=5, 6*1*5-1=29, and 29 and 31 are twin primes, so a(1)=1.
A057130(2)=55, 6*2*55-1=659, and 659 and 661 are twin primes, so a(2)=2.
		

Programs

  • PARI
    lista(nn) = {my(pp = 1); forprime (p = 1, nn, if (Mod(p, 6) == -1, pp *= p; my(k=1); while (!isprime(6*k*pp-1) || !isprime(6*k*pp+1), k++); print1(k, ", ");););} \\ Michel Marcus, Nov 25 2019

A329736 Smallest odd prime P such that P*3*2^n - 1 and P*3*2^n + 1 are twin primes.

Original entry on oeis.org

3, 5, 3, 5, 43, 11, 3, 19, 17, 5, 113, 59, 317, 331, 307, 241, 127, 829, 23, 149, 127, 11, 3023, 1091, 787, 971, 1523, 2741, 727, 1051, 227, 211, 727, 89, 1163, 71, 367, 1031, 577, 89, 1213, 1151, 3, 1021, 283, 2699, 4933, 59, 647, 709, 3083, 541, 1483, 2069
Offset: 1

Author

Pierre CAMI, Nov 20 2019

Keywords

Examples

			3*3*2^1 - 1 =  17,  17 and  19 are twin primes so a(1)=3.
5*3*2^2 - 1 =  59,  59 and  61 are twin primes so a(2)=5.
3*3*2^3 - 1 =  71,  71 and  73 are twin primes so a(3)=3.
5*3*2^4 - 1 = 119, 119 and 121 are twin primes so a(4)=5.
		

Programs

  • Mathematica
    Array[Block[{p = 3}, While[! AllTrue[3 p*2^# + {-1, 1}, PrimeQ], p = NextPrime@ p]; p] &, 54] (* Michael De Vlieger, Nov 21 2019 *)
  • PARI
    for(n=1,54,my(m=3*2^n);forprime(k=3,oo,my(j=k*m);if(ispseudoprime(j-1)&&ispseudoprime(j+1),print1(k,", ");break))) \\ Hugo Pfoertner, Nov 21 2019
    
  • PARI
    a(n) = my(p=3, q); while (!isprime(q=p*3*2^n - 1) || !isprime(q+2), p = nextprime(p+1)); p; \\ Michel Marcus, May 06 2020

A327638 a(0)=1, a(1)=5; for n > 2, a(n) is the smallest odd number j not divisible by 3 such that (3*j+1)/2^k = a(n-1) for some k.

Original entry on oeis.org

1, 5, 13, 17, 11, 7, 37, 49, 65, 43, 229, 305, 203, 541, 721, 961, 5125, 6833, 4555, 6073, 32389, 172741, 230321, 153547, 818917, 4367557, 5823409, 7764545, 5176363, 6901817, 18404845, 98159173, 523515589, 2792083141, 3722777521, 19854813445, 105892338373
Offset: 0

Author

Pierre CAMI, Sep 20 2019

Keywords

Comments

Also a reverse Collatz sequence with odd numbers. - Paul Conradi, Oct 23 2020
Odd numbers in A225570. - Michel Marcus, Oct 24 2020

Examples

			a(0)=1, a(1)=5 by definition, then a(2) = (2*5-1)/3 or (8*5-1)/3; as (2*5-1)/3 is divisible by 3, a(2) = (8*5-1)/3 = 13.
		

Crossrefs

Intersection of A005408 and A225570.

Programs

  • PARI
    lista(nn) = {print1(1, ", ", 5); x = 5; for (n = 2, nn, if(x%3 == 1, x = (4*x-1)/3, x = (2*x-1)/3); if(x%3 == 0, x = 4*x + 1); print1(", ",  x)); } \\ Jinyuan Wang, Sep 21 2019

Formula

If a(n-1) == 1 (mod 3) then a(n) = (4*a(n-1)-1)/3 or (16*a(n-1)-1)/3, whichever value is not divisible by 3.
If a(n-1) == -1 (mod 3) then a(n) = (2*a(n-1)-1)/3 or a(n)=(8*a(n-1)-1)/3, whichever value is not divisible by 3.

Extensions

More terms from Jinyuan Wang, Sep 21 2019

A327581 a(1) is the smallest prime p such that 6*p^2-1 and 6*p^2+1 are twin primes; for n > 1, a(n) is the smallest prime q > a(n-1) such that 6*q^prime(n)-1 and 6*q^prime(n)+1 are twin primes or 0 if no solution exists.

Original entry on oeis.org

5, 0, 2557, 51137, 52057, 55373, 88867, 95273, 179947, 236653, 993647, 1010467, 1935533, 2031767, 2138803, 2849317, 8031343, 11696563, 11715133, 18125993, 22615493, 26766633, 26801393, 29963077, 39377893, 58282927, 70354657, 98988257, 119772847, 141442493, 145460123
Offset: 1

Author

Pierre CAMI, Sep 17 2019

Keywords

Comments

For prime(2) = 3 there is no solution such that 6*q^3-1 and 6*q^3+1 with q prime are twin primes. Because 7 divides 6*p^3-1 when p == 3, 5, 6 mod 7, 7 divides 6*p^3+1 when p == 1, 2, 4 mod 7. Therefore p can only be 7. But then 6*7^3-1 = 11^2*17 and 6*7^3+1 = 29*71 are not prime numbers, so a(2)=0.

Programs

  • PARI
    findp(n, pmin) = {my(pmin = nextprime(pmin+1), q); forprime(p=pmin, , if (isprime(q=6*p^prime(n)-1) && isprime(q+2), return(p));); }
    lista(nn) = {my(lasta = 2, newa); print1(findp(1, lasta), ", 0"); for (n=3, nn, newa = findp(n, lasta); print1(", ", newa); lasta = newa;); } \\ Michel Marcus, Sep 20 2019

A300507 Define the set of generalized Syracuse sequences starting with a positive odd integer 2*n+1=x(1) then if x(i) is odd and prime set x(i+1)=2*x(i)+1, if x(i) is odd not prime set x(i+1)=3*x(i)+1 and if x(i) is even then set x(i+1)=x(i)/2. a(n) is the index i when x(i) reaches 1 or 1163.

Original entry on oeis.org

4, 446, 444, 445, 448, 443, 236, 444, 441, 508, 8, 442, 511, 235, 506, 443, 514, 440, 509, 507, 233, 934, 445, 441, 512, 512, 438, 234, 937, 505, 889, 442, 515, 480, 241, 439, 239, 508, 510, 506, 892, 232, 10, 933, 503, 427, 444, 440, 461, 457, 478, 420, 509
Offset: 0

Author

Pierre CAMI, Mar 07 2018

Keywords

Comments

For n<40 the sequences reach 1, for n=40 the sequence reaches 1163 for x(889) and recover 1163 for x(889+931) a cycle of 961 values.

Examples

			For n=1 after 135 tripling(+1), 47 doubling(+1) and 263 halfing x(446)=1, so a(1)=446.
		

Crossrefs

Programs

  • PARI
    f(x) = if (x % 2, if (isprime(x), 2*x+1, 3*x+1), x/2);
    a(n) = {x = f(2*n+1); nb = 2; while (! ((x == 1) || (x == 1163)), x = f(x); nb++); nb;} \\ Michel Marcus, Mar 07 2018

A300286 Define a set of generalized Syracuse sequences starting with x(1)=2*n+1 a positive odd integer, if x(i) is odd prime set x(i+1)=67*x(i)+1, if x(i) is odd not prime set x(i+1)=3*x(i)+1 and if x(i) is even then set x(i+1)=x(i)/2. Then a(n) is the first index i > 1 at which x(i) reaches 1.

Original entry on oeis.org

4, 209166, 13, 207226, 207229, 384614, 384602, 32, 104820, 403030, 8, 30, 403033, 118516, 39365, 403070, 403036, 118323, 11641, 118425, 118514, 89369, 104824, 180241, 11644, 39371, 118321, 118294, 89372, 118423, 119595, 39372, 11647, 403093, 384607, 47436, 124886
Offset: 0

Author

Pierre CAMI, Mar 02 2018

Keywords

Comments

I define the generalized Syracuse sequences as follows:
Start with an odd positive number x(1)=2*k+1; then, for i >= 1, if x(i) is an odd prime set x(i+1)=p*x(i)+1 with p a prime, if x(i) is an odd nonprime set x(i+1)=3*x(i)+1, and if x(i) is even then set x(i+1)=x(i)/2.
If p=3 the sequences are the Syracuse sequences in which it does not matter whether odd x(i) is prime or not.
For all the prime numbers p other than 3, if x(i) is odd, the value of x(i+1) depends on whether x(i) is prime.
Among prime numbers p < 97, 67 is the only one for which x(i) reaches 1 for any k < 125 and for k=125, x(1)=251, x(8113)=887, x(8113+8099)=887 a cycle of 8099 values.
All the sequences for p < 423 eventually enter a loop (not tested above, but I conjecture that it is the case for any prime, although with different end cycles).

Examples

			For p=67 and k=2, we have x(1)=2*2+1=5, x(2)=67*5+1=336, x(3)=336/2=168, x(4)=168/2=84, x(5)=84/2=42, x(6)=42/2=21, x(7)=3*21+1=64, x(8)=64/2=32, x(9)=32/2=16, x(10)=16/2=8, x(11)=8/2=4, x(12)=4/2=2, x(13)=2/2=1; x(i) reaches 1 at i=13, so a(2)=13.
		

Crossrefs

Programs

  • PARI
    f(n) = if (n % 2, if (isprime(n), 67*n+1, 3*n+1), n/2);
    a(n) = {my(k = f(2*n+1), nb = 2); while (k != 1, k = f(k); nb++); nb;} \\ Michel Marcus, Mar 28 2018

A294748 Define one of the generalized Syracuse sequences starting with a positive odd integer 2*k+1=x(1), then if x(i) is an odd prime set x(i+1)=2*x(i)+1, if x(i) is odd not prime set x(i+1)=3*x(i)+1, if x(i) is even then set x(i+1)=x(i)/2. This sequence gives the positive odd integers 2*k+1=x(1) for sequences reaching x(i)=1.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49, 51, 53, 55, 57, 59, 63, 65, 67, 69, 71, 73, 75, 77, 79, 83, 85, 87, 89, 91, 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121, 125, 127, 129, 131, 133, 135, 137, 141, 143, 145
Offset: 1

Author

Pierre CAMI, Feb 18 2018

Keywords

Comments

The sequence of positive odd integers not in this sequence begins {61, 81, 123, 139, ...}. When x(1) is any of these, the sequence x(i) enters a cycle of 931 values x(i) = x(i+931)=1163.

Crossrefs

Programs

  • PARI
    f(n) = if (n % 2, if (isprime(n), 2*n+1, 3*n+1), n/2);
    isok(n) = {if (n%2, while (1, n = f(n); if (n==1, return (1)); if (n==1163, return (0));););} \\ Michel Marcus, Mar 28 2018