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: Neil Fernandez

Neil Fernandez's wiki page.

Neil Fernandez has authored 108 sequences. Here are the ten most recent ones:

A284951 Numbers 2n for which A284950(n) is higher than for all smaller 2n.

Original entry on oeis.org

2, 8, 24, 30, 60, 90, 120, 210, 420, 630, 840, 1050, 1260, 1680, 1890, 2310, 2730, 3780, 3990, 4200, 4620, 4830, 5460, 6930, 8190, 9240, 10710, 10920, 11550, 13650, 13860, 15960, 16170, 18480, 20790, 21840, 23100, 25410, 27300, 27720, 30030, 39270
Offset: 1

Author

Neil Fernandez, Apr 06 2017

Keywords

Examples

			A284950 begins 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 2, 1, 0, 3, 0, 1, with values in 1st, 4th, 12th and 15th place that are larger than all previous values. So the sequence begins by doubling 1, 4, 12, 15 to get 2, 8, 24, 30.
		

Programs

  • Mathematica
    k = 0;
    Print [1, " ", 0];
    For[i = 1, i < 1001, i++,
    ee = 2*i;
    a = 0;
    For[j = 3, j < ee/2, j += 2,
      If[PrimeQ[j] == True && PrimeQ[ee - j] == True,
       If[PrimeQ[ee + j] == True, a += 1]]];
    If[a > k, k = a; Print[ee, " ", a]]]

A284950 Number of primes p <= n such that 2*n-p and 2*n+p are prime.

Original entry on oeis.org

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

Author

Neil Fernandez, Apr 06 2017

Keywords

Comments

If n is not divisible by 3, a(n)<=1, as the only possible p is 3. - Robert Israel, Jul 20 2020

Examples

			a(5) is 1, because of all the pairs of primes p1 <= p2 which sum to 5*2=10, namely {3,7} and {5,5}, only (3,7) has p1+10 prime.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local p1,p2,t;
      t:= 0: p1:= 2:
      do
        p1:= nextprime(p1);
        if p1 > n then return t fi;
        if isprime(p1+2*n) and isprime(2*n-p1)  then
          t:= t+1
        fi
      od
    end proc:
    map(f, [$1..1000]); # Robert Israel, Jul 20 2020
  • Mathematica
    For[i = 1, i < 1001, i++,
    ee = 2*i;
    a = 0;
    For[j = 3, j < ee/2, j += 2,
      If[PrimeQ[j] == True && PrimeQ[ee - j] == True,
       If[PrimeQ[ee + j] == True, a += 1, a = a]]];
    Print[ee, " ", a]]

Extensions

Definition corrected by Robert Israel, Jul 20 2020

A274995 a(n) is the smallest odd prime that divides (-n) + the sum of all smaller primes, or 0 if no such prime exists.

Original entry on oeis.org

5, 19, 3, 7, 82811, 3, 11, 17, 3, 191, 5, 3, 37, 29, 3, 5, 69431799799, 3, 1105589, 28463, 3, 431, 2947308589, 3, 7, 5, 3, 59, 11, 3, 5, 7, 3, 41
Offset: 0

Author

Neil Fernandez, Nov 11 2016

Keywords

Comments

From Robert G. Wilson v, Nov 15 2016: (Start)
If n == 2 (mod 3) then a(n) = 3;
If n == 0 (mod 5) then a(n) = 5;
If n == 3 (mod 7) then a(n) = 7;
If n == 6 (mod 11) then a(n) = 11;
If n == 2 (mod 13) then a(n) = 13;
If n == 7 (mod 17) then a(n) = 17;
If n == 1 (mod 19) then a(n) = 19;
If n == 8 (mod 23) then a(n) = 23;
in that order; i.e., from smaller to greater prime modulus, etc.
First occurrence of p>2: 2, 0, 3, 6, 54, 7, 1, 123, 13, 36, 12, 33, 453, 46, ..., .
(End)
The congruence classes in the above list, modulo the prime bases, namely 2, 0, 3, 6, 2, ..., are given by A071089, in which each term is the remainder when the sum of the first n primes is divided by the n-th prime. - Neil Fernandez, Nov 23 2016

Examples

			a(1) = 19 because 19 is the smallest odd prime that divides the sum of (-1) + (sum of all primes smaller than itself), that is, -1 + 58 = 57.
