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.

Previous Showing 11-14 of 14 results.

A335306 a(n) is the smallest composite number whose sum of distinct prime divisors is prime(n).

Original entry on oeis.org

4, 9, 6, 10, 121, 22, 210, 34, 273, 399, 58, 435, 651, 82, 777, 903, 1645, 118, 885, 1281, 142, 1065, 1533, 1659, 1335, 3115, 202, 2037, 214, 2163, 3729, 6213, 2667, 274, 2919, 298, 2235, 4917, 3297, 3423, 5845, 358, 3801, 382, 7059, 394, 6501, 7385, 8229, 454, 4683
Offset: 1

Views

Author

David James Sycamore, May 31 2020

Keywords

Comments

a(n) <= prime(n)^2 for all n, the equality applies to n = 1,2,5 since 2,3,11 are the only primes which cannot be expressed as the sum of distinct smaller primes. For n other than 1,2,5, a(n) is squarefree, and corresponds to the partition (q_1, q_2,....q_k) of n into distinct primes whose product is the least possible value compared with the product of all distinct prime partitions of n. The intersection of this sequence with A261023 corresponds to primes in A133225.
a(n) >= max(4,2*prime(n)-4) with equality if and only if n = 1 or n is in A107770. - Chai Wah Wu, Jun 01 2020

Examples

			a(7) = 10 since (2,5) is the only prime partition of 7 into distinct smaller parts, and 2*5 = 10. a(11) = 11^2 = 121 because the prime partitions of 11 into smaller parts are: (2,2,7), (2,2,2,5), (2,2,2,2,3), (3,3,5), (2,3,3,3), none of which have only distinct primes.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Block[{k = 4, p = Prime@ n}, While[PrimeQ[k] || p != Total[First /@ FactorInteger[k]], k++]; k]; Array[a, 50] (* Giovanni Resta, May 31 2020 *)
  • PARI
    a(n) = {my(p=prime(n)); forcomposite(k=1, p^2, if (vecsum(factor(k)[, 1]) == p, return(k)););} \\ Michel Marcus, May 31 2020
    
  • Python
    from sympy import prime, primefactors
    def A335306(n):
        p = prime(n)
        for m in range(max(4,2*p-4),p**2+1):
            if sum(primefactors(m)) == p:
                return m # Chai Wah Wu, Jun 01 2020

Extensions

More terms from Michel Marcus, May 31 2020

A340770 Indices k of prime numbers such that prime(k)-2 and prime(k)^2-2 are both prime numbers.

Original entry on oeis.org

3, 4, 6, 8, 14, 18, 27, 34, 65, 82, 99, 141, 172, 177, 191, 202, 216, 226, 319, 333, 337, 445, 470, 476, 496, 552, 559, 564, 578, 602, 637, 672, 829, 850, 863, 871, 949, 1005, 1065, 1075, 1190, 1199, 1231, 1239, 1306, 1329, 1446, 1450, 1529, 1619, 1635, 1643
Offset: 1

Views

Author

François Marques, Jan 20 2021

Keywords

Comments

This sequence is a subsequence of A107770.

Examples

			6 is in the sequence since prime(6)=13 and 13-2=11 and 13^2-2=167 are both prime numbers.
		

Crossrefs

