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: Otis Tweneboah

Otis Tweneboah's wiki page.

Otis Tweneboah has authored 8 sequences.

A260360 The absolute difference between the largest prime factors of prime(n)-1 and prime(n+1)-1.

Original entry on oeis.org

0, 1, 2, 2, 1, 1, 8, 4, 2, 2, 2, 2, 16, 10, 16, 24, 6, 4, 4, 10, 28, 30, 8, 2, 12, 36, 50, 4, 0, 6, 4, 6, 14, 32, 8, 10, 80, 40, 46, 84, 14, 16, 4, 4, 4, 30, 76, 94, 10, 12, 12, 0, 3, 129, 64, 62, 18, 16, 40, 26, 56, 14, 18, 66, 68, 4, 166, 144, 18, 168, 118, 30, 24, 184, 94, 86, 6, 12, 2, 12, 36, 40, 70, 56, 10
Offset: 2

Keywords

Comments

a(n)=0 if and only if n is in A105403.
It is an open question whether there are infinitely many zeros in this sequence. Are there infinitely many terms below some fixed upper bound?

Examples

			n=4: The prime factors of prime(4)-1 are 2,3 and the prime factors of prime(5)-1 are 2,5. The largest are 3 and 5, so a(4)=2.
		

Crossrefs

Programs

  • Maple
    B:= [seq(max(numtheory:-factorset(ithprime(i)-1)),i=2..101)]:
    seq(abs(B[n+1]-B[n]),n=1..99); # Robert Israel, Aug 06 2015
  • Mathematica
    Table[Abs[FactorInteger[Prime[n] - 1][[-1, 1]] - FactorInteger[Prime[n + 1] - 1][[-1, 1]]], {n, 2, 86}] (* Michael De Vlieger, Jul 24 2015 *)
    Rest[Abs[Differences[Table[FactorInteger[p-1][[-1,1]],{p,Prime[ Range[ 90]]}]]]] (* Harvey P. Dale, Aug 08 2021 *)
  • PARI
    gpf(n) = if(n>1, vecmax(factor(n)[, 1]), 1);
    a(n) = gpf(prime(n)-1) - gpf(prime(n+1)-1); \\ Michel Marcus, Aug 05 2015

Formula

a(n) = abs(A023503(n+1) - A023503(n)). - Robert Israel, Aug 06 2015

A260375 Numbers k such that A260374(k) is a perfect square.

Original entry on oeis.org

0, 1, 2, 4, 5, 6, 7, 8, 10, 11, 14, 15, 16
Offset: 1

Keywords

Comments

There are a surprising number of small terms in this sequence.
Heuristic: The square root of x has an average distance of 1/4 to an integer, so |x - round(sqrt(x))^2| is around |x - (sqrt(x) - 1/4)^2| or about sqrt(x)/2, hence A260374(n) is around sqrt(n!)/2. By Stirling's approximation this is around (n/e)^(n/2) which is a square with probability (n/e)^(-n/4). The integral of this function converges, so this sequence should be finite. This heuristic is crude, though, because it does not model the extreme values of A260374. - Charles R Greathouse IV, Jul 23 2015
There are no further terms up to 10^5, so probably the list is complete. - Charles R Greathouse IV, Jul 23 2015

Examples

			6! = 720. The nearest perfect square is 729. The difference is 9, which is itself a perfect square. So, 6 is in this sequence.
		

Crossrefs

Programs

  • PARI
    is(n)=my(N=n!,s=sqrtint(N)); issquare(min(N-s^2, (s+1)^2-N)) \\ Charles R Greathouse IV, Jul 23 2015
    
  • Python
    from gmpy2 import isqrt, is_square
    A260375_list, g = [0], 1
    for i in range(1, 1001):
        g *= i
        s = isqrt(g)
        t = g-s**2
        if is_square(t if t-s <= 0 else 2*s+1-t):
            A260375_list.append(i) # Chai Wah Wu, Jul 23 2015

A260374 The distance between n! and the nearest perfect square.

Original entry on oeis.org

0, 0, 1, 2, 1, 1, 9, 1, 81, 476, 225, 324, 4604, 74879, 176400, 215296, 3444736, 11551671, 45680444, 255004929, 1158920361, 2657058876, 24923993276, 130518272975, 97216010329, 2430400258225, 1553580508516, 4666092737476, 538347188396016, 2137864362693921
Offset: 0

Keywords

Examples

			6!=720. The nearest perfect square is 729. The difference between these is 9, so a(6)=9.
		

Crossrefs