a(7) = 17 because -7 + 2 + 3 + 5 + 7 + 11 + 13 + 17 = 49 and 49/7 = 7.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{p = 3, s = 2 - n}, While[ Mod[s, p] != 0, s = s + p; p = NextPrime@ p]; p]; Array[f, 16, 0] (* Robert G. Wilson v, Nov 15 2016 *)
  • PARI
    sump(n) = s = 0; forprime(p=2, n-1, s+=p); s;
    a(n) = {my(p=3); while ((sump(p)-n) % p, p = nextprime(p+1)); p;} \\ Michel Marcus, Nov 12 2016
    
  • PARI
    a(n)=my(s=2); forprime(p=3,, if((s-n)%p==0, return(p)); s+=p) \\ Charles R Greathouse IV, Nov 15 2016

Extensions

a(16)-a(33) from Charles R Greathouse IV, Nov 15 2016

A274649 a(n) is the smallest odd prime that divides n + the sum of all smaller primes, or 0 if no such prime exists.

Original entry on oeis.org

5, 3, 30915397, 11339869, 3, 5, 859, 3, 41, 233, 3, 7, 4175194313, 3, 307, 5, 3, 1459, 7, 3, 5, 9907, 3, 647, 13, 3, 31, 11, 3, 193, 5, 3, 7, 2939, 3, 5, 3167, 3, 11, 7, 3, 1321, 86629, 3, 17, 5, 3
Offset: 0

Author

Neil Fernandez, Nov 10 2016

Keywords

Comments

From David A. Corneth, Nov 12 2016: (Start)
a(n) is the smallest odd prime p such that p|(n + A007504(primepi(p) - 1)) or zero if no such p exists.
If a(n) = p then a(n + p) <= p. (End)
If n is congruent to 1 (mod 3), then a(n)=3.
a(2), a(3) and a(12) were found by Jack Brennen.
From Robert G. Wilson v, Nov 13 2016: (Start)
If n == 1 (mod 3) then a(n) = 3;
If n == 0 (mod 5) then a(n) = 5;
If n == 4 (mod 7) then a(n) = 7;
if n == 5 (mod 11) then a(n) = 11;
if n == 11 (mod 13) then a(n) = 13;
if n == 10 (mod 17) then a(n) = 17;
if n == 18 (mod 19) then a(n) = 19;
if n == 23 (mod 23) then a(n) = 23;
in that order, i.e., from smallest to greatest prime modulus, etc.
First occurrence of p > 2: 1, 0, 11, 27, 24, 44, 56, 84, 161, ..., .
a(47) > 10^11. (End)

Examples

			a(6) = 859 because 859 is the smallest odd prime that divides the sum of 6 + (sum of all primes smaller than itself).
a(8) = 41 because 8+2+3+5+7+11+13+17+19+23+29+31+37+41 = 246 and 246/41 = 6.
		

Crossrefs

Cf. A016777 (n==1 (mod 3))

Programs

  • Mathematica
    f[n_] := Block[{p = 3, s = n +2}, While[ Mod[s, p] != 0, s = s + p; p = NextPrime@ p]; p]; Array[f, 47, 0] (* Robert G. Wilson v, Nov 12 2016 *)
  • Python
    # see link for an alternate that searches in parallel to a limit
    from sympy import nextprime
    def a(n):
      psum, p = 2, 3
      while (n + psum)%p: psum, p = psum + p, nextprime(p)
      return p
    for n in range(12):
      print(a(n), end=", ") # Michael S. Branicky, May 03 2021

A231507 a(n) is smallest number greater than a(n-1) such that a(n)+a(n-1) is composite.

Original entry on oeis.org

4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 18, 20, 22, 23, 25, 26, 28, 29, 31, 32, 33, 35, 37, 38, 39, 41, 43, 44, 46, 47, 48, 50, 52, 53, 55, 56, 58, 59, 60, 61, 62, 63, 65, 67, 68, 70, 71, 72, 73, 74, 76, 77, 78, 80, 81, 83, 85, 86, 88, 89, 91, 92, 93, 94, 95, 97
Offset: 1

Author

Neil Fernandez, Nov 09 2013

Keywords

Examples

			a(1) = 4, the first composite. So the smallest a(2) could possibly be 5. 4+5=9, which is composite, so a(2) = 5. a(3) cannot be 6, because 5+6=11, which is prime. But 5+7=12 is composite, so a(3) = 7.
		

Crossrefs

Programs

  • Mathematica
    nxt[n_]:=Module[{k=n+1},While[PrimeQ[n+k],k++];k]; NestList[nxt,4,70] (* Harvey P. Dale, Jul 18 2014 *)

A143851 Primes p that divide the sum of their residues modulo all smaller primes (=A024934(p)).

Original entry on oeis.org

2, 13, 167, 2239, 439867, 724031017, 1990127567, 54892225873
Offset: 1

Author

Neil Fernandez, Sep 03 2008

Keywords

Comments

Also, primes p such that p divides A024924(p). The prime terms of A065132.