Programs

  • PARI
    lista(n) = {my(l=List,k=1); while(#l
    				

A280941 Least integer k such that prime(k+1) - prime(k) = 2 and prime(k+2) - prime(k+1) = 2n, or 0 if no such k exists.

Original entry on oeis.org

2, 3, 10, 0, 33, 45, 0, 294, 98, 0, 296, 262, 0, 428, 984, 0, 1456, 3086, 0, 2343, 1878, 0, 14938, 8422, 0, 2809, 4259, 0, 7809, 13819, 0, 51036, 45506, 0, 15782, 30764, 0, 57764, 24553, 0, 23282, 51942, 0, 44902, 34214, 0, 1242641, 95929, 0, 66761
Offset: 1

Views

Author

Michel Lagneau, Jan 11 2017

Keywords

Comments

Or least integer k such that prime(k+2) - prime(k+1) = 2n where prime(k) is in A001359 (lesser of twin primes).
The corresponding prime(k) are 3, 5, 29, 137, 197, 1931, 521, 1949, 1667, 2969, 7757, 12161, 28349, 20807, ...
a(n) is a subsequence of A029707(n) or subsequence of A107770(n) - 1.
a(n) = 0 for n == 1 mod 3 for n > 1.
Proof: prime(k+1) - prime(k) = 2 => prime(k+1) == 1 mod 6 and prime(k) == -1 mod 6. If prime(k+2) - prime(k+1) = 2n, then prime(k+2) = 2(n+1) + prime(k). Combining n == 1 mod 3 and prime(k) == -1 mod 6 we obtain prime(k+2) == 3 mod 6, a contradiction because prime(k+2) == +-1 mod 6. Hence, a(n) = 0.

Examples

			a(3) = 10 because prime(11) - prime(10) = 31 - 29 = 2 and prime(12) - prime(11) = 37 - 31 = 6 = 2*3.
a(11) = 296 because prime(297) - prime(296) = 1951 - 1949 = 2 and prime(298) - prime(297) = 1973 - 1951 = 22 = 2*11.
		

Crossrefs

Programs

  • Maple
    nn:=50:m:=10^5:
    for n from 1 to 50 do:
    ii:=0:
      for k from 1 to m while(ii=0) do:
       p1:=ithprime(k):p2:=ithprime(k+1):p3:=ithprime(k+2):
        if p2-p1 = 2 and p3-p2 = 2*n
        then
        ii:=1:printf(`%d %d \n`,n,k):
        else
        fi:
       od:
        if ii=0 then printf(`%d %d \n`,n,0):
        else
        fi:
    od:
  • Mathematica
    Table[If[And[n > 1, Mod[n, 3] == 1], 0, k = 1; While[Nand[# - Prime@ k == 2, Prime[k + 2] - # == 2 n] &@ Prime[k + 1], k++]; k], {n, 40}] (* Michael De Vlieger, Jan 14 2017 *)

A305558 If (p1,p2) is the n-th twin prime pair and p the prime before p1 and q the prime after p2 then a(n) = p + q - (p1 + p2).

Original entry on oeis.org

1, 2, 0, 0, 0, 0, 0, 2, 0, 0, 4, -4, 4, -6, 8, 0, 4, 0, 6, 0, -6, 0, -4, 0, 6, 0, 0, 8, -6, 6, -2, -6, 6, 0, 0, 4, -4, 0, -4, 0, -12, 0, -14, 0, 0, -6, 0, 2, -6, 0, -2, 0, 20, 6, -2, 8, 0, 6, -2, 6, 0, 0, -8, 6, 4, -10, 6, -12, -12, 10, 0, 2, 0, 4, -6, 0, 2, 0, -6, 12, 22, -18, 6, 8, -18, 8, -22, 6, -2, 6, 0, 0, 18, -6
Offset: 1

Views

Author

Dimitris Valianatos, Jun 21 2018

Keywords

Examples

			For n = 8, the 8th prime pair is (71, 73), the prime before 71 is 67 and prime after 73 is 79. So a(8) = 67 + 79 - 71 - 73 = 2.
		

Crossrefs

Programs

  • Mathematica
    Map[#1 + #4 - (#2 + #3) & @@ # &, Select[Partition[Prime@ Range[500], 4, 1], And[#3 - #2 == 2] & @@ # &]] (* Michael De Vlieger, Jun 30 2018 *)
  • PARI
    {
    print1(2+7-(5+3)", ");
    forstep(n=6,100,6,
            if(isprime(n-1)&&isprime(n+1),
               a=precprime(n-2);b=nextprime(n+2);
               print1(a+b-2*n", ")
              )
           )
    }

Formula

a(n) = A000040(A029707(n)-1) + A000040(A107770(n)+1) - (A001359(n) + A006512(n)). - Jianing Song, Jun 22 2018

Extensions

Definition clarified by Jianing Song, Jun 22 2018
Previous Showing 11-14 of 14 results.