Programs

  • PARI
    a(n)=abs(n!-round(sqrt(n!))^2) \\ Charles R Greathouse IV, Jul 23 2015
    
  • Python
    from gmpy2 import isqrt
    A260374_list, g = [0], 1
    for i in range(1, 1001):
        g *= i
        s = isqrt(g)
        t = g-s**2
        A260374_list.append(int(t if t-s <= 0 else 2*s+1-t)) # Chai Wah Wu, Jul 23 2015

Formula

a(n) = abs(n!-A260373(n)).

A260373 The nearest perfect square to n!

Original entry on oeis.org

1, 1, 1, 4, 25, 121, 729, 5041, 40401, 362404, 3629025, 39917124, 478996996, 6226945921, 87178467600, 1307674583296, 20922793332736, 355687416544329, 6402373660047556, 121645100663836929, 2432902009335560361, 51090942169052381124, 1124000727752683686724
Offset: 0

Keywords

Comments

a(n) is well defined as the squares are alternatingly odd and even and thus the average of two successive squares is not an integer and thus no integer is equidistant to two successive squares. - Chai Wah Wu, Jul 24 2015

Examples

			6! = 720. The nearest perfect square is 729.
		

Crossrefs

Programs

  • PARI
    a(n)=round(sqrt(n!))^2 \\ Charles R Greathouse IV, Jul 23 2015
    
  • Python
    from gmpy2 import isqrt
    A260373_list, g = [1], 1
    for i in range(1, 101):
        g *= i
        s = isqrt(g)
        t = s**2
        A260373_list.append(int(t if g-t-s <= 0 else t+2*s+1)) # Chai Wah Wu, Jul 23 2015

Formula

a(n) = A055227(n)^2.

A259559 Numbers n such that prime(n)-1 and prime(n+1)-1 have the same number of prime factors, including repeats.

Original entry on oeis.org

3, 4, 10, 12, 19, 29, 34, 36, 45, 46, 50, 61, 85, 89, 91, 104, 112, 117, 118, 119, 129, 130, 137, 138, 143, 147, 148, 158, 178, 179, 181, 185, 200, 202, 206, 214, 220, 233, 238, 239, 244, 248, 249, 258, 262, 275, 299, 304, 314, 333, 338, 340
Offset: 1

Keywords

Comments

Unlike A105403, this sequence appears to be infinite.

Examples

			The prime factors of prime(10)-1 are 2,2,7 and the prime factors of prime(11)-1 are 2,3,5 and so they have the same number of prime factors, including repeats.
		

Crossrefs