Examples

			13 is congruent to 1,1,3,6 and 2, modulo 2,3,5,7 and 11 respectively. 1+1+3+6+2=13, which is a multiple of the original number, 13. So the original number, is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    For[n = 1, n < 1000001, n++, p = Prime[n]; m = Mod[Sum[Mod[p, Prime[i]], {i, 1, n - 1}], p]; If[m == 0, Print[p]]]

Extensions

a(6)-a(8) from Max Alekseyev, Feb 10 2012

A143853 Primes p that divide the sum of their remainders modulo all smaller composites (=A233131(p)).

Original entry on oeis.org

2, 3, 23, 53, 613, 490537
Offset: 1

Author

Neil Fernandez, Sep 03 2008

Keywords

Comments

The prime elements of A233344.

Examples

			Composites smaller than 23 are 4,6,8,9,10,12,14,15,16,18,20,21 and 22. 23 is congruent to 3,5,7,5,3,11,9,8,7,5,3 and 2 modulo these numbers respectively. The sum of these residues is 69. This is a multiple of 23, so 23 is in the sequence.
		

Crossrefs

Extensions

490537 from Max Alekseyev, Sep 15 2009
Term 2 prepended by Max Alekseyev, Dec 07 2013

A147541 Result of using the primes as coefficients in an infinite polynomial series in x and then expressing this series as (1+x)(1+a(1)*x)(1+a(2)*x^2) ... .

Original entry on oeis.org

1, 2, 1, 3, 2, -4, 2, 5, 4, -6, 4, 4, 10, -36, 18, 45, 34, -72, 64, -24, 124, -358, 258, 170, 458, -1260, 916, 148, 1888, -4296, 3690, 887, 7272, -17616, 14718, -5096, 29610, -67164, 58722, -26036, 119602, -244496, 242256, -104754, 487352, -1029384
Offset: 1

Author

Neil Fernandez, Nov 06 2008

Keywords

Comments

This is the PPE (power product expansion) of A036467. - R. J. Mathar, Feb 01 2010

Examples

			From the primes, construct the series 1+2x+3x^2+5x^3+7x^4+... Divide this by (1+x) to get the quotient (1+a(1)x+...), which here gives a(1)=1. Then divide this quotient by (1+a(1)x), i.e. here (1+x), to get (1+a(2)x^2+...), giving a(2)=2.
		

Crossrefs

Programs

  • Maple
    From R. J. Mathar, Feb 01 2010: (Start)
    # Partition n into a set of distinct positive integers, the maximum one
    # being m.
    # Example: partitionsQ(7,5) returns [[2,5],[3,4],[1,2,4]] ;
    # Richard J. Mathar, 2008-11-10
    partitionsQ := proc(n,m)
    local p,t,rec,q;
    p := [] ;
    # take 't' of the n and recursively determine the partitions of
    # what has been left over.
    for t from min(m,n) to 1 by -1 do
    # Since we are only considering partitions into distinct parts,
    # the triangular numbers set a lower bound on the t.
    if t*(t+1)/2 >= n then
    rec := partitionsQ(n-t,t-1) ;
    if nops(rec) = 0 then
    p := [op(p),[t]] ;
    else
    for q in rec do
    p := [op(p),[op(q),t]] ;
    end do:
    end if;
    end if;
    end do:
    RETURN(p) ;
    end proc:
    # Power product expansion of L.
    # L is a list starting with 1, which is considered L[0].
    # Returns the list [a(1),a(2),..] such that
    # product_(i=1,2,..) (1+a(i)x^i) = sum_(j=0,1,2,...) L[j]x^j.
    # Richard J. Mathar, 2008-11-10
    ppe := proc(L)
    local pro,i,par,swithi,snoti,m,p,k ;
    pro := [] ;
    for i from 1 to nops(L)-1 do
    par := partitionsQ(i,i) ;
    swithi := 0 ;
    snoti := 0 ;
    for p in par do
    if i in p then
    m := 1 ;
    for k from 1 to nops(p)-1 do
    m := m*op(op(k,p),pro) ;
    end do;
    swithi := swithi+m ;
    else
    snoti := snoti+mul( op(k,pro),k=p) ;
    end if;
    end do:
    pro := [op(pro), (op(i+1,L)-snoti)/swithi] ;
    end do:
    RETURN(pro) ;
    end proc:
    read("transforms") ;
    A147541 := proc(nmax)
    local L,L1,L2 ;
    L := [1,seq(ithprime(n),n=1..nmax)] ;
    L1 := [seq((-1)^n,n=0..nmax+10)] ;
    A036467 := CONV(L,L1) ;
    ppe(A036467) ;
    end:
    A147541(47) ;
    (End)

Extensions

