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

A073738 Sum of every other prime <= n-th prime down to 2 or 1; equals the partial sums of A036467 (in which sums of two consecutive terms form the primes).

Original entry on oeis.org

1, 2, 4, 7, 11, 18, 24, 35, 43, 58, 72, 89, 109, 130, 152, 177, 205, 236, 266, 303, 337, 376, 416, 459, 505, 556, 606, 659, 713, 768, 826, 895, 957, 1032, 1096, 1181, 1247, 1338, 1410, 1505, 1583, 1684, 1764, 1875, 1957, 2072, 2156, 2283, 2379, 2510, 2608
Offset: 0

Views

Author

Paul D. Hanna, Aug 07 2002

Keywords

Examples

			a(10) = p_10 + p_8 + p_6 + p_4 + p_2 + p_0 = 29 + 19 + 13 + 7 + 3 + 1 = 72.
		

Crossrefs

Programs

  • Haskell
    a073738 n = a073738_list !! n
    a073738_list = tail zs where
       zs = 1 : 1 : zipWith (+) a006005_list zs
    -- Reinhard Zumkeller, Apr 28 2013
  • Maple
    a:= proc(n) a(n):= `if`(n<1, n+1, ithprime(n) + a(n-2)) end:
    seq(a(n), n=0..50);  # Alois P. Heinz, Jun 04 2021
  • Mathematica
    nn=60;Join[{1},Sort[Join[Accumulate[Prime[Range[1,nn+1,2]]], 1+#&/@ Accumulate[Prime[Range[2,nn,2]]]]]] (* Harvey P. Dale, May 04 2011 *)

Formula

a(n) = Sum_{m<=n, m=n (mod 2)} p_m, where p_m is the m-th prime; that is, a(2n+k) = p_(2n+k) + p_(2(n-1)+k) + p_(2(n-2)+k) +... +p_k, for 0<=k<2, where a(0)=1 and the 0th prime is taken to be 1.
a(n) = prime(n) + a(n-2) for n >= 2. - Alois P. Heinz, Jun 04 2021

A135528 1, then repeat 1,0.

Original entry on oeis.org

1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0
Offset: 1

Views

Author

N. J. A. Sloane, based on a message from Guy Steele and Don Knuth, Mar 01 2008

Keywords

Comments

This is Guy Steele's sequence GS(2, 1) (see A135416).
2-adic expansion of 1/3 (right to left): 1/3 = ...01010101010101011. - Philippe Deléham, Mar 24 2009
Also, with offset 0, parity of A036467(n-1). - Omar E. Pol, Mar 17 2015
Appears to be the Gilbreath transform of 1,2,3,5,7,11,13,... (A008578). (This is essentially the same as the Gilbreath conjecture, see A036262.) - N. J. A. Sloane, May 08 2023

Examples

			G.f. = x + x^2 + x^4 + x^6 + x^8 + x^10 + x^12 + x^14 + x^16 + x^18 + x^20 + ...
		

Crossrefs

Programs

  • Haskell
    a135528 n = a135528_list !! (n-1)
    a135528_list = concat $ iterate ([1,0] *) [1]
    instance Num a => Num [a] where
    fromInteger k = [fromInteger k]
       (p:ps) + (q:qs) = p + q : ps + qs
       ps + qs         = ps ++ qs
       (0:ps) * qs         = 0 : ps * qs
       (p:ps) * qs'@(q:qs) = p * q : ps * qs' + [p] * qs
        *                = []
    -- Reinhard Zumkeller, Apr 02 2011
  • Maple
    GS(2,1,200); [see A135416].
  • Mathematica
    Prepend[Table[Mod[n + 1, 2], {n, 2, 60}], 1] (* Michael De Vlieger, Mar 17 2015 *)
    PadRight[{1},120,{0,1}] (* Harvey P. Dale, Apr 23 2024 *)

Formula

G.f.: x*(1+x-x^2)/(1-x^2). - Philippe Deléham, Feb 08 2012
G.f.: x / (1 - x / (1 + x / (1 + x / (1 - x)))). - Michael Somos, Apr 02 2012
a(n) = A049711(n+2) mod 2. - Ctibor O. Zizka, Jan 28 2019

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

Views

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

A073737 Sums of three successive terms form the odd primes.

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 5, 7, 7, 9, 13, 9, 15, 17, 11, 19, 23, 17, 21, 29, 21, 23, 35, 25, 29, 43, 29, 31, 47, 31, 35, 61, 35, 41, 63, 45, 43, 69, 51, 47, 75, 57, 49, 85, 59, 53, 87, 71, 65, 91, 73, 69, 97, 75, 79, 103, 81, 85, 105, 87, 89, 107, 97, 103, 111, 99, 107, 125, 105, 117
Offset: 1

Views

Author

Paul D. Hanna, Aug 07 2002

Keywords

Examples

			At n=10, a(10) + a(9) + a(8) = 13 + 9 + 7 = 29 = p_10.
		

Crossrefs

Programs

  • Haskell
    a073737 n = a073737_list !! (n-1)
    a073737_list =
       1 : 1 : zipWith (-) a065091_list
                           (zipWith (+) a073737_list $ tail a073737_list)
    -- Reinhard Zumkeller, Aug 14 2011
  • Mathematica
    a[0] = 1; a[-1] = 0; a[-2] = 0; p[0] = 1; p[n_?Positive] := Prime[n]; a[n_] := a[n] = p[n] - a[n-1] - a[n-2]; Table[a[n], {n, 0, 69}] (* Jean-François Alcover, Sep 30 2011 *)
    nxt[{a_,b_,c_}]:={b,c,NextPrime[a+b+c]-(b+c)}; Transpose[NestList[nxt,{1,1,1},70]][[1]] (* Harvey P. Dale, Mar 15 2015 *)

Formula

a(n) + a(n-1) + a(n-2) = n-th prime, where a(0)=1, a(-1)=0, a(-2)=0 and the 0th prime is taken to be 1.

A073739 Least positive integers whose convolution forms a sequence whose odd-indexed terms are twice the odd primes (see: A073740).

Original entry on oeis.org

1, 1, 1, 2, 0, 3, 0, 4, 0, 7, 0, 6, 0, 11, 0, 8, 0, 15, 0, 14, 0, 17, 0, 20, 0, 21, 0, 22, 0, 25, 0, 28, 0, 31, 0, 30, 0, 37, 0, 34, 0, 39, 0, 40, 0, 43, 0, 46, 0, 51, 0, 50, 0, 53, 0, 54, 0, 55, 0, 58, 0, 69, 0, 62, 0, 75, 0, 64, 0, 85, 0, 66
Offset: 0

Views

Author

Paul D. Hanna, Aug 07 2002

Keywords

Comments

The odd-indexed bisection forms A036467, in which the pairwise sums yield the primes.

Examples

			a(10) = p_10 +p_8 +p_6 +p_4 +p_2 +p_0 = 29 + 19 + 13 +7 +3 + 1 = 72.
		

Crossrefs

Programs

  • Haskell
    import Data.List (transpose)
    a073739 n = a073739_list !! n
    a073739_list = concat $ transpose [1 : 1 : repeat 0, tail a036467_list]
    -- Reinhard Zumkeller, Aug 09 2015
  • Mathematica
    a[n_ /; n <= 2] = 1; a[?EvenQ] = 0; a[n] := a[n] = Prime[(n + 1)/2] - a[n - 2]; Table[a[n], {n, 0, 71}] (* Jean-François Alcover, Aug 01 2013 *)

Formula

a(n) = p_n - p_{n-1} when n>1, where a(0)=a(1)=1.

A073740 Self-convolution of A073739; odd-indexed terms are twice the odd primes.

Original entry on oeis.org

1, 2, 3, 6, 5, 10, 10, 14, 20, 22, 39, 26, 64, 34, 104, 38, 152, 46, 225, 58, 308, 62, 434, 74, 556, 82, 763, 86, 936, 94, 1224, 106, 1488, 118, 1857, 122, 2244, 134, 2706, 142, 3232, 146, 3827, 158, 4472, 166, 5240, 178, 6020, 194, 6997, 202, 7936, 206, 9122
Offset: 0

Views

Author

Paul D. Hanna, Aug 07 2002

Keywords

Comments

The first odd prime is here considered to be p_0 = 1.

Examples

			a(9) = 2*p_4 = 22; a(8) = 1*0+1*4+1*0+2*3+0*0+3*2+0*1+4*1+0*1 = 20.
		

Crossrefs

Programs

  • Haskell
    a073740 n = a073740_list !! n
    a073740_list = tail $ f a073739_list [] where
       f (x:xs) ys = (sum $ zipWith (*) ys a073739_list) : f xs (x : ys)
    -- Reinhard Zumkeller, Aug 09 2015
  • Mathematica
    (* b = A073739 *) b[n_ /; n <= 2] = 1; b[?EvenQ] = 0; b[n] := b[n] = Prime[(n+1)/2] - b[n-2]; a[0] = 1; a[1] = 2; a[n_?OddQ] := 2*Prime[(n-1)/2+1]; a[n_?EvenQ] := Sum[b[k]*b[n-k], {k, 0, n}]; Table[a[n], {n, 0, 54}] (* Jean-François Alcover, Aug 01 2013 *)

Formula

a(0) = 1, a(2n+1) = 2*p_n, a(2n) = Sum_{k=0..2n} A073739(k)*A073739(2n-k).

A137462 a(n) + a(n-1) = n-th semiprime.

Original entry on oeis.org

1, 3, 3, 6, 4, 10, 5, 16, 6, 19, 7, 26, 8, 27, 11, 28, 18, 31, 20, 35, 22, 36, 26, 39, 30, 44, 33, 49, 36, 50, 37, 54, 39, 55, 40, 66, 45, 70, 48, 71, 50, 72, 51, 78, 55, 79, 62, 80, 63, 82, 64, 91, 67, 92, 69, 97, 72, 105, 73, 110, 75, 112, 82, 119, 83, 120, 85, 121, 88, 125
Offset: 0

Views

Author

Jonathan Vos Post, Apr 19 2008

Keywords

Comments

This is to A001358 as A036467 is to A000040.

Crossrefs

Programs

  • Maple
    A001358 := proc(n) option remember ; if n =1 then 4; else for a from A001358(n-1)+1 do if numtheory[bigomega](a) = 2 then RETURN(a) ; fi ; od: fi ; end: A137462 := proc(n) option remember; if n =0 then 1; else A001358(n)-A137462(n-1) ; fi ; end: seq(A137462(n),n=0..100) ; # R. J. Mathar, Apr 23 2008
  • Mathematica
    Module[{nn=300,sp,k=1},sp=Select[Range[nn],PrimeOmega[#]==2&];Join[{1}, Table[k=sp[[n]]-k,{n,Length[sp]}]]] (* Harvey P. Dale, Apr 30 2015 *)

Formula

a(n) + a(n-1) = A001358(n).

Extensions

More terms from R. J. Mathar, Apr 23 2008

A338467 a(n+1) = prime(n) + 2*n - a(n). a(1) = 1.

Original entry on oeis.org

1, 3, 4, 7, 8, 13, 12, 19, 16, 25, 24, 29, 32, 35, 36, 41, 44, 49, 48, 57, 54, 61, 62, 67, 70, 77, 76, 81, 82, 85, 88, 101, 94, 109, 98, 121, 102, 129, 110, 135, 118, 143, 122, 155, 126, 161, 130, 175, 144, 181, 148, 187, 156, 191, 168, 199, 176, 207, 180, 215
Offset: 1

Views

Author

Carole Dubois, Jan 31 2021

Keywords

Examples

			a(1) + a(2) - 2*1 = 1st prime; 1 + 3 - 2*1 = 2.
a(13) + a(14) - 2*13 = 13th prime; 32 + 35 - 2*13 = 41.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n=1, 1,
          ithprime(n-1)-a(n-1)+2*n-2)
        end:
    seq(a(n), n=1..60);  # Alois P. Heinz, Jan 31 2021
  • Mathematica
    a[1] = 1; a[n_] := a[n] = Prime[n - 1] + 2*(n - 1) - a[n - 1]; Array[a, 60] (* Amiram Eldar, Feb 01 2021 *)
  • PARI
    a(n) = if (n==1, 1, prime(n-1) + 2*(n-1) - a(n-1)); \\ Michel Marcus, Jan 31 2021
  • Python
    from sympy import prime
    S=[1]
    nomb=100
    for n in range(1,nomb):
        derterm=S[-1]
        terme= prime(n)-derterm+2*(len(S))
        S.append(terme)
    print(S)
    

Formula

a(n+1) = A078916(n) - a(n). - Michel Marcus, Jan 31 2021
Showing 1-8 of 8 results.