Programs

  • Mathematica
    Select[Range@ 360, PrimeOmega[Prime[#] - 1] == PrimeOmega[Prime[# + 1] - 1] &] (* Michael De Vlieger, Jul 01 2015 *)
    Transpose[SequencePosition[Table[PrimeOmega[Prime[n]-1],{n,400}],{x_,x_}]][[1]] (* The program uses the SequencePosition function from Mathematica version 10 *) (* Harvey P. Dale, Nov 29 2015 *)
  • PARI
    lista(nn) = {forprime(p=2, nn, if (bigomega(p-1)==bigomega(nextprime(p+1)-1), print1(primepi(p), ", ")););} \\ Michel Marcus, Jul 01 2015

A259558 Numbers n such that prime(n)-1 and prime(n+1)-1 have the same number of distinct prime factors.

Original entry on oeis.org

2, 4, 5, 8, 9, 12, 15, 16, 18, 19, 23, 24, 25, 28, 29, 31, 36, 38, 39, 40, 42, 44, 52, 56, 58, 59, 60, 63, 64, 71, 73, 74, 76, 80, 85, 88, 91, 92, 94, 96, 98, 99, 102, 103, 106, 107, 109, 110, 111, 112, 113, 117, 126, 129, 130, 131, 132, 133, 134, 136, 139, 141, 142, 143, 144, 151, 152, 159, 160, 161, 165, 168, 169, 173
Offset: 1

Keywords

Comments

Unlike A105403, this sequence appears to be infinite.
Dickson's conjecture would imply that there are infinitely many p such that p, p+6, 2*p+1 and 2*p+13 are prime and there are no primes between 2*p+1 and 2*p+13. Then n is in the sequence where 2*p+1=prime(n). - Robert Israel, Jun 30 2015

Examples

			The prime factors of prime(5)-1 are 2,5. The prime factors of prime(6)-1 are 2,3,3 and they have the same number of distinct prime factors.
		

Crossrefs

Programs

  • Maple
    N:= 2000: # to use primes <= N
    Primes:= select(isprime,[2,seq(2*i+1,i=1..floor((N-1)/2))]):
    npf:= map(t -> nops(numtheory:-factorset(Primes[t]-1)), [$1..nops(Primes)]):
    select(t -> npf[t+1]=npf[t],[$1..nops(Primes)-1]); # Robert Israel, Jun 30 2015
  • Mathematica
    Select[Range@ 173, PrimeNu[Prime[#] - 1] == PrimeNu[Prime[# + 1] - 1] &] (* Michael De Vlieger, Jul 01 2015 *)
  • PARI
    lista(nn) = {forprime(p=2, nn, if (omega(p-1)==omega(nextprime(p+1)-1), print1(primepi(p), ", ")););} \\ Michel Marcus, Jul 01 2015

A259564 Numbers n such that the sum of the prime factors (including repeats) of prime(n)-1 and prime(n+1)-1 are the same.

Original entry on oeis.org

5, 7, 11, 30, 133, 160, 415, 527, 883, 1257, 2025, 2771, 2775, 6650, 6932, 13793, 19091, 30695, 32341, 33722, 36372, 37944, 40532, 42141, 47230, 60986, 77956, 82165, 90564, 111414, 113106, 136036, 147573, 148357, 158279, 169137, 169604, 171549, 174540, 187679
Offset: 1

Keywords

Comments

Although there are more terms than A105403 so far, these numbers are still fairly uncommon.
Is this sequence infinite?

Examples

			The prime factors of prime(30)-1 are 2,2,2,2,7 and the prime factors of prime(31)-1 are 2,3,3,7. The sum of entries in each of these lists is 15.
		

Crossrefs

Programs

  • Mathematica
    SequencePosition[Table[Total[Flatten[Table[#[[1]],#[[2]]]&/@ FactorInteger[ p-1]]],{p,Prime[Range[200000]]}],{x_,x_}][[All,1]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 12 2020 *)
  • PARI
    spff(n) = {my(f=factor(n)); sum(k=1, #f~, f[k,1]*f[k,2]);}
    lista(nn) = {forprime(p=2, nn, if (spff(p-1)==spff(nextprime(p+1)-1), print1(primepi(p), ", ")););} \\ Michel Marcus, Jun 30 2015

Extensions

More terms from Alois P. Heinz, Jun 30 2015
Name edited by Zak Seidov, Jul 02 2015

A259562 Numbers n such that the sum of the distinct prime factors of prime(n)-1 and prime(n+1)-1 are the same.

Original entry on oeis.org

2, 414, 556, 3962, 4972, 6151, 6521, 8440, 8665, 13769, 13909, 15576, 16696, 17176, 19926, 20630, 21541, 27090, 30822, 62118, 65349, 74014, 94203, 98600, 101231, 103058, 108333, 112332, 136036, 142714, 145588, 147150, 160730, 162366, 169137, 194681, 200837
Offset: 1

Keywords

Comments

Although there are more terms than A105403 so far, these numbers are still fairly uncommon.
Is this sequence infinite?
It would follow from the generalized Bunyakovsky conjecture that, e.g., there are infinitely many primes p such that p+2, p+12, p+14, 6*p^2+84*p+1 and 6*p^2+84*p+145 are all prime, and there are no primes between 6*p^2+84*p+1 and 6*p^2+84*p+145. If so, then the sequence is infinite, because it contains n where prime(n) = 6*p^2+84*p+1, with prime(n)-1 having distinct prime factors 2,3,p,p+14 and prime(n+1) having distinct prime factors 2,3,p+2,p+12. - Robert Israel, Jun 30 2015

Examples

			The prime factors of prime(414)-1 are 2,3,5,5,19 and the prime factors of prime(415)-1 are 2,2,2,3,7,17. The sum of the distinct entries in each of these lists is 29.
		

Crossrefs

Programs

  • Maple
    Primes:= select(isprime,[2,seq(2*i+1,i=1..10^6)]):
    spf:= map(p -> convert(numtheory:-factorset(p-1),`+`), Primes):
    select(t -> spf[t+1]=spf[t], [$1..nops(Primes)-1]);
  • Mathematica
    Select[Range@ 250000, Total[First /@ FactorInteger[Prime@ # - 1]] == Total[First /@ FactorInteger[Prime[# + 1] - 1]] &] (* Michael De Vlieger, Jul 01 2015 *)
  • PARI
    spf(n) = {my(f=factor(n)); sum(k=1, #f~, f[k,1]);}
    lista(nn) = {forprime(p=2, nn, if (spf(p-1)==spf(nextprime(p+1)-1), print1(primepi(p), ", ")););} \\ Michel Marcus, Jun 30 2015

Extensions

More terms from Alois P. Heinz, Jun 30 2015