Extended by R. J. Mathar, Feb 01 2010

A147654 Result of using the positive integers 1,2,3,... as coefficients in an infinite polynomial series in x and then expressing this series as Product_{k>=1} (1+a(k)x^k).

Original entry on oeis.org

1, 2, 1, 3, 0, -2, 0, 9, 0, -6, 0, 4, 0, -18, 0, 93, 0, -54, 0, 72, 0, -186, 0, 232, 0, -630, 0, 1020, 0, -2106, 0, 10881, 0, -7710, 0, 13824, 0, -27594, 0, 49440, 0, -97902, 0, 191844, 0, -364722, 0, 590800, 0, -1340622, 0, 2656920, 0, -4918482, 0, 9791784, 0, -18512790
Offset: 1

Author

Neil Fernandez, Nov 09 2008

Keywords

Examples

			From the positive integers 1,2,3,..., construct the series 1+x+2x^2+3x^3+4x^4+... a(1) is always the coefficient of x, here 1. Divide by (1+a(1)x), i.e. here (1+x), to get the quotient (1+a(2)x^2+...), which here gives a(2)=2. Then divide this quotient by (1+a(2)x^2), i.e. here (1+2x^2), to get (1+a(3)x^3+...), giving a(3)=1.
		

Crossrefs

Formula

Product_{k>=1} (1+a(k)*x^k) = 1 + Sum_{k>=1} k*x^k. - Seiichi Manyama, Jun 24 2018

Extensions

More terms from Seiichi Manyama, Jun 23 2018

A147655 a(n) is the coefficient of x^n in the polynomial given by Product_{k>=1} (1 + prime(k)*x^k).

Original entry on oeis.org

1, 2, 3, 11, 17, 40, 86, 153, 283, 547, 1069, 1737, 3238, 5340, 9574, 17251, 27897, 45845, 78601, 126725, 207153, 353435, 550422, 881454, 1393870, 2239938, 3473133, 5546789, 8762663, 13341967, 20676253, 31774563, 48248485, 74174759, 111904363, 170184798
Offset: 0

Author

Neil Fernandez, Nov 09 2008

Keywords

Comments

Sum of all squarefree numbers whose prime indices sum to n. A prime index of n is a number m such that prime(m) divides n. The multiset of prime indices of n is row n of A112798. - Gus Wiseman, May 09 2019

Examples

			Form a product from the primes: (1 + 2*x) * (1 + 3*x^2) * (1 + 5*x^3) * ...* (1 + prime(n)*x^n) * ... Multiplying out gives 1 + 2*x + 3*x^2 + 11*x^3 + ..., so the sequence begins 1, 2, 3, 11, ....
From _Petros Hadjicostas_, Apr 10 2020: (Start)
Let f(m) = prime(m). Using the strict partitions of n (see A000009), we get:
a(1) = f(1) = 2,
a(2) = f(2) = 3,
a(3) = f(3) + f(1)*f(2) = 5 + 2*3 = 11,
a(4) = f(4) + f(1)*f(3) = 7 + 2*5 = 17,
a(5) = f(5) + f(1)*f(4) + f(2)*f(3) = 11 + 2*7 + 3*5 = 40,
a(6) = f(6) + f(1)*f(5) + f(2)*f(4) + f(1)*f(2)*f(3) = 13 + 2*11 + 3*7 + 2*3*5 = 86,
a(7) = f(7) + f(1)*f(6) + f(2)*f(5) + f(3)*f(4) + f(1)*f(2)*f(4) = 17 + 2*13 + 3*11 + 5*7 + 2*3*7 = 153. (End)
		

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
          b(n, i-1) +`if`(i>n, 0, b(n-i, i-1)*ithprime(i))))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..50);  # Alois P. Heinz, Sep 05 2014
  • Mathematica
    nn=40;Take[Rest[CoefficientList[Expand[Times@@Table[1+Prime[n]x^n,{n,nn}]],x]],nn] (* Harvey P. Dale, Jul 01 2012 *)

Formula

a(n) = [x^n] Product_{k>=1} 1+prime(k)*x^k. - Alois P. Heinz, Sep 05 2014
a(n) = Sum_{(b_1,...,b_n)} f(1)^b_1 * f(2)^b_2 * ... * f(n)^b_n, where f(m) = prime(m), and the sum is taken over all lists (b_1,...,b_n) with b_j in {0,1} and Sum_{j=1..n} j*b_j = n. - Petros Hadjicostas, Apr 10 2020

Extensions

More terms from Harvey P. Dale, Jul 01 2012
a(0)=1 inserted by Alois P. Heinz, Sep 05 2014
Name edited by Petros Hadjicostas, Apr 10 2020