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

A105418 Smallest prime p such that the sum of it and the following prime has n prime factors including multiplicity, or 0 if no such prime exists.

Original entry on oeis.org

2, 0, 3, 11, 53, 71, 61, 191, 953, 1151, 3833, 7159, 4093, 30713, 36857, 110587, 360439, 663547, 2064379, 786431, 3932153, 5242877, 9437179, 63700991, 138412031, 169869311, 436207613, 3875536883, 1358954453, 1879048183, 10066329587, 8053063661, 14495514619
Offset: 1

Views

Author

Keywords

Comments

a(2) = 0 since it is impossible.

Examples

			a(5) = 53 because (53 + 59) = 112 = 2^4*7.
a(24) = 63700991 because (63700991 + 63700993) = 127401984 = 2^19*3^5.
a(28) = 3875536883 because (3875536883 + 3875536909) = 7751073792 = 2^25*3*7*11.
a(29) = 1358954453 because (1358954453 + 1358954539) = 2717908992 = 2^25*3^4.
a(30) = 1879048183 because (1879048183 + 1879048201) = 3758096384 = 2^29*7.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Plus @@ Flatten[ Table[ #[[2]], {1}] & /@ FactorInteger[n]]; t = Table[0, {40}]; Do[a = f[Prime[n] + Prime[n + 1]]; If[a < 41 && t[[a]] == 0, t[[a]] = Prime[n]; Print[{a, Prime[n]}]], {n, 111500000}]; t
  • PARI
    almost_primes(A, B, n) = A=max(A, 2^n); (f(m, p, n) = my(list=List()); if(n==1, forprime(q=max(p, ceil(A/m)), B\m, listput(list, m*q)), forprime(q=p, sqrtnint(B\m, n), list=concat(list, f(m*q, q, n-1)))); list); vecsort(Vec(f(1, 2, n)));
    a(n) = if(n==2, return(0)); my(x=2^n, y=2*x); while(1, my(v=almost_primes(x, y, n)); for(k=1, #v, my(p=precprime(max(v[k]>>1, 2)), q=nextprime(p+1)); if(p+q == v[k], return(p))); x=y+1; y=2*x); \\ Daniel Suteu, Aug 06 2024

Extensions

a(28)=3875536883 from Ray Chandler and Robert G. Wilson v, Apr 10 2005
Edited by Ray Chandler, Apr 10 2005
a(31)-a(33) from Daniel Suteu, Nov 18 2018
Definition slightly modified by Harvey P. Dale, Jul 17 2024

A237881 a(n) = 2-adic valuation of prime(n)+prime(n+1).

Original entry on oeis.org

0, 3, 2, 1, 3, 1, 2, 1, 2, 2, 2, 1, 2, 1, 2, 4, 3, 7, 1, 4, 3, 1, 2, 1, 1, 2, 1, 3, 1, 4, 1, 2, 2, 5, 2, 2, 6, 1, 2, 5, 3, 2, 7, 1, 2, 1, 1, 1, 3, 1, 3, 5, 2, 2, 3, 2, 2, 2, 1, 2, 6, 3, 1, 4, 1, 3, 2, 2, 3, 1, 3, 1, 2, 4, 1, 2, 1, 1, 1, 2, 3, 2, 5, 3, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 2, 3, 6, 4, 5, 2, 2, 2, 2, 2, 3, 4, 3, 2, 1, 2, 1, 3, 2, 1, 2, 5, 3, 1, 1, 4
Offset: 1

Views

Author

Antonio Roldán, Feb 14 2014

Keywords

Examples

			a(5)=3 because prime(5)=11, prime(6)=13, 11+13=24=2^3*3, 2-adic valuation(24)=3.
		

Crossrefs

Programs

  • Mathematica
    IntegerExponent[ListConvolve[{1,1},Prime[Range[200]]],2] (* Paolo Xausa, Nov 02 2023 *)
  • PARI
    {for(i=1,200,k=valuation(prime(i)+prime(i+1),2);print1(k,", "))}
    
  • Python
    from sympy import prime
    def A237881(n): return (~(m:=prime(n)+prime(n+1))&m-1).bit_length() # Chai Wah Wu, Jul 08 2022

Formula

a(n) = A007814(A001043(n)).
a(n) << log n; in particular, a(n) <= log_2 n + log_2 log n + O(1). - Charles R Greathouse IV, Feb 14 2014
Showing 1-2 of 2 results.